How to display Astro data in the panel

New to OH2, coming from Domoticz.

I’ve installed Astro bindings and configured the things. In the event logs I can see event like:

2017-09-26 20:32:10.522 [ItemStateChangedEvent     ] - astro_sun_e6f73a6d_phase_name changed from NULL to ASTRO_DUSK
2017-09-26 20:32:10.681 [ItemStateChangedEvent     ] - astro_sun_e6f73a6d_rise_end changed from NULL to 2017-09-26T06:58:00.000+0100
2017-09-26 20:32:10.685 [ItemStateChangedEvent     ] - astro_sun_e6f73a6d_set_start changed from NULL to 2017-09-26T18:48:00.000+0100
2017-09-26 20:32:10.688 [ItemStateChangedEvent     ] - astro_sun_e6f73a6d_set_duration changed from NULL to 4.00
2017-09-26 20:32:10.692 [ItemStateChangedEvent     ] - astro_sun_e6f73a6d_noon_start changed from NULL to 2017-09-26T12:53:00.000+0100

So far so good. I would now like to display for example the sun rise time in a panel. From a example I’ve seen here I add a template and then add:

It’s sunrise is at {{itemValue(‘astro_sun_local_rise_start’)}}

However the value displayed is N/A

Have also tried using the value astro_sun_e6f73a6d_rise_start-astro but still no luck

What am I missing?

What do you mean by “panel”? HABPanel? Or a sitemap in any of the other user interfaces like BasicUI or ClassicUI?

For HABpanel, just add a dummy widget and add your datetime item to it.
For a sitemap you need to add your datetime item like:

Text item=Sunrise_Time label=“Sunrise [%1$tH:%1$tM]”

To get that item, you need to link one of the astro channels to an item.

I meant HABPanel. I’ve added widget but am not sure what code to add.
From the example I see its

{{itemValue(‘astro_sun_local_rise_start’)}}

But this does not work. How do I determine what the value should be?

Figured it out eventually.

This variable is in things:

astro:sun:e6f73a6d:rise#start

If I use this in HABPanel then it works:

{{itemValue(‘astro_sun_e6f73a6d_rise_start’)}}

1 Like