initial commit
This commit is contained in:
75
state-opposite.yaml
Normal file
75
state-opposite.yaml
Normal file
@ -0,0 +1,75 @@
|
||||
blueprint:
|
||||
name: Opposite State Synchronizer
|
||||
description: >
|
||||
Keeps two entities in opposite states. If entity 1 turns on, entity 2 turns off, and vice versa.
|
||||
domain: automation
|
||||
input:
|
||||
entity_1:
|
||||
name: Entity 1
|
||||
selector:
|
||||
entity:
|
||||
domain:
|
||||
- light
|
||||
- switch
|
||||
entity_2:
|
||||
name: Entity 2
|
||||
selector:
|
||||
entity:
|
||||
domain:
|
||||
- light
|
||||
- switch
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: !input entity_1
|
||||
id: entity_1
|
||||
- platform: state
|
||||
entity_id: !input entity_2
|
||||
id: entity_2
|
||||
|
||||
condition: []
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: entity_1
|
||||
- condition: state
|
||||
entity_id: !input entity_1
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: !input entity_2
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: entity_1
|
||||
- condition: state
|
||||
entity_id: !input entity_1
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: !input entity_2
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: entity_2
|
||||
- condition: state
|
||||
entity_id: !input entity_2
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: !input entity_1
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: entity_2
|
||||
- condition: state
|
||||
entity_id: !input entity_2
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: !input entity_1
|
||||
mode: single
|
||||
|
Reference in New Issue
Block a user