Skip to content

Home Assistant sensor which allows you to get information about successful logins.

License

Notifications You must be signed in to change notification settings

liri/sensor.successful_logins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sensor.successful_logins

Home Assistant sensor which allows you to get information about successful logins.

To get started put /custom_components/successful_logins/sensor.py in your config directory: <config directory>/custom_components/successful_logins/sensor.py

For example: /home/homeassistant/.homeassistant/custom_components/successful_logins/sensor.py

Example configuration.yaml:

# if you're missing a logger setup, paste the below in your configuration.yaml file
logger:
  default: critical

# this is the setup of the custom sensor
sensor:
  - platform: successful_logins

Configuration variables:

key required default description
platform yes The sensor platform name.
enable_notification no true Turn on/off persistant_notifications when a new IP is detected, can be true/false.
exclude no A list of IP adresses you want to exclude.
provider no 'ipapi' The provider you want to use for GEO Lookup, 'ipapi', 'extreme', 'ipvigilante'.
log_location no Full path to the logfile.
time_frame 12 The sensor scan time frame in log file, value is in hours.

Default view: Default view

Card view: Card view

If a new IP is detected, it will be added to a .logged_in_ips.yaml file in your configdir, with this information:

8.8.8.8:
  ip_address: 8.8.8.8
  city: Mountain View
  country: US
  hostname: google-public-dns-a.google.com
  last_authenticated: '2018-07-26 09:27:01'
  previous_authenticated_time: '2018-07-26 09:27:01'
  region: california

If not disabled, you will also be presented with a persistent_notification about the event:
notification

Debug logging

In your configuration.yaml

logger:
  default: warn
  logs:
    custom_components.sensor.successful_logins: debug

About

Home Assistant sensor which allows you to get information about successful logins.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages