Back Alive!

This commit is contained in:
Mahasri Kalavala
2019-04-17 18:46:06 -04:00
parent 929e0b336e
commit 2a0dd39795
255 changed files with 137143 additions and 0 deletions

17
python_scripts/hide_unwanted.py Executable file
View File

@@ -0,0 +1,17 @@
'''
@Author : Mahasri Kalavala
@Date : 08/27/2017
@Description : This python script hides all the sensors that are Online, so that
ONLY the Offline sensors are visible in the UI
'''
for entity_id in hass.states.entity_ids('sensor'):
entity_state_object = hass.states.get(entity_id)
attributes = entity_state_object.attributes.copy()
""" Hide all the entities that have 'Online' Status """
if entity_state_object.state == 'Online':
attributes['hidden'] = True
else:
attributes['hidden'] = False
hass.states.set(entity_id, entity_state_object.state, attributes=attributes)