Trigger on sunset not working

Hi,

I’ve created a routine to enable a Hue scene when opening my door (with multi purpose open/close sensor). I’ve configured the routine to run for max 5h after sunset. However, it runs every time I open the door (even before sunset).

Any idea why? OR Perhaps an alternative idea? I’n trying to get the scene to go on when opening my bedroom door but not when I open the door in the morning or during the day. I go to bed between 10pm and 2am :slight_smile:

Thnx in advance!
Frank

Can you post screenshots of the actual routine?

“Routine” has a specific meaning in smart things, the macros entered through the “routines” section of the mobile app.

If by chance you meant a smartapp that you wrote instead, then if you could post the code that would be helpful.

Hi,

Sure:





OK, you have it set up as an OR, not an AND.

It will fire the lights when the time is 5 hours after sundown (at exactly that time) OR when the contact sensor opens.

The “at sunset” option in a routine is used for things like turning lights on at sunset. Or turning the porch light off 5 hours after sunset. Not for setting a period of time within which other things happen.

I can’t use the mobile app now because voiceover navigation broke a couple of updates ago and they haven’t fixed it yet, but I’m sure someone else can help you.

Are you using modes? That would be the usual way of handling this. In a separate routine, change the mode to night, then only have the contact sensor trigger the lights to come on during night mode. But there are many other ways to do it as well.

For example, at our house we have a motion sensor in the bedroom. During Home mode (daytime) it is ignored. In night mode (from sunset to whenever I go to bed) it turns on the overhead ceiling light. Once I go to bed I manually change the mode to Asleep, and in asleep mode the contact sensor does not turn on the overhead light but rather turns on a soft nightlight.

You may also be able to do it with SmartLighting. Again, someone else will have to help you look at that.