I have a template binary sensor that determines whether my HVAC fan should be on. This is in my templates.yaml file:
- name: 'Main Floor Fan Should Be On'
state: >
{% if is_state('sensor.basement_floor_heating_activity', 'heating') or (is_state('binary_sensor.somebody_is_home', 'on') and (is_state('binary_sensor.living_room_occupancy', 'on') or states('sensor.main_floor_temperature_differential') | float > 3 | float))%}
on
{% else %}
off
{% endif %}
As you can see, the sensor goes ‘unavailable’ quite a bit. In the history it seems this is triggered by either the basement floor heating mode being changed or the living room occupancy turning off. The state histories for these entities don’t have any ‘unavailable’ state in them:
I’m a bit puzzled as to why it works sometimes and goes unavailable other times. Any ideas?