Trigger one hour before sunset

I'm trying to figure out how to have something trigger one hour before sunset. I've found Bigtimer, but it's not respecting the offset when I use "Sunset" as the trigger time. I haven't found very detailed documentation on it, everything just points back to the blog post which isn't really comprehensive.

Here's how I have it setup:

I have tested the offset by manually setting an "On Time", then using a negative On Offset (just like shown here), and it triggers just when I expect it to.

But when the On Time is set to Sunset, it seems to ignore the On Offset and just fires right at Sunset. Is there another way to do this?

YOur best bet would be to ask Peter Scargill on the blog you have referenced. He is very responsive and will point you in the right direction



Maybe try clearing out some of the extra fields. Here is mine which works:

You might want to setup a separate node with just Sunset and verify the off time's are same/different. I have 2 nodes below with the Evening set for Sunset and the Early Evening set 30 minutes prior (above). You can see the 30 minutes difference in the time when they will turn back on below:

Another option would be to use the node-red-contrib-schedex

1 Like

As craigcurtin mentioned, contacting Peter is the best option.

If you like to go for a workaround,

, this flow could work. :neutral_face:


Thanks all, I'll try posting on that blog.

Haha, I kept adding those other fields in an attempt to get it to work.

Weirdly, I can't set the on/off time 2 fields to empty, like you have. I have to choose something -- it's defaulted to 00:00. But I don't think that would make a difference here, and it's not firing at midnight.

OK I'm trying that out, but my coordinates are correct and it's firing exactly at sunset right now.

That's because I deployed mine long before he added the 2nd on/off time. From looking at it I suspect if the 2nd times are equal it doesn't deploy.

Have you tried with a hard coded time? I just did a quick test of deploying a new node, using the default lat/long, setting it to an exact time in the near future, deployed, verified the time until on, then added a negative offset, deployed, and verified the time had decreased by the appropriate amount.

Maybe also make sure your system time is set correctly on your server.

Looking forward to a solution as I am experiencing the same issue.

Hi, I was having the same problem. My issue was that I was entering the offset in hours rather than minutes, so entering the number 2 rather than 120, which made practically no difference. If you look under the node when you deploy you will see the time range so you can verify the trigger points are changing when you adjust the offset without having to wait.
Oh and remember to Deploy.