Advertisement
JLindvig

XOR

Sep 11th, 2022
1,174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.48 KB | None | 0 0
  1. {% if is_state('binary_sensor.gate_closed', 'off') and is_state('binary_sensor.gate_open', 'on') %}
  2. closed
  3. {% elif is_state('binary_sensor.gate_closed', 'on') and is_state('binary_sensor.gate_open', 'off') %}
  4. open
  5. {% elif is_state('binary_sensor.gate_closed', 'on') and is_state('binary_sensor.gate_open', 'on') %}
  6.   {% if states.binary_sensor.gate_closed.last_changed > states.binary_sensor.gate_open.last_changed %}
  7.     opening
  8.   {% else %}
  9.     closing
  10.   {% endif %}
  11. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement