Astro binding does not work for me

1,417 views
Skip to first unread message

Gert Konemann

unread,
May 16, 2014, 6:55:43 AM5/16/14
to ope...@googlegroups.com
The astro binding does not work in my configuration. I use openhab on a Windows homeserver. All other bindings work as expected. Habmin is active. At midnight there is nothing in the logfile. I live in Nijmegen, The Netherlands. Therefore my these entries are in my openhab.cfg:

############################## Astro Binding ##############################
 #
 # Your latitude
 astro:latitude=51.8130

 # Your longitude
 astro:longitude=5.7991

 # Refresh interval for azimuth and elevation calculation in seconds (optional, defaults to disabled)
 # astro:interval=

In my items file:

Number   Azimuth         "Azimuth [%.2f]" (Klimaat) {astro="type=AZIMUTH"}
Number   Elevation       "Elevation [%.2f]" (Klimaat) {astro="type=ELEVATION"}

DateTime Sunrise_Time   "Sunrise [%1$tH:%1$tM]" (Klimaat) {astro="type=SUNRISE_TIME"}
DateTime Noon_Time       "Noon [%1$tH:%1$tM]" (Klimaat) {astro="type=NOON_TIME"}
DateTime Sunset_Time     "Sunset [%1$tH:%1$tM]" (Klimaat) {astro="type=SUNSET_TIME"}

Switch   Sunrise_Event "Sunrise_Event" (Klimaat) {astro="type=SUNRISE"}
Switch   Noon_Event "Noon_Event" (Klimaat) {astro="type=NOON"}
Switch   Sunset_Event "Sunset_Event" (Klimaat) {astro="type=SUNSET"}

When i display the Klimaat group in the userinterface, I see Azimuth and Elevation without a value. I do not see Sunrise_Time, Noon_Time and Sunset_Time and Sunrise_Event, Noon_Event and Sunset_Event are alway switches in the Off position. 

What can be wrong ?

Gert



gerrieg

unread,
May 16, 2014, 9:50:15 AM5/16/14
to ope...@googlegroups.com
Hi Gert!

Do you see the AstroConfig log in the logfile?
AstroConfig[latitude=51.813,longitude=5.7991,interval=disabled]

If this message is not in the logfile, the binding was not loaded. Make sure, die binding is in the addons folder.

To enable azimuth and elevation calculation, you must specify a interval value in the config:
astro:interval=300
for example

Regards,
Gerhard

Gert Konemann

unread,
May 16, 2014, 5:30:27 PM5/16/14
to ope...@googlegroups.com
Hi Gerhard,

Thank you for the quick reaction. Should this logentry be logged after startup ? That is not the case. In half an hour I will know if it appears in the log at midnight. The astro binding is in the addons directory as you can see below. Do you have other suggestions for further diagnostics ? I added the interval value 300 and removed the comment sign.

Gert

Map van C:\openhab\addons

16-05-2014  23:14    <DIR>          .
16-05-2014  23:14    <DIR>          ..
16-05-2014  23:14                 0 dir.txt
16-05-2014  13:34            38.380 org.openhab.action.mail-1.5.0-SNAPSHOT.jar
16-05-2014  13:34            32.301 org.openhab.binding.astro-1.5.0-SNAPSHOT.jar
16-05-2014  13:34            18.877 org.openhab.binding.http-1.5.0-SNAPSHOT.jar
16-05-2014  13:34           137.005 org.openhab.binding.rfxcom-1.5.0-SNAPSHOT.jar
11-05-2014  00:42           865.159 org.openhab.binding.zwave-1.5.0-SNAPSHOT.jar
16-05-2014  13:35           618.091 org.openhab.persistence.rrd4j-1.5.0-SNAPSHOT.jar
               7 bestand(en)        1.709.813 bytes
               2 map(pen)  20.012.580.864 bytes beschikbaar


Op vrijdag 16 mei 2014 15:50:15 UTC+2 schreef gerrieg:

Gert Konemann

unread,
May 16, 2014, 6:41:00 PM5/16/14
to ope...@googlegroups.com
Now I have started openhab in debug mode. I can see the astrobinding start at startup, but the items still get no value and the time items are not in the userinterface. At midnight the astrobinding does not write in the log (see attachment). I have not yet used the astrobinding in a rule, as I assume that the items should be updated anyway. In the meantime I get the sunsettime from an external website, but with different itemname, so that should not interfere.

Gert

Op vrijdag 16 mei 2014 12:55:43 UTC+2 schreef Gert Konemann:
openhab-debug.log

gerrieg

unread,
May 17, 2014, 5:45:46 AM5/17/14
to ope...@googlegroups.com

Hi Gert!

It seems that the config from openhab.cfg is not passed to the binding. From your log i see two .cfg files:
23:54:37.637 DEBUG o.o.c.core.ConfigDispatcher[:146]- Processing openHAB default configuration file 'C:\openhab\configurations\openhab_default.cfg'.
23:54:37.949 DEBUG o.o.c.core.ConfigDispatcher[:168]- Processing openHAB main configuration file 'C:\openhab\configurations\openhab.cfg'.
Is this ok?

The AstroConfig[latitude=51.813,longitude=5.7991,interval=300] log entry must appear in the logfile (INFO logentry) after startup, otherwise the calculation jobs will not start. If everything is correct, the astro jobs not only starts at midnight, but also at startup.
I can't find this entry in your log, so something is wrong.

You can try this, just enter a wrong number in latitude or longitude, for example 51.abc. If the config is passed to the binding, there must be a ConfigurationException in the logfile. If not, the config is not passed.

If nothing works, just try a plain openhab installation only including the astro binding. It works in openHab 1.4.0 too.

Regards,
Gerhard

Ben Jones

unread,
May 18, 2014, 5:37:44 PM5/18/14
to ope...@googlegroups.com
Slightly off topic question sorry, but just wanting to ask if this Astro binding works everywhere - i.e. will it still work for me down here in New Zealand?

Gert Konemann

unread,
May 18, 2014, 5:39:59 PM5/18/14
to ope...@googlegroups.com
Dear Gerhard,

Thank you for your suggestions. I have made a clean test setup with only the astro binding and the http binding. I copied the astro configuration from the wiki. The result was the same as with the full configuration. When I removed the leading spaces before the settings in openhab.cfg, suddenly the logfile showed the line that you expected at startup. Still the DateTime items do not appear in the userinterface. In debugmode there are more messages about non existing configurationfiles (e.g. openhab.default.cfg) and non existing bindings that are started. That is probably the way openhab works. Can you explain when the event switches are set and when they are reset ? I have only seen them in the Off position. Do you know what could be the cause that the DateTime items do not show up in the userinterface ? 

Gert

Op zaterdag 17 mei 2014 11:45:46 UTC+2 schreef gerrieg:
openhab-debug-console.txt
Klimaat-UI.htm

peter...@gmail.com

unread,
May 19, 2014, 5:13:35 AM5/19/14
to ope...@googlegroups.com
I'm in Australia, a couple of hours behind you. I can confirm that Astro will work just fine for sunrise, noon and sunset times. I haven't personally tested the sun azimuth and elevation functions yet though.

Ben Jones

unread,
May 19, 2014, 5:17:47 AM5/19/14
to ope...@googlegroups.com

Thanks Peter. Yeah the azimuth is what I am probably most interested in. I will give it a try, but good to know it sounds like it will be OK.

Cheers,
Ben

gerrieg

unread,
May 19, 2014, 7:12:40 AM5/19/14
to ope...@googlegroups.com
Hi Gert!

The leading spaces must be removed, that was a copy/paste error in the wiki page. I have that corrected now. So the binding starts correct, your logfile shows:
23:16:47.305 INFO  o.o.b.a.i.bus.AstroBinding[:70] - AstroConfig[latitude=51.813,longitude=5.7991,interval=300]
23:16:52.328 INFO  o.o.b.a.i.job.JobScheduler[:144] - Scheduled a daily job at midnight for astro DayInfo calculation
23:16:52.328 INFO  o.o.b.a.i.job.JobScheduler[:161] - Scheduled astro SunPosition job with interval of 300 seconds
23:16:52.344 DEBUG o.o.b.a.i.job.AbstractBaseJob[:34] - Starting Astro DayInfoJob
23:16:52.344 DEBUG o.o.b.a.i.job.AbstractBaseJob[:34] - Starting Astro SunPositionJob
23:16:52.359 INFO  runtime.busevents[:26] - Sunrise_Time state updated to 2014-05-18T05:38:00
23:16:52.359 INFO  runtime.busevents[:26] - Noon_Time state updated to 2014-05-18T13:33:00
23:16:52.359 INFO  runtime.busevents[:26] - Sunset_Time state updated to 2014-05-18T21:27:00
23:16:52.359 INFO  runtime.busevents[:26] - Azimuth state updated to 327.00
23:16:52.359 INFO  runtime.busevents[:26] - Elevation state updated to -12.67

All items have their states. The Switch items are updated to ON if the time is reached. So the Sunrise_Event item gets updated to ON (and shortly thereafter to OFF) at 2014-05-18T05:38:00 and so on.
Do you have the *_Time items in your sitemap? These should show the times.

BR
Gerhard

gerrieg

unread,
May 19, 2014, 7:13:30 AM5/19/14
to ope...@googlegroups.com
Hi Ben!

Yes, it should work everywhere. But you need the build from https://groups.google.com/d/msg/openhab/QkeXnRTlcXk/y2Vg80dNA7UJ until my pull request is merged: https://github.com/openhab/openhab/pull/1073

BR
Gerhard

Ben Jones

unread,
May 19, 2014, 3:52:11 PM5/19/14
to ope...@googlegroups.com
Thanks Gerhard, I will build it locally and have a play. 

Ben Jones

unread,
May 19, 2014, 7:08:56 PM5/19/14
to ope...@googlegroups.com
Works like a charm! Thanks very much!!

Thomas Eichstädt-Engelen

unread,
May 20, 2014, 2:21:42 AM5/20/14
to ope...@googlegroups.com
Hi,

fyi, PR is merged and should be available in tomorrows nightly build!

Best,

Thomas E.-E.


--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Gert Konemann

unread,
May 20, 2014, 12:07:34 PM5/20/14
to ope...@googlegroups.com
Hi Gerhard,

My rules using the astro items are working fine. No idea why the DateTime items are not shown in the userinterface with the other items in my "Klimaat"group. That is not really needed, so its OK for me now. Thank you for your help.

Gert

Op maandag 19 mei 2014 13:12:40 UTC+2 schreef gerrieg:

n.schn...@gmail.com

unread,
Jun 2, 2014, 1:13:57 AM6/2/14
to ope...@googlegroups.com
Hi,

i am using the Astro Binding on a Ubuntu Server, but i am not able to find the binding in the Log or to publish values, even a manual restart at the OSGI Console doesn't make it work. Actual i am using the #643 built. 
I added the lines to the Config file.
Has anyone a suggestion, how to make it work?!  

thanks in advance!

Norbert 

Thomas Eichstädt-Engelen

unread,
Jun 2, 2014, 2:36:01 AM6/2/14
to ope...@googlegroups.com
Hi,

did you also configure items to use the binding?

Best, Thomas E.-E.


n.schn...@gmail.com

unread,
Jun 2, 2014, 9:41:26 AM6/2/14
to ope...@googlegroups.com
Hi Thomas,

of course, the REST-API tells me all were uninitialized.
the items:

Number   Azimuth        "Azimuth [%.2f]"         (Intern,Astro) {astro="type=AZIMUTH"}

Number   Elevation      "Elevation [%.2f]"       (Intern,Astro) {astro="type=ELEVATION"}

DateTime Sunrise_Time_astro   "Sunrise [%1$tH:%1$tM]"  (Intern,Astro) {astro="type=SUNRISE_TIME"}

DateTime Noon_Time      "Noon [%1$tH:%1$tM]"     (Intern,Astro) {astro="type=NOON_TIME"}

DateTime Sunset_Time_astro    "Sunset [%1$tH:%1$tM]"   (Intern,Astro) {astro="type=SUNSET_TIME"}

Switch   Sunrise_Event                           (Intern,Astro) {astro="type=SUNRISE"}

Switch   Noon_Event                              (Intern,Astro) {astro="type=NOON"}

Switch   Sunset_Event                            (Intern,Astro) {astro="type=SUNSET"}


the config:
############################## Astro Binding ##############################
 #
 # The latitude
 astro:latitude=50.8000
 # The longitude
 astro:longitude=6.2600
 # Refresh interval for azimuth and elevation calculation in seconds (optional, defaults to disabled)
 astro:interval=60

OSGI List:

82 Active org.openhab.binding.astro org.openhab.binding.astro(bid=226)

83 Active org.openhab.binding.astro.genericbindingprovider org.openhab.binding.astro(bid=226)


greetz
Norbert

gerrieg

unread,
Jun 3, 2014, 3:07:47 AM6/3/14
to ope...@googlegroups.com, n.schn...@gmail.com
Hi Norbert!

If it does not appear in the log, there might be a problem with the config in openhab.cfg. Another user had a space before the astro: properties, can you check this please?

I just tried your settings and it works, astro is starting and the items are populated.

Regards,
Gerhard

n.schn...@gmail.com

unread,
Jun 3, 2014, 12:08:48 PM6/3/14
to ope...@googlegroups.com, n.schn...@gmail.com
Hi Gerhard,

the space before the properties was the error.

Thank You!

Norbert
Reply all
Reply to author
Forward
0 new messages