freakent / node-red-contrib-sunevents

A node for node-red that generates events based on the position of the Sun at the appropriate time of day.
Apache License 2.0
15 stars 13 forks source link

sunevents empty #48

Open Giel88 opened 1 month ago

Giel88 commented 1 month ago

The past sunevents array is empty (null) when injecting. Worked before but no longer works after nodered update! Nodered log gives no errors only: 21 May 19:18:26 - [info] [sun events:c1ee1b226fd00ee2] calculating sunevents for lat 52.10347 and lng 5.10608

Screenshot 2024-05-21 at 19 04 39
freakent commented 1 month ago

@Giel88, please can you provide more details?

1) When you say "worked before", are you saying before you did an update or something else has changed?

2) are you running the latest version?

3) what version of nodered have you upgraded from and to?

Giel88 commented 1 month ago

Sure! I am running the homeassistant addon

  1. Updated nodered to latest version by updating the homeassistant addon
  2. Yes, currently running latest version of nodered (3.1.9) homeassistant addon (17.0.12) and the node (3.1.1)
  3. From 3.1.8 to 3.1.9
freakent commented 1 month ago

@Giel88,

I have just updated the node-red on my development system from v3.1.3 to v3.1.9, testing sunevents before and after with your same coordinates, and the results were the same both times. I don't see an issue.

I am looking at your screen shot. You say that the sunevents array is empty, however your screenshot clearly shows there is one element for "night" in that array. Please clarify.

Giel88 commented 1 month ago

Aren't both outputs supposed to give me a timestamp for either upcoming or past sunevents? The night timestamp is empty and all other events are missing

freakent commented 1 month ago

OK, now I understand the problem. You meant the timestamp was null not the that the array is empty. Big difference.

Giel88 commented 1 month ago

Correct, mistake on my end. Sorry about that!

IronSolder commented 3 weeks ago

Since an unknown point in time, sunevents has also been behaving completely incorrectly for me, contrary to the documentation, and is currently not providing any usable data. I didn't knowingly make any updates, but I can't assess whether automatic update processes might have taken effect. Output 2 only delivers an array with size 1 and an event_name "night" with an empty timestamp. Output 1 sometimes (not yet entirely comprehensible) delivers timestamps for individual, diverse sunevents at random intervals without an external trigger. The sunevents node always shows the correct next sunevent. Overall, sunevents cannot be used in version 3.1.1, which is currently installed on my system.

IronSolder commented 3 weeks ago

After some observation, it looks as if output 1 (debug13) outputs the individual object set of output 2 approximately every minute. The state of the node then corresponds more closely to the announcement output 1 - here I prematurely thought that the state of the node would be correct, but this was not true. Unfortunately, the sunevents node cannot be uninstalled, updated, or reinstalled in any way - both npm and Nodered's palette management abort with errors. sunevents1 sunevents2

freakent commented 3 weeks ago

I'm sorry this node has stopped working. I can only assume that a change in some dependency has this problem. Unfortunately I won't be able to look into this for a while.

Giel88 commented 3 weeks ago

That's alright, life gets busy sometimes!

@IronSolder For now I'm using the sunrisesunset.io API, maybe that's a solution for you as well.

IronSolder commented 3 weeks ago

External dependencies are a plague... . Thanks to this problem, I discovered another problem: after the last update of my operating system (Debian Bullseye), a version of nodejs seemed to ship with a built-in but incompatible/broken npm. Very nice problem that I was able to solve by manually installing a more recent version (v18) of nodejs. I have now been able to replace the sunevents functionalities I need with suncron.