Following up on the fame, acclaim, and riches brought by my “Simple High/Low Threshold Actions” blueprint, I introduce: Simple Boolean Actions. Another super basic blueprint that is literally just a super lazy way of doing thing A when something turns on, and thing B when that thing turns off. Between the thresholds actions and now this boolean one about 90% of my basic automations are covered.
EXAMPLE PIC
IMPORT HERE
THE YAML
blueprint:
name: Simple Boolean Actions
description: |
Run separate actions when an entity turns on or off.
Actions are optional; leave one blank if you only need to trigger on one state.
domain: automation
input:
triggering_entity:
name: "Triggering Entity"
description: "The entity to watch (e.g., switch, binary sensor, input boolean)."
selector:
entity:
# Domains that typically have on/off states
filter:
- domain: "binary_sensor"
- domain: "switch"
- domain: "light"
- domain: "input_boolean"
on_action:
name: "On Action"
description: "What to do when the entity turns ON. (Optional)"
selector:
action: {}
default: []
off_action:
name: "Off Action"
description: "What to do when the entity turns OFF. (Optional)"
selector:
action: {}
default: []
trigger:
- platform: "state"
entity_id: !input "triggering_entity"
to: "on"
id: "trigger_on"
- platform: "state"
entity_id: !input "triggering_entity"
to: "off"
id: "trigger_off"
condition: []
actions:
- choose:
- conditions:
- condition: "trigger"
id: "trigger_on"
sequence: !input "on_action"
- conditions:
- condition: "trigger"
id: "trigger_off"
sequence: !input "off_action"
mode: "single"