Event happening 1h before sunset triggers start?

Hi,
i have a rule that triggers when sunset starts. Thanks a lot to ASTRO its very easy as you for sure know.
Is there a simple way to have a rule that starts every day 1h before sunset starts?

Thanks a lot, Norbert

rule "HouseNr_Switch ON via Sunset"
when
    Channel 'astro:sun:local:set#event' triggered START
then
    HouseNr_Switch.sendCommand(ON)
    PvXL_Switch.sendCommand(OFF)
end

Binding docs describe offset.
Perhaps less obvious is that you can create another Thing and apply offsets to its features, while leaving your original Thing as normal.

1 Like

ah OK, but it requires a new “thing”. will check this offset element. thanks!

I didn’t say it required a new Thing.
You can apply an offset to any channel. But when it’s offset, it’s offset. If you want both regular and offset versions of the exact same channel, you would need a separate Thing.
However, for something like “lights at dusk” there are several dusk channels - civil, astro, etc. You can offset just one of those.

OK. thanks - will check out.

One more question as it seems to not work properly.
I used the eyisting “Local Sun” thing i have related to Astro binding, i simply took astro:sun:local:civilDusk#start…which is in my location today 18:19…

In addition i created an item which would not be required, as far as i understand…and it does the -45min offset correctly…but based on the rule below the switch turned off at 19:45. Any idea??? could you please check if ( @rossko57 ) my rule should work that way? I’m uncertain if the set offset is considered if i do this based on an event???

2020-03-28 22:17:34.028 [vent.ItemStateChangedEvent] - LocalSun_CivilDusk_StartTime changed from 2020-03-28T18:19:00.000+0100 to 2020-03-28T17:34:00.000+0100

rule "PvXL_SwitchHouseNr_Switch OFF via Sunset"
when
    Channel 'astro:sun:local:civilDusk#event' triggered START
then
    PvXL_Switch.sendCommand(OFF)
end

What usually confuses people with the Astro binding is that state channels and events channels are completely different channels.
As such, they each have completely different offset and range settings.
Applying an offset to a ‘dusk’ state channel will have no effect on a ‘dusk’ event channel.

So an Item would be linked to a state channel.

while your rule is triggered from an event channel.

You’ve not shown us whatever you did with offsets, so I have to guess that you offset the state channel only.

It’s always difficult messing with astro settings as you might not get results for 24 hours, events for day ahead are calculated once at midnight.

hm, thanks for your feedback!

Long story short…based on my offset setting for element (whatever its called correctly)…will it work based on my rule above (to take my offset into consideration and not stay on zero offset).

I don’t know, I don’t use PaperUI for this stuff so I don’t recognize which channel you’re tweaking there.
For an event trigger, you want to be tweaking the Range Event channel that is the same one you use for a rule trigger.

hm, somehow it does not take the offset correctly as you already mentioned above…

What i see is that the “item” i created works properly and based on my offset.
LocalSun_CivilDusk_StartTime changed from 2020-03-30T19:22:00.000+0200 to 2020-03-30T18:37:00.000+0200

Can you please tell me how i would define a rule that triggers when my item reached its time…compared to what i have right now…from the rule above. thanks!!!

You can’t, that’s why Astro provides event triggers.

You should make sure you have restarted at least this binding to pick up any Thing edits. The events get scheduled at restart or midnight.

sorry but still i do not make it right and it confuses me even more every day.

I’m on Civil Dusk for my City…
It seems whatever i change the offset for “astro:sun:local:civilDusk#start” it has no impact to the rule i do on “Channel ‘astro:sun:local:civilDusk#event’ triggered START”.

Should this channel take offsets into account or do i need anything put into this rule in order to work as it should…whatever i change in the offset…it perfectly reflects immediately in “items” based on this Channel, but the channel rule itself always triggers without any offset?

Any idea?

That is correct.
You would want to change the offset for ‘astro:sun:local:civilDusk#event’
States are not events.
They have different channels.
They have different offsets.
civilDusk#start is a state channel.
You can set an offset on that, it will not affect the events.
civilDusk#event’ is an event channel.
You can set an offset on that, it will not affect the states.

1 Like

oh will try…still little confusing but i start getting it…

Look for Range Event channels in PaperUI

thanks a lot, after several days of testing - seems to work great. many thanks again!!!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.