[Solved] Sunset time remains NULL

Hello,

I am a newbie trying to define events that take into account the sunset/sunrise times. I have installed the astro package and linked the sunset/sunrise channels.

I have also added the following item to my defailt.items file copied from the astro doc page:

DateTime Sunset_Time "Sunset [%1$tH:%1$tM]" {astro="planet=sun, type=set, property=end"}

I then tried to post the Sunset_Time on my default sitemap, but the time is not shown. Moreover, when I go to the console and request the following:

openhab> smarthome:status Sunset_Time

I get the value “NULL”.

Can anyone explain what I am doing wrong?

Many thanks,

Pierre

You’re using astro binding version 1.x syntax. Have you installed astro binding 1.x?

Which would lead to … why? There’s a perfectly good version 2 which uses channels for Item linking.

If you go to www.openhab.org, click on “Add-ons” in the top right, then click on Astro, you get the documentation for the 1.x binding. There is a note at the very top that says:

“There is also a binding specifically for openHAB 2 here.”

However, that’s a broken link and gives you 404. Thus it is not unexpected that a new user would try to use the 1.x binding.

What’s the generic link for the 2.x binding. The one you posted is only for 2.4?

https://www.openhab.org/v2.4/addons/bindings/astro/

No idea. Which version are you using?

Edit - there is an open issue for messed up docs

Thanks for pointing out the issue: I am indeed using openhab 2.4.0 together with binding-astro-2.4.0. When I installed the astro package I hit the broken documentation link and then searched for a doc page. I now understand that the page I found was only valid for OH 1.x, but that was not something obvious for newbie.

It looks as if the correct doc page for astro2.4.0 is not available at the moment, so I will try to infer the correct way to update my astro item, which before correction is as follows:

DateTime Sunset_Time “Sunset [%1$tH:%1$tM]” {astro=“planet=sun, type=set, property=end”}
</code.

Working OK now!