Skip to content

Instantly share code, notes, and snippets.

@addrum
Last active January 4, 2022 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save addrum/003adc3c313b8aa027b339accfe85ec4 to your computer and use it in GitHub Desktop.
Save addrum/003adc3c313b8aa027b339accfe85ec4 to your computer and use it in GitHub Desktop.
Home Assistant input boolean sync'd automations
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