New to homeassistant so pardon my ignorance.
I am trying to create a single binary sensor that will be ‘ON’ IFF
- if is between 4:00 and 9:00 OR
- if it is between 15:00 and 20:100:
From some basic searching it seemed like the recommendation was to have multiple binary sensors ( one for each time range ) and then have another that is determined by the state of the individuals.
I have already created the two time based binary sensors
- platform: tod
name: 'plant_fan_4am_to_9am'
after: '4:00'
before: '9:00'
but when I try to create the combined binary sensor it gets stuck at the first value.
- platform: template
sensors:
plant_fan_expected_state:
friendly_name: "Plant Fan Expected State"
value_template: >-
{% if is_state( 'binary_sensor.plant_fan_4am_to_9am', 'on' ) %}
on
{% elif is_state( 'binary_sensor.plant_fan_3pm_to_8pm', 'on' ) %}
on
{% else %}
off
{% endif %}
Any thoughts on how I get the combined binary sensor to update when the individual sensors update?
My long term goal is to feed the combined binary sensor into an automation that controls a plant fant that triggers when its state changes.
I like this format to allow me to change the state of the plant fan manually then I can manually trigger the automation and it will resume the “expected” state.