I have lutron caseta light switches throughout my entire house, and I wanted a “manual” mode that would allow me to manually press light switches without other automations turning lights on and off once the room was placed in “manual” mode. This does require creating input_booleans for each room. For example “input_boolean.living_room_manual.” Then other automations check if manual mode is set as a condition for the area the entity is in. I also use the “99%” light trick so automations that turn on lights set them to 99% brightness, allowing me to press the light on button, setting them to 100% and turning on the manual mode. This also sets my input boolean of _occupied for the area that the light was pressed.
alias: Manual Press Automation (Lutron Caseta)
description: >-
Detects physical wall presses (On or Dimming) via Context to enable Manual
Mode.
triggers:
- trigger: state
entity_id:
- light.office_light
- light.office_bathroom_light
- light.hallway_light
- light.master_bedroom_light
- light.master_bathroom_light
- light.laundry_room_light
- light.kitchen_light
- light.living_room_light
- light.living_room_front_light
- light.dining_room_light
- light.powder_room_light
- light.loft_light
- light.pilates_room_light
- light.pilates_bathroom_light
- light.lower_stairs_light
- light.upper_stairs_light
conditions:
- condition: state
entity_id: input_boolean.away
state: "off"
actions:
- choose:
- conditions:
- condition: template
value_template: "{{ is_state(trigger.entity_id, 'on') }}"
- condition: template
value_template: |-
{{ trigger.to_state.context.id != none and
trigger.to_state.context.parent_id == none and
trigger.to_state.context.user_id == none }}
sequence:
- action: input_boolean.turn_on
target:
entity_id: input_boolean.{{ area }}_manual
data: {}
- action: input_boolean.turn_on
target:
entity_id: input_boolean.{{ area }}_occupied
data: {}
- conditions:
- condition: template
value_template: "{{ is_state(trigger.entity_id, 'off') }}"
- condition: template
value_template: "{{ is_state('input_boolean.' ~ area ~ '_manual', 'on') }}"
sequence:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.{{ area }}_manual
- action: input_boolean.turn_off
target:
entity_id: input_boolean.{{ area }}_occupied
data: {}
mode: parallel
max: 10
variables:
area: "{{ area_name(trigger.entity_id) | lower | replace(' ', '_') }}"