Astro binding to move switches at sunset/sunrise

Try to find out if the trigger does not work or the sendCommand does not work.

What does your events.log tell you? If you have something like

2017-08-27 06:32:00.145 [ChannelTriggeredEvent ] - astro:sun:local:rise#event triggered START

in your log your trigger works.

What does your openhab.log tell you?

If you have something like

2017-08-27 06:32:00.141 [INFO ] [.eclipse.smarthome.model.script.Astro] - De zon komt op. Goedemorgen.

in your log, again, your trigger works fine.

If your trigger works fine, try

KNX_GV_Nachtverlichting_4_2_0.sendCommand(OFF)

Hi,
The problem is really with the trigger, not the rule.

  • ā€œastro:sun:local:rise#event triggered STARTā€ is not in events.log;
  • The loginfo I have in my rule does not put anything in openhab.log;

Then check via karaf if your astro binding is in state ā€œactiveā€

In Karaf I see:

openhab> feature:list|grep -i astro
esh-binding-astro                           | 0.9.0.SNAPSHOT   |          | Started     | openhab-addons-2.2.0-SNAPSHOT |
openhab-binding-astro                       | 2.2.0.SNAPSHOT   | x        | Started     | openhab-addons-2.2.0-SNAPSHOT | Astro Binding
esh-binding-astro                           | 0.9.0.SNAPSHOT   |          | Started     | addons-2.2.0-SNAPSHOT         |
openhab-binding-astro                       | 2.2.0.SNAPSHOT   | x        | Started     | addons-2.2.0-SNAPSHOT         | Astro Binding
openhab> bundle:list
178 | Active   |  80 | 0.9.0.201706170545     | Astro Binding

So I guess that is fine?

No, itā€™s not.
You have two or even more bindings started, but not one of them is active.
You screwed up your setup!
Delete any astro bindings you may have in your addons folder, then install the astro binding through PaperUI and make sure it is ā€œactiveā€, not started.
Also make sure you donā€™t have any bindings loaded in your addons.cfg.

Edit: okay, did not see the last couple of lines (too much beer this evening :grinning: ).
If only ONE binding is active it should be fine. But why do you have so many astro bindings installed?
Clean up your installation, then it should work ā€¦

Hi,
The only way I installed the Astro binding was via PaperUI. I donā€™t have any custom .JARs in the /addons folder. So I donā€™t know why I have multiple entries.

Anyway, this is what I have done now:

  • I uninstalled the Astro binding via PaperUI;
  • I remove the ā€œlocal sunā€ and ā€œlocal moonā€ things via PaperUI;
  • I stopped OH;
  • I uninstalled the offline add-ons (apt-get purge openhab2-addons). Not sure why I installed them in the first place.
  • I deleted the /tmp and /cache folder;
  • I started OpenHab;
  • Somehow I notice the local sun/moon where back (status Uninitialized). I tried to remove them again, but they remain in status ā€œRemovingā€;
  • I installed the Astro binding via PaperUI;
  • My things are now in status ā€œonlineā€ (despite removal attempts);
  • I was now able to remove them successfully (I guess you first need to remove things and then uninstall the binding - makes sense);
  • Using ā€œsearch for thingsā€ Iā€™ve found the new ā€œlocal moonā€ and ā€œlocal sunā€;

My openhab.log shows:

2017-08-28 09:24:23.910 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-moon at midnight for thing astro:moon:local
2017-08-28 09:24:23.911 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled astro job-daily-sun at midnight for thing astro:sun:local
2017-08-28 09:24:23.993 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local
2017-08-28 09:24:24.208 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2017-08-28 09:25:34.378 [INFO ] [stro.discovery.AstroDiscoveryService] - Evaluated Astro geolocation: latitude: 5X.XXXX, longitude: 5.XXXX

Karaf shows:

openhab> bundle:list
START LEVEL 100 , List Threshold: 50
 ID | State    | Lvl | Version                | Name
----+----------+-----+------------------------+---------------------------------
202 | Active   |  80 | 0.9.0.201706170545     | Astro Binding

And:

openhab> feature:list|grep -i astro
esh-binding-astro                           | 0.9.0.SNAPSHOT   |          | Started     | addons-2.2.0-SNAPSHOT   |
openhab-binding-astro                       | 2.2.0.SNAPSHOT   | x        | Started     | addons-2.2.0-SNAPSHOT   | Astro Binding

So the duplicate entries have been removed.

So now Iā€™ll have to wait untill the sun sets before I can check if the trigger is now triggered correctly (the values in items were already populated correctly before).

Great clean up, good luck!

Thanks, but unfortunately the rule did not trigger. :-/

What the f**k? Sorry, no more ideas. There were some astro binding issues fixed with the latest snapshot, maybe you try do get that new snapshot working ā€¦

I just upgraded from #1024 to #1025. Letā€™s see if that solves anything. Iā€™m waiting for the sun to set. :slight_smile:

I have looked into:



But there is nothing written about changes in astro binding. Where can i find these changes???

AFAIK, the Astro binding comes from Eclipse Smarthome, so you have to look into those repositories:

1 Like

Following this thread because I am having the same issues with Astro installed through PaperUI.

Unfortunately, upgrading to #1025 did not have an impact. Any other ideas? :frowning:

I would do a quick install on a separate computer (Windows, Mac), itā€™s just unzipping to a folder, then install only the astro binding and copy your astro rules and astro items to that instance.
And see what happens ā€¦

I may be wrong, but I donā€™t think the latest change to fix this has been merged into Eclipse Smarthome yet.

If you look here: https://github.com/eclipse/smarthome/pull/4131, the pull request is still open.

The latest change for the Astro binding is 11 days ago:

I think we just have to wait a little longer.

Mike

I canā€™t remember any issues where the trigger did not trigger at all like in @Dries case . There have been several issues with the astro binding lately, to find out which one made it into a snapshot you may look at:

https://hudson.eclipse.org/smarthome/job/SmartHomeDistribution-Stable/changes

and

Thanks. Will try to do that this weekend. But Iā€™m not sure which conclusions I could draw from that. Suppose that would work, what does it learn me?

[EDIT]
Ok, I decided to give it one more try. In the issue I reported on GitHUB, @triller-telekom provided a new Astro-jar.
This is what I did:

  • I delete the things ā€œlocal sunā€ and ā€œlocal moonā€;
  • I removed the Astro binding installed via PaperUI;
  • I stopped OpenHAB;
  • I deleted the contents of /cache and /tmp;
  • I upgraded to the latest build (#1028);
  • I started OpenHAB;
  • I added the jar-file to the addons-file;
  • Two things where found in PaperUI - I added them. Latitude/longitude were prefilled nicely.
  • In openHAB.log I see:
2017-08-31 12:37:58.883 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local
2017-08-31 12:37:58.893 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:local every 300 seconds
2017-08-31 12:37:59.106 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:moon:local
2017-08-31 12:37:59.114 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:moon:local every 300 seconds
2017-08-31 12:38:02.297 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2017-08-31 12:38:02.315 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:sun:local every 300 seconds
2017-08-31 12:38:03.263 [INFO ] [thome.binding.astro.internal.job.Job] - Scheduled Astro event-jobs for thing astro:sun:local
2017-08-31 12:38:03.283 [INFO ] [ding.astro.handler.AstroThingHandler] - Scheduled Positional job astro:sun:local every 300 seconds

Now fingers crossed! I hope it makes a difference.

This way you may find out if your openHAB instance is the problem or your setup regarding the astro binding.

Steps could be:

  • new clean openHAB install
  • only astro binding installed
  • check the channel triggers, if okay: add your items and rules
  • check the triggers, if okay: look for problems in your original openHAB install. If rules do not trigger: look for problems in your astro items and rules.

Ok, clear.
Howeverā€¦ the sun has just set 10 minutes ago where I live. And this is what Iā€™ve got:

2017-08-31 20:25:00.178 [INFO ] [eclipse.smarthome.model.script.Astro] - De zon gaat onder, slaapwel.

Meaning the rule got triggered using the Astro Jar mentioned on Github.

Finally! :fireworks:

Thanks for your help!

1 Like