I am using 3 Philips Hue outside lights which turn on at sun set at 30% with a warm color and turn of at midnight. I also have 2 Philips Hue outside motion sensors (one at the side of the house and one at the rear. They don’s see each other). I made an automation where the lights, when detected motion during 22:00 and 08:00 turn on to 100% bright white. After 5 sec of no motion they return to previous state using temporary scene. So before midnight that would be 30% warm color and after midnight they should go out.
The problem I have is that this seems to be working but every other day or so I wake up and the outside lights are on 100% white. When I check the camera’s I can see they have been on for several hours. So they don’t return to there formar state.
I am using an intel nuc with home assistant installed
I am pretty new to this and tried trouble shooting this in traces and stuff but can’t seem to find it.
Can anyone help me check the code or with some advise ?
These are the two automations.
alias: Lights outside sfeer
description: ""
trigger:
- platform: state
entity_id:
- sun.sun
to: below_horizon
id: Sunset
- platform: time
at: "23:59:00"
id: Time to turn off
condition: []
action:
- if:
- condition: trigger
id:
- Sunset
then:
- service: light.turn_on
target:
entity_id: light.outside_lights
data:
brightness_pct: 30
rgb_color:
- 255
- 198
- 119
else:
- service: light.turn_off
target:
entity_id: light.outside_lights
data: {}
mode: single
alias: >-
Outside lights temporarely to 100% when motion detected then set to previous
state
description: ""
trigger:
- type: occupied
platform: device
device_id: 6cd2d64dd26610218454dd48429a6650
entity_id: 8274c92b4f63355155b175e6d83b2192
domain: binary_sensor
id: Motion detected side
- type: occupied
platform: device
device_id: 61a51105ed7a16d7d2d33dd440ae9bd4
entity_id: f87eb4fc08b0f6efd80fbfa06ed40c22
domain: binary_sensor
id: Motion detected rear
- type: not_occupied
platform: device
device_id: 6cd2d64dd26610218454dd48429a6650
entity_id: 8274c92b4f63355155b175e6d83b2192
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 5
- type: not_occupied
platform: device
device_id: 61a51105ed7a16d7d2d33dd440ae9bd4
entity_id: f87eb4fc08b0f6efd80fbfa06ed40c22
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 5
condition:
- condition: time
after: "22:00:00"
before: "08:00:00"
action:
- if:
- condition: trigger
id:
- Motion detected side
- Motion detected rear
then:
- service: scene.create
data:
scene_id: before
snapshot_entities:
- light.light_hue_outside_1_light
- light.light_hue_outside_2_light
- light.light_hue_outside_3_light
- service: light.turn_on
data:
color_name: white
brightness_pct: 100
target:
entity_id:
- light.light_hue_outside_1_light
- light.light_hue_outside_2_light
- light.light_hue_outside_3_light
else:
- service: scene.turn_on
target:
entity_id: scene.before
data: {}
mode: single