Last active
January 9, 2022 21:19
-
-
Save kristofer84/c10808f4fc049e1b6deabfb33bdc22f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Generic trigger template (two triggers) | |
description: Turn one or more devices on/off based on a trigger | |
domain: automation | |
input: | |
trigger_device: | |
name: First trigger | |
description: Either trigger will alter the state of the devices. | |
selector: | |
entity: | |
trigger_device2: | |
name: Second trigger | |
selector: | |
entity: | |
target_device: | |
name: Devices | |
description: The devices to keep in sync. | |
selector: | |
target: | |
trigger: | |
- platform: state | |
entity_id: !input trigger_device | |
- platform: state | |
entity_id: !input trigger_device2 | |
action: | |
- service: > | |
{% if trigger.to_state.state == "on" %} | |
homeassistant.turn_on | |
{% else %} | |
homeassistant.turn_off | |
{% endif %} | |
target: !input target_device |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment