Astro Binding Offset Through 3.2:UI Not Working

Hello all, I’m new to openHAB (and I’m old … with Insteon) As a first-time user I followed the instructions and created a new install of openHab 3.2.0 with Azul JDK 11 on a Windows 10 Hyper-V guest.

I made a “thing” from astro:sun:data which I successfully used for a sunset trigger. I then made another “thing” the same way and configured the “channel” for sunset start time (set#start) and entered 15 in the Offset. I am hoping to be able to delay the trigger 15 minutes past sunset. It did not work. The event logs show the trigger fired at actual sunset. I went back and looked at the “code” for that channel and it does not have the offset parameter set. I’ve seen script samples that code the offset but I have no idea how to code this into the channel - looks like it is controlled by the UI.

  1. Am I doing something wrong? What should I be doing?
  2. Is this another bug in OH 3.2? If so, is there a workaround?
  3. Can I modify the channel’s code by hand? Or do I break the UI’s control of it

FYI, I have not had much luck with scripting in this thing so am using the UI for my initial uncomplicated requirements. On the other hand, I’ve got ECMA Javascript installed … if someone wants to nudge me with a script sample that might help, I would use that.

Thank you in advance.

This is what the channel code looks like even though the UI shows 15 in the Offset

UID: astro:sun:Sunset15
label: Sunset Plus 15
thingTypeUID: astro:sun
useMeteorologicalSeason: false
interval: 300
geolocation: xx.yy,-xx.yy

This is just the yaml config for the thing itself, not for each of the channels that thing has. The only place you see that info is in the channel configuration dialog. So if you click on the configure channel link and see the offset properly listed in the page that comes up then it has been stored correctly.

Do you mean that the channel without offset from the first thing and the channel with the offset from the second thing fired at the same time?

The Channel Config shows the 15 minute offset properly. And still both Things triggered/fired the same time - which is my observed problem. Is there a more rigorous way to test this … fix it?

New users very often get befuddled with Astro offsets.

Here’s the deal -
Astro has two types of channels, state and trigger (event). They do different things - the state channels can be linked to Items, the triggers make transient events that can be used e.g. to trigger rules,

For example, sunrise state is calculated at midnight as say 06:30. A linked Item will show 06:30 all day long - nothing happens to it as sunrise comes and goes, sunrise today is/was 06:30.

A sunrise trigger is just dormant mostly. At 0630 it makes an event START, then an event STOP, then goes dormant again. Sunrise is happening or it is not happening, there is no visible time here.

What you have missed is that state and trigger channels of similar name have separate offsets. You can offset sunrise state by +15, and see 06:45 in your Item. The sunrise trigger still fires at 06:30 because you didn’t offset that.

1 Like

Thank you rossko57 - that is a perfect explanation, which I really appreciate. I will now clean my glasses and RTFM for where this is set in the UI.