Last active
January 4, 2022 20:28
-
-
Save addrum/003adc3c313b8aa027b339accfe85ec4 to your computer and use it in GitHub Desktop.
Home Assistant input boolean sync'd automations
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: Toggle automations based on input boolean | |
description: Keep automations' states in sync with input boolean | |
domain: automation | |
source_url: https://gist.github.com/addrum/003adc3c313b8aa027b339accfe85ec4 | |
input: | |
input_boolean_entity: | |
name: Input Boolean | |
description: This input boolean will toggle the automations state. | |
selector: | |
entity: | |
domain: input_boolean | |
target_automations: | |
name: Automations | |
description: The automations to keep in sync. | |
selector: | |
target: | |
entity: | |
domain: automation | |
actions: | |
name: Actions | |
description: Notifications or similar to be run. | |
default: {} | |
selector: | |
action: {} | |
trigger: | |
- platform: state | |
entity_id: !input 'input_boolean_entity' | |
action: | |
- service: "{% if trigger.to_state.state == \"on\" %}\n automation.turn_on\n{% else\ | |
\ %}\n automation.turn_off\n{% endif %}\n" | |
target: !input 'target_automations' | |
- choose: [] | |
default: !input 'actions' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment