mrgadget / node-red-contrib-eztimer

A simple-yet-flexible timer/scheduler for node-red
MIT License
13 stars 6 forks source link

library SUNCALC is bad #10

Closed B0F1B0 closed 5 years ago

B0F1B0 commented 5 years ago

Hi, it me again. Thanks for updating to 1.0.12 --> so i can test and debug it @my own.

The library suncal is very bad / not working right. It is right, that some locatin on earth have some days/weeks/month in the year where is no "NIGHT". But all the Location are above 66° of latitude (maybe some less, i am not an astrophysicists).

But as i test your new Version, i find out that the "suncalc" begin to produce "NULL Events" @ latitute above 48.7°.

error_above_48 7_degree

{ "id": "84e078fb.7f3db8", "type": "eztimer", "z": "fb52a136.39c91", "name": "bad", "autoname": "sunsetStart - night", "suspended": false, "sendEventsOnSuspend": false, "lat": "48.8", "lon": "13.4", "timerType": "1", "startupMessage": true, "ontype": "1", "ontimesun": "sunsetStart", "ontimetod": "20:00:00", "onproperty": "payload", "onvaluetype": "bool", "onvalue": "true", "onoffset": 0, "onrandomoffset": 0, "offtype": "1", "offtimesun": "night", "offtimetod": "05:00:00", "offduration": "00:01:00", "offproperty": "payload", "offvaluetype": "bool", "offvalue": "false", "offoffset": 0, "offrandomoffset": 0, "mon": true, "tue": true, "wed": true, "thu": true, "fri": true, "sat": true, "sun": true, "x": 90, "y": 220, "wires": [ [ "bf81d22b.b5a01", "e25d469e.e12758" ] ] }

There we have the salad, B0F1B0

B0F1B0 commented 5 years ago

i close this issue, because the calulation of "geographical night" is right.

geographical night is define as: 18° below the horizon

so complete darkness does not occur for many Regions on Earth and will produce a lot of problems for many people who live above 48.7° of latitude.

There we have the salad, B0F1B0