mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add xor automation condition (#5453)
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user