Hi,
I have an automation that turns on lights when there is motion, and depending on time and sun position. The automation generally works, I have no issue with the automation itself. The lights get turned on every time during a specific time of the day, but a side effect and the problem is that for some reason home assistant shows as if the lights are being turned on every time of the day the motion sees the movement, even tough the lights do not actually get turned on (so the automation works in essence). I am not sure why this happen, but I assume I must be doing something incorrect.
alias: >-
[BEDROOM][LIGHTS] Motion > bright lights before 20:13, and dark after, LED on
weekends
description: >-
Turns off lights with specific settings when motion is detected based on the
time of day.
trigger:
- platform: state
entity_id:
- binary_sensor.shelly_motion_5_motion
to: "on"
condition: []
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: time
after: "15:00:00"
before: "20:12:59"
weekday:
- sun
- sat
- fri
- thu
- wed
- tue
- mon
- condition: sun
after: sunset
sequence:
- service: light.turn_on
data:
kelvin: 3704
brightness_pct: 100
target:
entity_id:
- light.tradfri_group_sypialnia_korytarz
- light.tradfri_group_sypialnia_nad_lozkiem
- conditions:
- condition: and
conditions:
- condition: time
after: "20:13:00"
before: "22:15:00"
weekday:
- mon
- wed
- thu
- fri
- tue
- condition: sun
after: sunset
sequence:
- service: light.turn_on
data:
kelvin: 2252
brightness_pct: 25
target:
entity_id:
- light.tradfri_group_sypialnia_toaletka
- light.tradfri_sypialnia_lozko_l_light
- conditions:
- condition: and
conditions:
- condition: time
after: "20:13:00"
before: "22:15:00"
weekday:
- sat
- sun
- condition: sun
after: sunset
sequence:
- service: light.turn_on
data:
kelvin: 2252
brightness_pct: 25
target:
entity_id:
- light.tradfri_group_sypialnia_toaletka
- light.tradfri_sypialnia_lozko_l_light
- service: light.turn_on
metadata: {}
data: {}
target:
entity_id: light.k22_switch_0
mode: single