TLMBP โ€“ The Last Motion Blueprint ๐Ÿš€

TLMBP โ€“ The Last Motion Blueprint :rocket:

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!


:inbox_tray: One-Click Import

Import TLMBP


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_id is set โ†’ this automation was last in control โ†’ proceed normally
  • parent_id is 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.

:bulb: This works correctly with Alexa via Nabu Casa โ€” tested and confirmed.
Alexa does not set user_id but also does not set parent_id, making parent_id the reliable detection method.


Full Feature List

  • :white_check_mark: Multiple motion/presence sensors per instance
  • :white_check_mark: Four time-based scenes (Morning / Day / Evening / Night) with configurable start times
  • :white_check_mark: Midnight-spanning night block (e.g. 22:00 โ†’ 06:00)
  • :white_check_mark: Illuminance cutoff โ€” only trigger when dark enough
  • :white_check_mark: Configurable trigger delay for slow Zigbee/Hue sensors
  • :white_check_mark: Automation Blocker โ€” completely suppress the automation
  • :white_check_mark: Manual Override Detection via context.parent_id โ€” works with Alexa and HA UI
  • :white_check_mark: Graceful fallback to direct turn_on when no scene is configured
  • :white_check_mark: 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:
:point_right: [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. :raised_hands:


*Tested with: Alexa via Nabu Casa, Zigbee2MQTT, Philips Hue, Home Assistant Core 2026.3.4 /Home Assistant OS 17.1

2 Likes