Door sensor where open means Not Smoking and closed means Smoking.
I attempted to use a binary_sensor template for the smoking status but I only get on and off.
Any help is appreciated.
- platform: template
sensors:
timsmoke_status:
friendly_name: "Tim Status"
entity_id:
- binary_sensor.stairwell_door_contact
value_template: >
{% if is_state('binary_sensor.stairwell_door_contact', 'on') %}
Not_Smoking
{% else %}
Smoking
{% endif %}
icon_template: >
{% if is_state('binary_sensor.stairwell_door_contact', 'on') %}
mdi:smoking-off
{% else %}
mdi:smoking
{% endif %}
The icon change works great! Just the text won’t change.
So just the icon changes:
hmm…