Skip to content

Instantly share code, notes, and snippets.

@mm98
mm98 / motion_ambient_nightmode_lights.yaml
Last active November 1, 2025 15:12
Home Assistant Blueprint: Motion-Activated Light Control with Ambient Light Awareness
blueprint:
name: Motion-Triggered Adaptive Light
description: |
Controls a light based on motion, ambient brightness, and color temperature. Activates the light when motion is detected and ambient light is below the threshold, and turns it off after motion stops or ambient light rises. Supports optional night mode with lower brightness, blocking entities, and automatic light reset after Home Assistant restart or power recovery.
### 🧾 Version History
**v1.1.3**: Null Checking in Wait Triggers
- Added null checks in `wait_for_trigger` templates to prevent "UndefinedError" exceptions in Home Assistant.
- Addresses a known HA issue where template triggers can fail if entity references are not yet available.
@mm98
mm98 / motion_ambient_lights.yaml
Last active October 28, 2025 10:19
Home Assistant Blueprint: Motion-Activated Light Control with Ambient Light Awareness
blueprint:
name: "Motion-Activated Light Control with Ambient Light Awareness"
description: "Controls a light based on motion and ambient light. Activates the light when motion is detected and ambient light is below the threshold, and turns it off after motion stops or ambient light rises. Can optionally be blocked by entities or turn off after Home Assistant restart or power recovery."
source_url: https://gist.github.com/mm98/a1375c1d34edc6c00518ebde9817791a
domain: automation
author: mm98
homeassistant:
min_version: "2024.10.0"