Hi everyone,
I wanted to share a robust Auto/Manual Override strategy that I designed for my roller shutters, screens, and lighting. It solves the classic smart-home frustration where a human manually adjusts a device, only for an automation to overwrite it a few minutes later.
This setup uses two simple concepts: Context-Aware Overrides and an Automatic Self-Healing Timer.
The Core Features:
- Zero Dashboard Clutter (Invisible Trigger): It uses Home Assistant’s built-in
context.user_id. The system automatically detects if a device was moved by a human finger (app/wall switch) vs. an automation backend. - True Manual Lock: The moment a human triggers the device, a dashboard dropdown (
input_select) flips to "Manual", completely freezing all background automation logic (weather, sun, timers). - Self-Healing Timer: It starts a physical 2-hour helper timer. When the timer expires, the system automatically switches back to "Auto" and immediately triggers a sync to calculate the correct state of the house based on current sensor values (sun position, wind, rain).
4
Step 1: Create the Helpers
Create an input_select and a timer via Settings -> Device & Services -> Helpers:
- Dropdown (
input_select.shutter_mode): Options:Auto,Manual - Timer (
timer.shutter_manual_lock): Duration:02:00:00
Step 2: The "Invisible Controller" Automation
This lightweight automation manages the manual lock state and the timer. It safely ignores any changes made by the system itself.
alias: "Mode Manager: Shutter Manual Lock"
description: "Flips state to Manual on human intervention and starts a 2-hour self-healing timer."
mode: restart
triggers:
- trigger: state
entity_id: cover.living_room_shutter
id: shutter_moved
- trigger: state
entity_id: timer.shutter_manual_lock
to: idle
id: timer_expired
actions:
- choose:
# SITUATION 1: Shutter was moved manually by a USER
- conditions:
- condition: trigger
id: shutter_moved
- condition: template
value_template: "{{ trigger.to_state.context.user_id is not none }}"
sequence:
- action: input_select.select_option
data:
option: Manual
target:
entity_id: input_select.shutter_mode
- action: timer.start
target:
entity_id: timer.shutter_manual_lock
# SITUATION 2: 2-Hour Timer Expired -> Return to Auto Mode
- conditions:
- condition: trigger
id: timer_expired
sequence:
- action: input_select.select_option
data:
option: Auto
target:
entity_id: input_select.shutter_mode
Step 3: Protect your Main Automation
In your main shutter/lighting automation, add a global condition at the very top. Also, add a trigger that listens to the mode switching back to Auto so it instantly recovers its target position!
alias: "Main Shutter Logic"
triggers:
- trigger: sun
event: sunset
# CRITICAL: Trigger immediately when mode restores to Auto to catch up on state changes!
- trigger: state
entity_id: input_select.shutter_mode
to: Auto
conditions:
# GLOBAL LOCK: Drop out immediately if human operator took control
- condition: state
entity_id: input_select.shutter_mode
state: Auto
actions:
- choose:
# Your existing weather, sun, time logic options go here...
Why this approach :
- No messy templates inside your device actions.
- It survives Home Assistant restarts because it uses a physical timer entity instead of a script delay.
- Highly scalable: You can group all your home's manual overrides into a single central "Interlock Manager" automation using a
chooseblock for shutters, screens, and dimmers.
Let me know what you think or if you want to convert this into a blueprint!