[SOLVED] Astro rise and set START events not triggering

Dear all,

I’ve done a fresh OH2 installation. Previously my sunrise and sunset rules were working flawlessly, but now I don’t seem to receive the ‘rise’ or ‘set’ START events, and hence my rules are not triggered.

For a test I’ve used the offset to try to fire the sunrise start event at 12:50.

From the event log the sunrise time updated correctly, but the event is not triggered.

2017-07-09 12:48:59.808 [ItemStateChangedEvent     ] - Sunrise_Start changed from 2017-07-09T12:39:00.000+0200 to 2017-07-09T12:50:00.000+0200
2017-07-09 12:48:59.817 [ItemStateChangedEvent     ] - astro_sun_local_rise_start changed from 2017-07-09T12:39:00.000+0200 to 2017-07-09T12:50:00.000+0200

My event items:

DateTime	Sunrise_Start	"Sunrise Start [%1$tH:%1$tM]"	(gAstro)	    {channel="astro:sun:local:rise#start"}
DateTime	Sunset_Start	"Sunset Start [%1$tH:%1$tM]"	(gAstro)	    {channel="astro:sun:local:set#start"}

The rules:

rule "Switch NightState to ON at sunset"
when
    Channel 'astro:sun:local:set#start' triggered START
then
    postUpdate(NightState, ON)
    logInfo("NightState updated", "--> NightState set to " + NightState.state)
end

rule "Switch NightState and LateNightState to OFF at sunrise"
when
    Channel 'astro:sun:local:rise#start' triggered START
then
    postUpdate(NightState, OFF)
    postUpdate(LateNightState, OFF)
    logInfo("NightState updated", "--> NightState set to OFF")
    logInfo("LateNightState updated", "--> LateNightState set to OFF")
    sendCommand(LIFX_Color, ON)
    logInfo("Test offset", "--> Sunrise trigerred with offset")
end

If the event ran the nightstate and latenight switches would have been set to OFF. This event didn’t fire even without the offset over night.

Would anyone give me an idea how to better debug this or can spot something wrong?

Many thanks in advance,

Craig

Edit: I see what I did wrong… the event should have been set to the EVENT channel and not the TIME channel :slight_smile: All sorted now, and maybe this helps someone else who runs into the same issue

2 Likes