[SOLVED] Astro Binding Sun Set Event not triggering

I was wondering if anyone else was having issues with the Astro binding. I have a fresh install of openhab 2.3.0-SNAPSHOT Build #1267 running in an lxd container. Using the Astro binding version 0.10.0.201804271558.

I added the local Sun and Moon thing through Paper UI. Looking at my events.log

2018-04-30 00:18:00.007 [vent.ChannelTriggeredEvent] - astro:moon:local:rise#event triggered START
2018-04-30 00:59:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:phase#event triggered FULL
2018-04-30 02:30:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered START
2018-04-30 08:40:00.001 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered START
2018-04-30 08:40:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered END
2018-04-30 09:22:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered END
2018-04-30 09:22:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered START
2018-04-30 10:01:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered END
2018-04-30 10:01:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered START
2018-04-30 10:32:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered END
2018-04-30 10:32:00.015 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered START
2018-04-30 10:36:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered END
2018-04-30 10:36:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:daylight#event triggered START
2018-04-30 11:15:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:set#event triggered END
2018-04-30 17:36:00.003 [vent.ChannelTriggeredEvent] - astro:sun:local:noon#event triggered START
2018-04-30 17:37:00.005 [vent.ChannelTriggeredEvent] - astro:sun:local:noon#event triggered END

It seems like everything is triggering except for the one thing I need to turn my porch light on at sun set.

I found Astro binding - Channel ‘astro:sun:local:set#event’ does not trigger #4018 on github which sounded exactly like my issue. But that is marked as being closed.

Can’t you publish the rule, please?

The rule is pretty basic.

rule "Sunset Rule"
when
    Channel 'astro:sun:local:set#event' triggered START
then
    OSP_LightSwitch_01_Switch.sendCommand(ON)
end

I’m pretty sure nothing is wrong there. But since the channel never triggers it hasn’t been tested.

rule "Sunset Rule"
when
    Channel "astro:sun:local:set#event" triggered START
then
    OSP_LightSwitch_01_Switch.sendCommand(ON)
end

You need to use double quotes:

https://docs.openhab.org/configuration/rules-dsl.html#channel-based-triggers

1 Like

I’ll give that a try. I had copied my example straight from https://docs.openhab.org/addons/bindings/astro/readme.html.

Either way shouldn’t I still be seeing astro:sun:local:set#event triggered START in my events.log?

Yes you should, but your log above only goes to noon and doesn’t show any evening events like sunset, dusk, civil dusk… We need to see evening logs before we can say for sure that there is no event

Here is more of the log. I had just posted all the events from 4/30.

2018-04-30 00:18:00.007 [vent.ChannelTriggeredEvent] - astro:moon:local:rise#event triggered START
2018-04-30 00:59:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:phase#event triggered FULL
2018-04-30 02:30:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered START
2018-04-30 08:40:00.001 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered START
2018-04-30 08:40:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered END
2018-04-30 09:22:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered END
2018-04-30 09:22:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered START
2018-04-30 10:01:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered END
2018-04-30 10:01:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered START
2018-04-30 10:32:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered END
2018-04-30 10:32:00.015 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered START
2018-04-30 10:36:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered END
2018-04-30 10:36:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:daylight#event triggered START
2018-04-30 11:15:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:set#event triggered END
2018-04-30 17:36:00.003 [vent.ChannelTriggeredEvent] - astro:sun:local:noon#event triggered START
2018-04-30 17:37:00.005 [vent.ChannelTriggeredEvent] - astro:sun:local:noon#event triggered END
2018-05-01 01:22:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:rise#event triggered START
2018-05-01 02:32:00.003 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered START
2018-05-01 08:38:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered START
2018-05-01 08:38:00.017 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered END
2018-05-01 09:21:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered START
2018-05-01 09:21:00.018 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered END
2018-05-01 09:59:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered START
2018-05-01 09:59:00.018 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered END
2018-05-01 10:31:00.003 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered START
2018-05-01 10:31:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered END
2018-05-01 10:34:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:daylight#event triggered START
2018-05-01 10:34:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered END
2018-05-01 11:48:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:set#event triggered END
2018-05-01 17:36:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:noon#event triggered START
2018-05-01 17:37:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:noon#event triggered END
2018-05-02 02:24:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:rise#event triggered START
2018-05-02 02:34:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered START
2018-05-02 08:36:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered START
2018-05-02 08:36:00.015 [vent.ChannelTriggeredEvent] - astro:sun:local:morningNight#event triggered END
2018-05-02 09:19:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:astroDawn#event triggered END
2018-05-02 09:19:00.017 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered START
2018-05-02 09:58:00.002 [vent.ChannelTriggeredEvent] - astro:sun:local:nauticDawn#event triggered END
2018-05-02 09:58:00.018 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered START
2018-05-02 10:30:00.003 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered START
2018-05-02 10:30:00.018 [vent.ChannelTriggeredEvent] - astro:sun:local:civilDawn#event triggered END
2018-05-02 10:33:00.003 [vent.ChannelTriggeredEvent] - astro:sun:local:rise#event triggered END
2018-05-02 10:33:00.016 [vent.ChannelTriggeredEvent] - astro:sun:local:daylight#event triggered START
2018-05-02 12:24:00.002 [vent.ChannelTriggeredEvent] - astro:moon:local:set#event triggered END

Not getting dusk or civil dusk for that matter either.

I changed my rule to:

rule "Sunset Rule"
when
    Channel 'astro:sun:local:noon#event' triggered START
then
    OSP_LightSwitch_01_Switch.sendCommand(ON)
end

And that worked as expected. So I believe I can safely rule out the issue being double quotes vs single quotes.

All I can think is that triggers that are falling after the end of the UTC day aren’t happening. Not sure how I could test that. Maybe set my location to London and see if that affects anything.

What version of OH are you running?

Version: 2.3.0-SNAPSHOT (#1267)

Odd, very odd…
Did you set your time zone?

I did that earlier today and gave openhab a restart, but I’ll have to wait until tonight to see if that changes anything.

Edit: Setting my timezone in the openhab settings didn’t help.

I too have the same issue. About 10 days ago, I updated my OH2 to the latest snapshot (at the time) and now Astro sunset no longer triggers rules but the Sunset event shows up in the log.

Note: I just went to myopenhab.org to see if there’s a way to figure out what version I’m running (to let y’all know) while remote, and discovered two new astro items in my Paper UI Inbox; Local Moon, and Local Sun. Are these related to my issue? Are there new Astro insructions for implementation of the use of Sunset event? Thanks.

I too encountered this problem since a few days.

My rule which is not working:

rule "Rollos Astro hoch"
when
    Channel 'astro:sun:home-offset:rise#event' triggered START
then
	Rollos_is_day.sendCommand(ON)
        ...

But this rule works every day without any problem so far:

rule "Rollos abends Astro zufahren"
when
	Channel 'astro:sun:home-offset:civilDusk#event' triggered END
then
	Rollos_Nachtstellung.sendCommand(ON)
end

I was on a snapshot from 2018-05-04 (#1271), today i made another update to snapshot #1278. But now i have to wait until tomorrow morning to check if this works now.

But i think it worked the first few days with the snapshot #1271, i think the first problem with this rule was 2 or 3 days ago.

Today in the morning, it worked again, my blinds opened.

I´m on #1278.

Wait another day and the mark the thread as solved.
Running on SNAPSHOT can cause trouble!

This is not my thread, the opener of this thread can do this only?

Some more replays of the other users, which encountered the same problem? Is it working for you again with the latest snapshot, too?

Just been through my logs, It always worked for me!
Yes only the opener of the thread. I’ll edit the thread title to solved anyway

This recent change is probably related. It appeared in #1275 first (I think). Try again with the most current OH snapshot and If you feel it is still misbehaving please leave a comment in that Github issue describing your problem.

Does this work at all?
I don’t see this entry in my events.log.
But I see this.

astro:sun:home-offset:civilDusk#event

So this will work, but what about the first one? Is this not available any more?