I’m just converting from OH 1.8.3 to 2.3 and I have this issue I can’t seem to solve. I used to have quite a few switches with the Astro binding, triggering 10/20/30 minutes before/after sunrise and sunset. I have tried to reproduce them here after reading nearly all the topics, but I can’t seem to work it out. Any help would be appreciated.
Your trigger is correct, assuming the channel name (and thing name inside) is, cross-check with PaperUI.
No items needed.
You should be seeing this event in events.log (if not, your astro binding config may be bad).
Thanks. I had a few weird things in my events.log - for example on this binding I saw a ‘noon’ event starting and ending, which was a bit strange for me, but at least there was an event… I just don’t know why isn’t the event fire when I’m at the given time (unless I miscalculated it) - I’ve tried to calculate the “now” time from the actual sunrise value and put in an offset which should make it fire in like 2-3 minutes from saving the rules/things file, but nothing happened so far.
Double-check astro binding level config (geocoordinates etc) and ramp up debug logging (log:set debug org.openhab.binding.astro in Karaf console) to see in openhab.log what’s happening.
Eventually, you might need to restart the binding (bundle:restart …).
Btw, to have multiple triggers x/y/z minutes before or after, setup multiple things of astro type, each to have a different offset. No need to do any time calculations in rules.
Thanks guys. It seems like if I do the same with text-based config it doesn’t work, but if I do it from PaperUI it does. Odd. Which one do you use?
For me if a thing is configured via the .things file, for example the channel doesn’t show the offset in PaperUI either.
Well I believe that if you define the thing in .things file, you must be comprehensive in doing so, i.e. you need to include the channel definitions, too. That definition is moved forward into the internal things jsondb database and used. Not sure what happens if you change the input file, though, never tried, you might or might not need to delete the thing before.
As a general advice, you should not be using .things files. Few people (if any) use it, it’s not supported on a number of bindings, and after all there’s no real need or benefit in doing so.
Use PaperUI to define things at least for ‘static’ things such as astro things.
Use autodiscovery on subsystems to have many devices (= things to be added for each device) such as ZWave.
Thanks, this is what I do now and it is indeed working. It’s just hard to get away from the practices of OH 1.83, and I’m still to figure out how to back up all these PaperUI configs. Thank you guys for all the help