Often in our house there are some family members who leave the lights on and when there is still somebody at home the no home automation will not trigger. Which basically turns off all lights when nobody is home. What I want is when daylight is sufficient in a room then turn off the lights in that room.
I’m using Home assistant for this automation. I have a z-wave PIR sensor to measure the lux and for the light I’m using Philips hue light Lux is the measure unit for the amount of light. You can read more here Lux | unit of energy measurement | Britannica
The Automation
In Home Assistant click on Configuration (right menu ) then Automations and click the Add Automation button
Start with empty automation
Name the automation and put it in Single mode
Triggers
Trigger type is device. As the lux change on the device the automation triggers. I have chosen an lux of 75 for a duration for one minute. You have to test this for your liking. I’m doing this for a minute to be sure the reading is steady. If you have a false positive you will catch that
Conditions
There are no condition
Actions
Put it on device and select the room. The action is to turn off the room. It will turn off all the lights
The Code
alias: Slaapkamer - When daylight is sufficient turn off lights
description: ''
trigger:
- type: value
platform: device
device_id: 16907f3555a7c99cb5441f062cadf1dd
entity_id: sensor.pir_sensor_slaapkamer_luminance_2
domain: sensor
above: 75
for:
hours: 0
minutes: 1
seconds: 0
condition: []
action:
- type: turn_off
device_id: e50ba1569da141f5a2388c19da1e11ea
entity_id: light.slaapkamer_2
domain: light
mode: single