Astro binding offsets do not work in rules

  • Platform information:
    • Hardware: Raspberry 3 B
    • OS: openhabianPi Linux 4.14.52-v7+
    • Java Runtime Environment: 1.8.0_152
    • openHAB version: 2.3
  • Issue of the topic: I created two things for timer handling using the sun from astro binding
    • astro_sun_local
      • for my location
    • astro_sun_minus90
      • for my location
      • with items having an offset of “-90”

I get this trace for these two things and the corresponding items for astroDawn

2018-08-14 00:00:30.308 [vent.ItemStateChangedEvent] - astro_sun_minus90_astroDawn_start changed from 2018-08-13T02:00:00.000+0200 to 2018-08-14T02:03:00.000+0200
2018-08-14 00:00:30.318 [vent.ItemStateChangedEvent] - astro_sun_minus90_astroDawn_end changed from 2018-08-13T03:02:00.000+0200 to 2018-08-14T03:04:00.000+0200
2018-08-14 00:00:30.678 [vent.ItemStateChangedEvent] - astro_sun_local_astroDawn_start changed from 2018-08-13T03:25:00.000+0200 to 2018-08-14T03:29:00.000+0200
2018-08-14 00:00:30.685 [vent.ItemStateChangedEvent] - astro_sun_local_astroDawn_end changed from 2018-08-13T04:30:00.000+0200 to 2018-08-14T04:32:00.000+0200
2018-08-14 03:29:00.022 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered START
2018-08-14 03:33:00.012 [vent.ChannelTriggeredEvent] - astro:sun:minus90:astroDawn#event triggered START
2018-08-14 04:32:00.004 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered END
2018-08-14 04:34:00.013 [vent.ChannelTriggeredEvent] - astro:sun:minus90:astroDawn#event triggered END

So the item is set correctly - astro_sun_minus90_astroDawn_start is 90 minutes before astro_sun_local_astroDawn_start.

But the START event comes at the same time.

How do I get the START event also 90minutes earlier?


You have to set the offset on the trigger channel as well.

I had this same question yesterday. The Astro docs can be confusing. Can you post your rules file and things?

I have my Astro things defined in paperui, but I know this question have been answered before, I’ll see if I can find the thread.


Hello Thedannymullen,

same as pacive I configured my things in the paperui - so no thing file is available.
My rule file is this astro.rules.xml (702 Bytes)

Hi pacive,

thanks. I have indeed found this post, but was hoping that in the meantime another solution was available. This entry is rather old.

Also my intention is to set the offset for different items seperately - agreeing that the name “minus90” is quite bad for this approach - so just chaning the GPS coordinate is unfortunately not really helping me.

If you use paperui you just have to click the pencil icon beside the “Range event” channel and change the offset there as well. Just as you did for the “Start time” channel.

so the trick is that I have to also change the RANGE event?
I totally ignored it as the log showed that the time for the e.g. astroDusk was changing. So I assumed that the StartEvent will come at the same time.
Thanks a lot. I will try this out tonight.

so if i change the sunset start and the range event at the paperui by -30 minutes ,the event will trigger 30 minutes sooner?i tried to change only the start but it didnt work.

I can tell you how to do it in things files if interested. I don’t use paper ui.

Yes. In fact if you only need the trigger for your rule, the RANGE event is sufficient. Just if you want to e.g. display the time somewhere you also need to change the SUNSET_START item.