Hello,
I have the following sensor created in my configuration.yaml:
- platform: template
sensors:
office_window:
icon_template: mdi:window-open
friendly_name: Sensor Office Window
value_template: >
{% if is_state('binary_sensor.geam_office', 'on') %}
DESCHIS
{% else %}
INCHIS
{% endif %}
{% if states('binary_sensor.geam_office') == 'unavailable' %}
{{ states('sensor.office_window') }}
{% else %}
{{ states('binary_sensor.geam_office') }}
{% endif %} `
In the first if part I tried to convert On/Off message to Inchis/Deschis and in the second one l ignored the Unavailable status of the sensor ( the window sensor go in sleep mode after 15 seconds)
Everything works but now I have the both messages from sensor on Glance card:
INCHIS Off and DESCHIS On
Can somebody help me please?
Thanks
Marius