Hi everyone.
I am trying to wrap my head around how to build a intelligent lighting setup in my home.
Goal:
My presence sensor that sits in the living room constantly checks Lux value and turns the lights on / off based on a mix of lux value + whether there are people present in the room.
Problem:
Right now I have the setup as below for turning the lights on, but it doesn’t always react and sometimes I need to force the lights on because they don’t come on when I want.
So is there a better way then setting it up like this:
alias: Stuen - Tænd lyset i dagstimerne (Turn Lights On in Living Room)
description: ""
trigger:
- type: present
platform: device
device_id: ba07b1773442cfe9880543de19114841
entity_id: 703b820edc79510d0d4fd9daede0eb34
domain: binary_sensor
condition:
- condition: and
conditions:
- condition: state
entity_id: input_select.hus_tilstand
state: Hjemme
- type: is_illuminance
condition: device
device_id: ba07b1773442cfe9880543de19114841
entity_id: sensor.sensor_stuen_illuminance_lux
domain: sensor
below: 15
- type: is_present
condition: device
device_id: ba07b1773442cfe9880543de19114841
entity_id: 703b820edc79510d0d4fd9daede0eb34
domain: binary_sensor
action:
- service: light.turn_on
data:
brightness_pct: 60
target:
entity_id: light.stuen_lys
mode: single
alias: Stuen - Sluk lyset i dagstimerne (Turn off lights in the living room)
description: ""
trigger:
- platform: state
entity_id:
- sensor.sensor_stuen_illuminance_lux
condition:
- condition: and
conditions:
- condition: state
entity_id: input_select.hus_tilstand
state: Hjemme
- type: is_illuminance
condition: device
device_id: ba07b1773442cfe9880543de19114841
entity_id: sensor.sensor_stuen_illuminance_lux
domain: sensor
above: 20
- condition: numeric_state
entity_id: sun.sun
attribute: azimuth
above: 0
below: 240
- type: is_not_present
condition: device
device_id: ba07b1773442cfe9880543de19114841
entity_id: 703b820edc79510d0d4fd9daede0eb34
domain: binary_sensor
action:
- service: light.turn_off
data: {}
target:
entity_id: light.stuen_lys
mode: single