alias: 00_Woonkamer Licht AAN
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.woonkamer_ms_groep
to: "on"
condition:
- condition: numeric_state
entity_id: sensor.hue_motion_sensor_2_illuminance_2
below: 100
- condition: state
entity_id: light.woonkamer
state: "off"
- condition: state
entity_id: light.eetkamer
state: "off"
action:
- type: turn_on
device_id: d76a7df18ac7a7226664f4c1b295eb6f
entity_id: bfb946a49ed6dc7d999c380a7cfe3257
domain: light
- type: turn_on
device_id: dba492b2c9de821bd23dfb2475fbba0c
entity_id: f59c866fc98387621769a3781a099001
domain: light
Why do you need to keep a record of the last 150 times the automation executed?
Wanted 15. So a typo.
Will try this, but entity ID’s are created with the GUI. Called livingroom (woonkamer) en diningroom (eetkamer). So i am not sure how this could be wrong.
When i look those devices up and turn them on/off manually it works.
I’m not sure what the entities have to do with this. It’s failing the condition when you hit the test button because there’s no trigger. That’s what your if condition is stopping. This is causing your test button to fail
I have tested your version of my automation. (Manually) the lights go on then.
Will have to test a bit longer to see if the binary sensors (motion) also turn the light on with your version.
Thanks so far will get back to you soon.
One question you removed the part if lights are on do nothing. Will this not tricker the light to flash / "turn on "again? If i am not mistaken i have seen that happing in the past.
I did not remove that. It’s in your condition. I removed all your uncessary checks.
you only have 1 trigger.
so, you don’t neeed to check if it’s the trigger
The automation only triggers when binary_sensor.woonkamer_ms_groep
turns to ‘on’, so there’s no reason to check
Removing all that stuff gets you the version I posted here
Nope, that won’t trigger a flickering light. But you can try it yourself.
Turn on the light you want to check manually, after that go to Developer tools > Services
and choose Light: turn on
and change the code underneath to this:
service: light.turn_on
data:
entity_id: <YOUR_ENTITY_ID_HERE>
Then click Call service
and watch the light.
I apologize, i mixed two automation up in my head.
@petro ,
Ok i tried it a couple of times but the motion sensors (helper group) doesn’t turn the light on.
I have check the 3 motion sensors in the group, they are correct and working (separately).
Where should i look next?
Watch the helper and make sure it’s changing states.
but does it turn off? State needs to change for it to cause a trigger e.g. (off to on). Also make sure you have the correct entity_id on your trigger.
Then you should watch the trace and verify that the condition is passing or failing.
That is the thing. It just doesnt run. The last trace is from 18.42 when i triggered it manually. (It is 21.00 now here)
If it’s just not running, then it’s not triggering. So something is wrong with the trigger itself or the entity. Are you 100% sure you have the correct entity? Are you 100% sure that it’s changing state when you walk in front of the motion sensors? You can watch all of this in developer tools → states page.
Could you check here?
Maybe my errors have got something to do with it.
possibly if your motion sensors are zigbee
They are. But like i said if i look at the sensors seperately they work fine. (Put hand in front of it, they switch from detected to not detected).
Problem must be like you said the trigger. Will dig into that part a bit more.