So here is my problem.
Given this flow:
If I get a motion event from the sensor, I check the sensor luminosity and if it is dark I turn on lights, when sensor reports no motion just turn them off. So far so good.
The problem is that many times, when the sensor reports motion the light value is still containing an old value and the automation does not trigger. As you can see on the screenshot I’m reading the motion and the lux values in two different nodes, but they are coming from the same sensor (shelly motion sensor). It is obvious to me that one it’s updated as soon as the sensor triggers while the other is not.
The only workaround I can think of is to use MQTT, which will trigger an event containing both the LUX and the motion, but I wonder if there is any other way.