TLMBP โ The Last Motion Blueprint 
A motion automation blueprint that actually knows when to step back.
TL;DR
Most motion blueprints turn lights on and off. TLMBP does that too โ but it also detects when youโve taken manual control (via UI or Alexa) and protects your current lighting state from being overridden or turned off by motion events.
One blueprint. Every room. Every case.
I started with YAMA v10 and extended it quite a bit, because I wasnโt fully happy with the results for my own setup. I tried my best, and Iโm pretty happy with where it ended up. Big thanks to YAMA for the solid foundation!
One-Click Import
The Problem with Most Motion Blueprints
You set the perfect mood lighting. Dimmed, warm, exactly right for the evening.
Then someone walks through the room โ and the automation resets everything back to the scene. Annoying.
Or: you have 5 spots for the motion zone in your dining room, but youโve switched on all 11 manually. Motion triggers again โ automation turns off all 11. Not what you wanted.
TLMBP solves both.
How It Works โ Manual Override Detection
TLMBP reads the context.parent_id of a reference light entity after every state change:
parent_idis set โ this automation was last in control โ proceed normallyparent_idis None โ a user (UI or Alexa via Nabu Casa) was last in control โ stand back
When a manual override is detected:
- MOTION ON: Scene or brightness is NOT re-applied โ your current state is preserved
- MOTION OFF: The light is NOT turned off โ you stay in control
The override clears automatically once the light is turned off completely. No helpers, no extra automations, no timers needed.
This works correctly with Alexa via Nabu Casa โ tested and confirmed.
Alexa does not setuser_idbut also does not setparent_id, makingparent_idthe reliable detection method.
Full Feature List
Multiple motion/presence sensors per instance
Four time-based scenes (Morning / Day / Evening / Night) with configurable start times
Midnight-spanning night block (e.g. 22:00 โ 06:00)
Illuminance cutoff โ only trigger when dark enough
Configurable trigger delay for slow Zigbee/Hue sensors
Automation Blocker โ completely suppress the automation
Manual Override Detection via context.parent_idโ works with Alexa and HA UI
Graceful fallback to direct turn_onwhen no scene is configured
Fully optional features โ use only what you need
Real-World Use Cases
Dining Room
5 spots controlled by motion. You switch on all 11 via Alexa.
โ TLMBP detects the manual override. Motion no longer turns off the lights.
Living Room
Evening scene at 40% triggered by motion. You ask Alexa for 100%.
โ TLMBP detects the change. Next motion event does not re-apply the scene.
Bedroom
Partner is sleeping. You activate the Automation Blocker.
โ The entire automation is suppressed. No turn-on, no turn-off.
GitHub & Documentation
Full documentation, all inputs explained, and known limitations:
[GitHub - Manu4771/ha-TLMBP-The-Last-Motion-Blueprint-: The last motion automation blueprint you'll ever need for Home Assistant. ยท GitHub]
Credits & Background
Based on [YAMA V10] by @networkingcat โ thank you for the solid foundation.
TLMBP extends the original with context-aware manual override detection, a restructured blocker, and improved scene handling.
Feedback Welcome
This is v1.0.0. If you run into edge cases, unexpected behaviour, or have ideas for new features โ open an issue on GitHub or reply here. Happy to improve it together. ![]()
*Tested with: Alexa via Nabu Casa, Zigbee2MQTT, Philips Hue, Home Assistant Core 2026.3.4 /Home Assistant OS 17.1