Fix button showing as unavailable on HA restart
Buttons should show as `off` when state is `unknown`. Same is valid for: - button - input_button - scene
This commit is contained in:
@@ -4442,7 +4442,7 @@ action:
|
||||
item_domain: "{{ repeat.item.entity.split('.')[0] | default('unknown') }}"
|
||||
# {{ states(entity_id) | default('unavailable') if entity_id is string else 'unavailable' }}
|
||||
current_entity_state: "{{ states(repeat.item.entity) | default('unavailable') }}"
|
||||
current_entity_state_available: "{{ current_entity_state not in ['unknown', 'unavailable', None] }}"
|
||||
current_entity_state_available: "{{ current_entity_state not in ['unavailable'] }}"
|
||||
# Button PIC GRAY/WHITE
|
||||
btn_pic: "{{ nextion.pics.button.on if current_entity_state in ['on', 'open', 'opening', 'home'] or (item_domain == 'climate' and current_entity_state != 'off') else nextion.pics.button.off }}"
|
||||
# TEXT, BRIGHTNESS and ICON Background
|
||||
|
||||
Reference in New Issue
Block a user