More template fun from me today, I see historically you could use value templates when creating a template sensor, but I can’t see anything like that in the documentation for the modern templates,
Basically I am trying to take the value from a sensor and pass it on, unless it’s ‘unavailable’ in which case replace it with N/A or Off.
sensor:
- name: Kitchen_timer
value_template: >
{% if states('sensor.kitchen_echo_next_timer') == "unavailable" %}
{{states('N/A')}}
{% else %}
{{states('sensor.kitchen_echo_next_timer')}}
{% endif %}
This is what I’ve come up with based on a sensor template info I’ve managed to find, but obviously I am doing sometehing wrong, anyone got any ideas.
4 posts - 4 participants