I can’t fully answer why you are having the problem but I do notice the following:
the channel names are different between your sunrise and sunset rule trigger names. One references home which does match your Things and the other matches local which is different from your Things.
@rlkoshak Thanks! I don’t know why I did not see that. I changed local to home, hopefully that was the error.
I am actually using openhab 2.1.0, my bad, but 4.0.8 is what typing in ‘version’ returns in the openhab console… strange.
rule "example trigger rule"
when
Channel ‘astro:sun:home:rise#event’ triggered START
then
…
end
This will give an ON with no duration, means it will switch to OFF right after the ON.
I you need a steady ON/OFF you can use the above rule and use a proxy item.
As some have maybe seen, i moved forward to OH2. Right now i update Astro and have one issue regarding Sunset events. Previously i did it like this:
Does such an item still exist to reference it later in a rule to switch on another item?
Or is the Rule above the way to go forward with OH2?
With the rule above, do I have any issue with this “going on with no duration”…if in the rule i want to switch on a device simply when sunset has come?
The duration is mainly a concern for when people want to have a switch that remains ON for the full sunset time so they can check the sunset state and do something different in other rules.
The time of day design pattern shoes how to use the events, DateTimes, and how to keep track of the time of day without letting your rules with duplicated if(now.isAfter(sunrise) && now.isBefore(noon)) statements.
hm, i tried now to set an event via channel astro:sun:local:set#start. As to me it looked the most promising to what i want to reach…a trigger when sunset starts. Did not trigger. So I had a second look and saw that in the docs its stated to use the following channel: astro:sun:home:rise#event
Will do the same analog for set event. but my question is - in order to use events I have to use this “range event” channel. It does not work to simply make use of another channel like the one for set_start (?)
rule "Zonsopgang - nachtverlichting uit"
when
Channel 'astro:sun:local:rise#event' triggered START
then
logInfo("Astro","De zon komt op. Goedemorgen.")
sendCommand(KNX_GV_Nachtverlichting_4_2_0, OFF)
end
So I guess I got the naming correct, but it still doesn’t work. Any idea?
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 ).
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”;
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).
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 …