Astro binding not calculating night

Hi there,

I just like to use the Astro binding and i found a small problem. Two values are not calculated in openHAb 1.8.2. I switches on the Debig mode for astro bindung an find the following:

Sun[ sunrise=Range[start=Sun May 22 05:10:00 CEST 2016,end=Sun May 22 05:15:00 CEST 2016], noon=Range[start=Sun May 22 13:19:00 CEST 2016,end=Sun May 22 13:20:00 CEST 2016], sunset=Range[start=Sun May 22 21:24:00 CEST 2016,end=Sun May 22 21:29:00 CEST 2016], night=Range[start=<null>,end=<null>], morningNight=Range[start=Sun May 22 00:00:00 CEST 2016,end=<null>], astroDawn=Range[start=<null>,end=Sun May 22 03:11:00 CEST 2016], nauticDawn=Range[start=Sun May 22 03:11:00 CEST 2016,end=Sun May 22 04:23:00 CEST 2016], civilDawn=Range[start=Sun May 22 04:23:00 CEST 2016,end=Sun May 22 05:10:00 CEST 2016], civilDusk=Range[start=Sun May 22 21:29:00 CEST 2016,end=Sun May 22 22:16:00 CEST 2016], nauticDusk=Range[start=Sun May 22 22:16:00 CEST 2016,end=Sun May 22 23:28:00 CEST 2016], astroDusk=Range[start=Sun May 22 23:28:00 CEST 2016,end=<null>],daylight=Range[start=Sun May 22 05:15:00 CEST 2016,end=Sun May 22 21:24:00 CEST 2016], eveningNight=Range[start=<null>,end=<null>], eclipse=SunEclipse[total=Mon Aug 21 20:27:00 CEST 2017,partial=Thu Feb 15 21:53:00 CET 2018,ring=Thu Sep 01 11:09:00 CEST 2016] ]

and as you see some value are not calculated. Ist this a bug?

Thomas

I looked at the source code and the night values will not be set if the algorithm indicates that the sun is up all day. Do you live either very far north or south or is it possible your latitude is set incorrectly?

Hm, not so far north. It is near Hamburg. These are my coordinates

astro:latitude=53.733373
astro:longitude=9.665624

Thomas

I can reproduce the issue with those coordinates. Maybe @gerrieg can comment?

calculation is correct, see SunCalc and click on ‘More detailed’

1 Like

@ gerhard

Thanks a lot now i understand. It is because the different dusks and dawns cover the whole night. Maybe it is a good idea to link sun calc to the wiki, because it gaves a lot of understanding.

Ok, next step: define my own night :slight_smile:
Thanks
Thomas