Offset on Sunrise and Sunset event

Hello,
i’m migrating from OH1.8 to OH2.4.
I’m working hardly :smiley:
I have 2 rules, sunrise and sunset event.
On OH1.8 i created 2 items:
Switch Sunrise_Event { astro=“planet=sun, type=rise, property=start, offset=-40” }
Switch Sunset_Event { astro=“planet=sun, type=set, property=end, offset=20” }
And then 2 ruels.

With OH 2.4, i just copied the 2 rules and modified:
when
Item Sunset_Event received update ON
then

to

when
Channel ‘astro:sun:home:set#event’ triggered START
then

But i didn’t understand how to use the offset.


Can u help me?
Thanks in advance!

May be this posting helps: Rollershutter down at 1 hours after END of sunset

Depends on how you’ve setup the OH2 astro thing. The pointer in the previous reply only applies if you use .things files, but the recommended method is to create/discover a thing in PaperUI.
If you did that, you can edit the channel’s options, there you can add the offset (and more like ‘earliest’ and ‘latest’ options).

Hello,
thanks to all!
In astro things file, i create a new thing:
astro:sun:local [ geolocation=“42.262,12.687”, interval=600 ]
{
Channels:
Type rangeEvent : rise#event [
offset=-40
]
Type rangeEvent : set#event [
offset=20
]
}

And i use it only for this event.
SunRise event works correctly!
Thanks

I don’t have an Astro things file. I configured astro with PaperUI. Can you tell me how to set this up?

Configuration > Things
Click your main Astro Thing
See the channels
Click the pencil/edit symbol on a channel
See the form for earliest/latest/offset options.

2 Likes

Thanks Rossko that makes it very clear.