Hi,
Is there anyone who can see what the heck i am doing wrong in this automation.
It worked until i tried to add the Illumiance.
I cannot see why the Illumiance don’t work?
I have tried to add it both in the “When” and in the “And If”, but nothing works.
This is my Automation code:
alias: Bryggers Light Control - Sensor Activated (25-01-2024)
description: Turn on light for 5min when movement is detected
trigger:
- platform: state
entity_id:
- binary_sensor.bryggers_hue_motion_sensor
to: "on"
- platform: numeric_state
entity_id:
- sensor.bryggers_hue_motion_sensor_illuminance
attribute: light_level
below: 5
condition:
- condition: state
entity_id: sun.sun
state: below_horizon
enabled: false
- condition: numeric_state
entity_id: sensor.bryggers_hue_motion_sensor_illuminance
enabled: false
below: 5
action:
- choose:
- conditions:
- condition: state
entity_id: light.bryggers_40283
state: "off"
sequence:
- service: light.turn_on
entity_id: light.bryggers_40283
- service: script.turn_on
target:
entity_id:
- script.lys_timer_5min
data: {}
- service: input_boolean.turn_on
entity_id: input_boolean.allow_light_on
- conditions:
- condition: state
entity_id: light.bryggers_40283
state: "on"
sequence:
- service: script.turn_on
target:
entity_id:
- script.lys_timer_5min
data: {}
mode: restart
And this is the Script code:
alias: Light Timer Bryggers (5min)
description: 5min Light Timer for Bryggers
sequence:
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- condition: state
entity_id: input_boolean.manual_light_off
state: "off"
- service: light.turn_off
entity_id: light.bryggers_40283
mode: restart
icon: mdi:timer-sand
The light is turning on, even when the Sensor Illumiance is at 18 lx, when testing.
Hope someone could help.
Thanks.