I would like to automate some lights when the luminosity in the room crosses a certain threshold (say, 30 lux).
By “crosses” I mean that the trigger would be the fact that the luminosity was < 30 lux, and then becomes > 30 lux. I do not want to continuously switch on the lights when it is > 30 lux because someone may have decided they want to have the lights switched off (and switch them off after the automation switched them on). If the condition was simply > 30 lux, then the lights would get back on in the next cycle check.
You will want to build in some “hysteresis” in that you don’t want the lights going on and off and on again if a cloud goes by and changes the luminance just a little for a short time. You want a gap between the ‘turn on’ luminance and the ‘turn off’ luminance.
For mine, I set it up using two separate automations. For one passing above ‘850’ turns the lights on, and for the other, passing below ‘750’ turns them off. That way they will remain on after being triggered, even if the ambient light goes below 850 and then above it again moments later.
I’ll certainly look into it further, but from initial scan it wasn’t immediately apparent to me how to execute one or another action depending on which threshold was crossed. Being somewhat ‘old school’ I’m used to having to cobble needed functionality out of coarser raw materials, so hadn’t expected an integration like this to exist, but am glad to know it does. Thanks!