Hue motion light sensor ignored in automations

I’m running into a problem with my hue motion sensors. These are connected through a hue bridge. because of connection issues with ZHA (loosing connection). The rest of my HA is connected using ZHA using a Skyconnect stick. Which works ok.
For some strange reason, since a few weeks, my light automations that use a the light sensor of my hue motion sensors are being ignored. I’ve been using conditions like these:

{{ states('sensor.beweging_hal_studio_illuminance') | float(0) < 40 }}

And they worked fine, but not anymore. Yesterday I installed this blueprint:

Also when I use my light sensor in this script it is being ignored or not correct. I’m able to read the Lux values of the sensors but when I test an automation the result is wrong.

Another strange behavior I noticed is that when I write a simple condition with the before used condition it seems to work, but when I use it in an IF/ELSE action it doesn’t. What am I missing here?