So i have been playing with this automation and i am dtill having issues.
This is what i want:
1 motion only triggers light during the time of 11pm and 7am
2. turn lights off after 1:30 with no motion.
Here is my code:
alias: Living room motion lights
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.living_room_motion_occupancy
attribute: occupancy
from: 'off'
to: 'on'
condition:
- condition: time
before: '07:00:00'
after: '23:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
action:
- service: light.turn_on
data:
transition: 15
brightness_pct: 25
target:
entity_id: light.living_room_lights
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.living_room_motion_occupancy
from: 'on'
to: 'off'
for: '00:01:30'
- service: light.turn_off
data:
transition: 20
target:
entity_id: light.living_room_lights
mode: single
If someone can help that would be awesome.
Thanks in advance