As Katie says, it’s far easier using the interface.alias: Hall @ night
description: Turn dimmed hall light on after dark when motion detected
trigger:
- type: motion
platform: device
device_id: 818546953f4583a966e13c6afdc86ff4
entity_id: binary_sensor.hall_sensor_occupancy
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 0
condition:
- condition: sun
before: sunset
before_offset: "-00:30:00"
after: sunrise
enabled: false
action:
- service: light.turn_on
data:
brightness_pct: 17
target:
entity_id: light.hall
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: light.turn_off
data: {}
target:
entity_id: light.hall
mode: single
when I look at it it looks like 30 mins before sunset till sunrise, totally lost, back to using HK automation for tonight, so easy lol
Try this:
Code:
condition: or
conditions:
- condition: sun
before: sunrise
- condition: sun
after: sunset
after_offset: '-00:30:00'
Last edited: