I am new to HA!
I have 2 automation setup for my Office Light with Motion sensor.
- When Motion is triggered between Sunset and Sunrise the office light with turn ON
- When there is no motion detected for 2 mins the office light turn off.
The 1st automation works fine, But the 2nd once work for few times and then it stops working.
Below is my YAML.
- id: '1640540681367'
alias: Turn On Office Light When motion is detected
description: Turn On Office Light When motion is detected
trigger:
- type: motion
platform: device
device_id: 49f4538e5e5a72d12b1aea8666e80c19
entity_id: binary_sensor.office_pir_sensor
domain: binary_sensor
condition:
- condition: sun
before: sunrise
after_offset: 00:30:00
before_offset: 00:30:00
after: sunset
- condition: device
type: is_on
device_id: d167066c832382fce1e24a82559140e7
entity_id: light.office_light
domain: light
action:
- type: turn_on
device_id: d167066c832382fce1e24a82559140e7
entity_id: light.office_light
domain: light
brightness_pct: 100
mode: single
- id: '1641060316552'
alias: Turn off office light when motion is not detected
description: Turn off office light when motion is not detected
trigger:
- type: no_motion
platform: device
device_id: 49f4538e5e5a72d12b1aea8666e80c19
entity_id: binary_sensor.office_pir_sensor
domain: binary_sensor
for:
hours: 0
minutes: 2
seconds: 0
condition: []
action:
- type: turn_off
device_id: d167066c832382fce1e24a82559140e7
entity_id: light.office_light
domain: light
mode: single
Appreciate if you guys can help me to figure what is wrong.
Thank You