I’ve read the Template Sensor documentation, but it seems like my attempt at an “OR” combination of sensors does not work:
sensors:
combined_motion_porch:
friendly_name: "Combined Motion Porch"
device_class: motion
entity_id:
- binary_sensor.porch_motion_sensor
- sensor.blueiris_motion_porch
value_template: >-
{% if is_state('binary_sensor.porch_motion_sensor', 'on')
or is_state('sensor.blueiris_motion_porch', 'on') %}
on
{% else %}
off
{% endif %}
All three sensors show up in dev-state, but binary_sensor.combined_motion_porch never changes from the off state. Can anyone point out what I’m doing wrong?
Your template looks right to me, and I tested it with two binary sensors in my system, and it does work as expected. (on if either binary sensor is on)
To troubleshoot this, I would use the template editor, and separate out the two sensors to see what is working and what is not working. like this: