The new Sun Events is killing me

Ever since the change to v3 of Sun Events, my sun based outside lights has been wonky at best.

Realized I now needed a trigger for the sun events which was new. Started off with putting in lat/long into the Sun Events node and then a simple time injection which worked for a short while but, for some reason, the Sun Events kept losing the input lat/long.

So went into the instructions page and downloaded the sample but the instructions really aren’t clear and, even with the sample, I am getting an incorrect output.

SO here is what I have:
Inject 1 = = 0-9 (pulldown) entered my full latitude
Inject 2 = msg.payload.lmg = 0-9 (pulldown) entered my full longitude

Then those go into the set GPS coordinates which I did not touch but it seems to be changing my lat/long to some random location??? [I tried changing these numbers to the same ones in the inject]

Then it goes into Sun Events where I checked Make hours seem like minutes

In the Debug, it seemed to work fine so I moved it into my main Flow section.

In Debug, I see this:
3/14/2021, 10:43:00 AM[node: Your logic goes here]
payload: object
_msgid: “8ed77a4.9cc1788”
sunevent: object
name: “sunset”
datetime: “2021-03-14T22:49:46.098Z”
Inject 2 =

But the next. node is a switch node that, if msg.payload = sunset, it is supposed to then trigger lights and nothing happens.

Again, all of this worked as-is before the v3 change.

Would really appreciate some newbie level help in fixing terminology or whatever I am doing wrong.

My outside light flow is also not working correctly with the new version of sun events. Such a pain when things are changed and not well documented.

I am using a timestamp inject node set to an interval of 24 hours (with a check on the inject at 0.1s, no events are scheduled if this is not checked) routed into a change node, but only one and I have the change node set to msg.payload and the payload to ‘msg.payload.latitude =xx.xxxxx; msg.payload.longitude= -xx.xxxxx’ (my actual lat and log are entered in place of the x’s). This gets passed into the sun events node. I also have the lat and long boxes in sun events set with my lat and long as a backup. The output from the sun events node gets sent to a switch node where I have them set to be on at ‘sunsetStart’ and off at ‘sunrise’. The switch then outputs to a call service node.

This was all working prior to the change (I did not have the timestamp eject or change node prior to the change and just used the sun events node, switch node, and call service nodes).

I am getting the sun events showing and they seem to be occurring at the correct times, but my lights are not turning on correctly (should be on at ‘sunsetStart’ and off at ‘sunrise’. I went out today in the mid afternoon and my lights were on already. The other morning, they never shutoff in the morning.

I just noticed this debug output,

3/14/2021, 10:46:27 PM[node: 35ff4b23.bbf434](http://hassio:8123/api/hassio_ingress/L_9yO_M4AaHLgEZwcvo_liL6_VKDkeUjyjaQHSasOd8/#)msg : string[37]

"calculating sunevents for lat and lng"

Anyone have any insight for those of us that are having problems?

Had the same problem. This is what I had to do:

Inject node: = <number>
msg.payload.lng = <number>

(make sure the type is number, not string)

Then, when you check by the event name, you can’t check msg.payload anymore. You can either check msg.payload.sunevent, or

And it still wasn’t working consistently. So I would suggest updating SunEvents to the latest version (3.0.2 for me, 3.0 and 3.0.1 seems to have issues). After updating and restarting NodeRed, it seems to be working.


Thanks all. I switched this to an HA Automation as that sunset is idiot-proof.

Only limitation is that can only do sunset or sunrise events (haven’t figured out the offset)

1 Like

I also gave up. I switched it to BigTimer, which is what I was using for my interior lights. I liked sunevents because it offered more sunevent types to choose from than BigTimer, but I can get nearly the same using time offsets around BigTimer’s built in present sunevents.

This worked for me, thanks!

Just chiming in as another person that does not like this change. I’ve been too lazy for months to even bother fixing it.