This template does not work:
The cases for auto1, auto2 and auto3, never happens, even if the the conditions are met.
The “binary_sensor.dishwasher_running_program” is alive and working, but the last 4 elif statements get true even if “binary_sensor.dishwasher_running_program” of on…
I am making no sense from this. Any ideas?
- platform: template
sensors:
dish_washer_status:
friendly_name: 'Dishwasher'
value_template: >-
{% if is_state('switch.diskmaskin_program_auto1','on') %}
Done in {{ now() - states('sensor.diskmaskin_remaining_program_time') }}
{% elif is_state('switch.diskmaskin_program_auto2','on') %}
Done in {{ now() - states('sensor.diskmaskin_remaining_program_time') }}
{% elif is_state('switch.diskmaskin_program_auto3','on') %}
Done in {{ now() - states('sensor.diskmaskin_remaining_program_time') }}
{% elif is_state('binary_sensor.diskmaskin_door','on') and is_state('switch.diskmaskin_power','off') and is_state('binary_sensor.dishwasher_running_program','off') %}
Door open/Turned off
{% elif is_state('binary_sensor.diskmaskin_door','off') and is_state('switch.diskmaskin_power','on') and is_state('binary_sensor.dishwasher_running_program','off') %}
Door closed/Turned on
{% elif is_state('binary_sensor.diskmaskin_door','on') and is_state('switch.diskmaskin_power','on') and is_state('binary_sensor.dishwasher_running_program','off') %}
Door open/Turned on
{% elif is_state('binary_sensor.diskmaskin_door','off') and is_state('switch.diskmaskin_power','off') and is_state('binary_sensor.dishwasher_running_program','off') %}
Door closed/Turned off
{% else %}
Unknown
{% endif %}
entity_picture_template: >-
{% if is_state('switch.diskmaskin_program_auto1','on') %}
/local/auto.png
{% elif is_state('switch.diskmaskin_program_auto2','on') %}
/local/auto45.png
{% elif is_state('switch.diskmaskin_program_auto3','on') %}
/local/auto65.png
{% elif is_state('binary_sensor.diskmaskin_door','on') and is_state('switch.diskmaskin_power','off') and is_state('binary_sensor.dishwasher_running_program','off') %}
/local/doorOpenpowerOff.png
{% elif is_state('binary_sensor.diskmaskin_door','off') and is_state('switch.diskmaskin_power','on') and is_state('binary_sensor.dishwasher_running_program','off') %}
/local/doorClosedpowerOn.png
{% elif is_state('binary_sensor.diskmaskin_door','on') and is_state('switch.diskmaskin_power','on') and is_state('binary_sensor.dishwasher_running_program','off') %}
/local/doorOpenpowerOn.png
{% elif is_state('binary_sensor.diskmaskin_door','off') and is_state('switch.diskmaskin_power','off') and is_state('binary_sensor.dishwasher_running_program','off') %}
/local/doorClosedpowerOff.png
{% else %}
/local/unknown.png
{% endif %}