homelab-codex-ws/services/home-assistant/config/ken-legacy/blueprints/automation/homeassistant/motion_light.yaml
oskar 970b8cc023 feat(ha): archival import of ken-legacy config
Read-only import of the pre-migration homeassistant5 container (piha),
per DESIGN.md phase-0 scope: 60 automations (split one-file-per-id),
5 scenes, 1 script, plus curated .storage/* export (area/entity
registries, input_boolean/input_text, lovelace dashboards).

No token at ~/.config/ha-deploy/ken-legacy.token — fixtures step
fail-softed as designed, no repo import.sh changes needed. Verified:
gitignore-excluded paths (secrets.yaml, *.db*, logs, .storage/auth*,
core.restore_state, tts/, deps/, backups/, .cloud/) correctly stripped
from the pull; three consecutive import.sh runs produced byte-identical
output under config/ken-legacy/ and storage-export/ken-legacy/
(idempotent); automation count matches the 2026-07-22 recon estimate
(~60) exactly. README.md only touched to note the import date.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 16:49:09 +02:00

50 lines
1.3 KiB
YAML

action:
- alias: Turn on the light
service: light.turn_on
target: !input 'light_target'
- alias: Wait until there is no motion from device
wait_for_trigger:
entity_id: !input 'motion_entity'
from: 'on'
platform: state
to: 'off'
- alias: Wait the number of seconds that has been set
delay: !input 'no_motion_wait'
- alias: Turn off the light
service: light.turn_off
target: !input 'light_target'
blueprint:
description: Turn on a light when motion is detected.
domain: automation
input:
light_target:
name: Light
selector:
target:
entity:
domain: light
motion_entity:
name: Motion Sensor
selector:
entity:
device_class: motion
domain: binary_sensor
no_motion_wait:
default: 120
description: Time to leave the light on after last motion is detected.
name: Wait time
selector:
number:
max: 3600
min: 0
unit_of_measurement: seconds
name: Motion-activated Light
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/automation/blueprints/motion_light.yaml
max_exceeded: silent
mode: restart
trigger:
entity_id: !input 'motion_entity'
from: 'off'
platform: state
to: 'on'