Turning on lights with motion sensor even if it’s dark before sunset

So having a bit of a issue. I’ve started using web core and enjoying it. I’ve made a position for my downstairs toilet. Works a treat after sunset and does on and off when needed which keeps wife happy. But have a little problem I’m not sure how to settle.

So as I said it’s downstairs toilet which has a frosted window so get a good bit of light but when it’s a dull day it gets dark in there and it’s before sunset my lights work come one. So not happy wife.
So like today I’ve had to adjust the piston a hour before sunset.
But does anyone know what I can do in piston so when the lux is below as certian % it switches on before sunset but when sunset has been it carries out the normal options.

Can anyone help with this?

Here is my piston :

Forget sunset and just use lux as one of your IF statements, then it will switch on as required regardless of sunset.

1 Like

@23dash offers wise advice above. There is never a good time for a toilet to be dark.

In a completely different application, I do have logic that a light comes on if (after 2 hours before sunset) AND (lux is below some level outside). It sets the lights for evening mode at that point. Having a suddenly dark living room is VERY different than a suddenly dark bathroom, though.

Both sound like a good idea but as I said just getting into web core. So not sure how would go about doing this as I can’t seem to find what I need to do