mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-08-19 11:38:22 +00:00
Back Alive!
This commit is contained in:
10
python_scripts/peopleathome.py
Executable file
10
python_scripts/peopleathome.py
Executable file
@@ -0,0 +1,10 @@
|
||||
home = 0
|
||||
for entity_id in hass.states.entity_ids('device_tracker'):
|
||||
state = hass.states.get(entity_id)
|
||||
if state.state == 'home':
|
||||
home = home + 1
|
||||
|
||||
hass.states.set('sensor.people_home', home, {
|
||||
'unit_of_measurement': 'people',
|
||||
'friendly_name': 'People home'
|
||||
})
|
Reference in New Issue
Block a user