Any news on this?
This simple rule works perfectly for my needs to know when it is daylight. Thanks
Hi guys, just wanted to inform you that Gerhard implemented channel triggers in the latest astro binding snapshot! Now you can use a trigger in a rule:
rule "example trigger rule"
when
Channel 'astro:sun:local:rise#event' triggered START
then
...
end
Itās working perfectly! Hereās the link to the readme: https://github.com/openhab/openhab2-addons/tree/master/addons/binding/org.openhab.binding.astro
Regards, Christian
Hello!
Iāve tried this example, but it didnāt work for me. I have a thing astro:sun:local, and two rules:
rule "Night ON"
when
Channel āastro:sun:local:set#eventā triggered START
then
NightTime.postUpdate(ON)
end
rule "Night OFF"
when
Channel āastro:sun:local:rise#eventā triggered START
then
NightTime.postUpdate(OFF)
end
The item Iām using with astro 1.9 works as it was working before (itās night time here), but a new NightTime item havenāt changed to ON after sunset. What am I doing wrong? Iām using OH2 online snapshot, and Iāve installed Astro 2 binding today, so I guess it should be the latest version of the binding.
Best regards,
Davor
You can check your sun-thing for the range event channel, see this
screenshot. If it isnāt there youāve got an older version.
Christian
Hello!
I do have a range event channel in the Paper UI. So, I guess the binding I have is OK. Do I have to do any other setup of the binding (binding picked geolocation by itself)? Thank you for your help.
Best regards,
Davor
@davorf I did the same yesterday and it worked for me.
Please have also a look to the āastro.cfgā in conf\services\ to be sure that longitude, latitude and optionally refresh interval is set to your location. Or you can do it in the thing itself:
BR
Michael
You can look up your longitude and latitude with Google maps. Then edit
your sun and set it to the right value, the default is not your location.
I didnāt have to edit the astro.cfg, is all done via the paper ui
Christian
Hello!
Iāve looked up latitude and longitude that was set by default, and itās actually just a few hundred meters from my actual location. Interval is set to 300 by default, so, I guess thatās OK too.
@michaeljoos: astro.cfg has the parameters used for astro1 binding. Iām trying to use astro2, and I think all the settings for OH2 native bindings are saved in JSON (earlier MapDB), and not the .cfg file in services folder.
Thank you both for your help.
Best regards,
Davor
Ah, I have a VPN up and running, so I got the wrong values automatically
Hello!
Do you know if itās necessary to have items bound to the channels used by rules event, because I donāt have any items connected. Just the rules triggering proxy item.
Best regards,
Davor
Hi,
Iām not sure, but I do have items bound to display sunrise/sunset in the UI:
Group Sun "Sonne" <sun> (All)
DateTime Sunrise_Time "Sunrise [%1$tH:%1$tM]" <sunrise> (Sun) { channel="astro:sun:local:rise#start" }
DateTime Sunset_Time "Sunset [%1$tH:%1$tM]" <sunset> (Sun) { channel="astro:sun:local:set#start" }
Regards, Christain
Iāll try adding an item for sunrise/sunset to see if it makes any change. Thank you for your help.
Best regards,
Davor
How can i add a offset to the event
Note: Offsets for each event group can be configured in the channel properties
i do not find a documentation abut this.
Afaik it isnāt implemented (yet).
I just use this in my rules:
Thread::sleep(60000)
Itās in milliseconds, so this example sleeps for 60 seconds.
Christian
okay i declare a global integer for the offset
var Integer OffsetForSun = 1000*60*15
This is great. Looks like offset has just been added so should be in the next nightly build by adding an āoffsetā (in minutes) to the channel properties
When is it possible to use this function?
Should be available in last nights SNAPSHOT.
Hello!
Iāve tried adding items for sunrise and sunset. They update correctly, but events are not triggered. I even updated OH2 to the latest nightly snapshot, but it still doesnāt work. Any help would be greatly appreciated.
Best regards,
Davor