On motion, wait until illuminance sensor is updated

Hello,

I have a simple flow right now:

<if motion detected> -> <if lux > 100> -> <turn on light>.

The problem is, HA sometimes doesn’t update the lux sensor fast enough and the light doesn’t turn up. What is the best way to wait until lux sensor is updated? At the moment, I have a fixed delay of 100ms, which is too long in most cases, but covers 99% of cases.

Is there a nice way to wait until lux updates or if last update is less than 1s ago, check, else wait for update? Anyone has a better idea?

You could try a trigger node that fires on these 2 conditions only.
Is your illuminance only updated when motion is detected? Then you could also just trigger for this update.

Illuminance updates itself if there is enough difference, so I can’t use that as a trigger.

Do you have an example of trigger node with 2 conditions? Are you thinking of trigger: state node?

Something like this?

Screenshot 2021-04-14 at 13.02.57

This will not work for when motion goes to false (light is still on and lux is over 100).

I not see I forgot to corrrectly write down my automation:

<if motion detected> -> <switch false/true> - true -> <if lux > 100> -> <turn on light>   
                                            - false -> <turn off light>   

Are these the Aqara Motion Sensors with the little LUX Meter on Top?

How about checking for the timeSinceChangedMs message?
Maybe employing a wait until node so this is always up to date.