Skip to content

Instantly share code, notes, and snippets.

@dankarization
Last active April 14, 2023 08:01
Show Gist options
  • Save dankarization/30cfc6d1a05292f22d596011902e28c1 to your computer and use it in GitHub Desktop.
Save dankarization/30cfc6d1a05292f22d596011902e28c1 to your computer and use it in GitHub Desktop.
Home Assistant Intertlock 2 entities
blueprint:
name: Interlock 2 entities
description: Turns off one entity when the other one is turned on
domain: automation
input:
entity_1:
name: First entity
selector:
entity:
entity_2:
name: Second entity
selector:
entity:
mode: single
max_exceeded: silent
variables:
entity_1: !input 'entity_1'
entity_2: !input 'entity_2'
trigger:
- platform: state
entity_id: !input 'entity_1'
- platform: state
entity_id: !input 'entity_2'
condition: '{{ trigger.to_state.state == "on" }}'
action:
- service: homeassistant.turn_off
target:
entity_id: >
{% if trigger.from_state.entity_id == entity_1 %}
{{ entity_2 }}
{% else %}
{{ entity_1 }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment