I’ve got a template sensor (which works):
sensor:
- platform: template
sensors:
main_floor_hvac_action:
friendly_name: "Main Floor HVAC Action"
value_template: "{{ state_attr('climate.main_floor', 'hvac_action') }}"
So I created a template binary sensor to simply check when my template sensor has the state of “cooling”
binary_sensor:
- platform: template
sensors:
main_floor_hvac_cooling:
entity_id: "sensor.main_floor_hvac_action"
friendly_name: "Main Floor HVAC Cooling"
value_template: >-
{{ is_state_attr('sensor.main_floor_hvac_action', 'cooling') }}
But the binary sensor is always off. I can query the sensor and see that the state shows “cooling” but the binary sensor just doesn’t see it.
Any ideas?