1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Add xor automation condition (#5453)

This commit is contained in:
kahrendt
2023-10-03 05:58:11 -04:00
committed by GitHub
parent f38849828d
commit 88bb051f37
3 changed files with 55 additions and 4 deletions

View File

@@ -3104,11 +3104,39 @@ time:
- platform: ds1307
id: ds1307_time
update_interval: never
on_time:
seconds: 0
then: ds1307.read_time
i2c_id: i2c_bus
on_time:
- seconds: 0
then: ds1307.read_time
- at: "16:00:00"
then:
- if:
condition:
or:
- binary_sensor.is_on: close_sensor
- binary_sensor.is_on: open_sensor
then:
logger.log: "close_sensor or open_sensor is on"
- if:
condition:
and:
- binary_sensor.is_on: close_sensor
- binary_sensor.is_on: open_sensor
then:
logger.log: "close_sensor and open_sensor are both on"
- if:
condition:
xor:
- binary_sensor.is_on: close_sensor
- binary_sensor.is_on: open_sensor
then:
logger.log: "close_sensor or open_sensor is exclusively on"
- if:
condition:
not:
- binary_sensor.is_on: close_sensor
then:
logger.log: "close_sensor is not on"
cover:
- platform: template
name: Template Cover