Environment:
OH3 3.10 on
openhabian
Scenario: one or multiple astro events fire, e.g.
astro:sun:local:morningNight#event START
astro.things and astro.items are as proposed in examples (only change:home->local)
Problem:
The contents of receivedEvent always is ‘START’ . In OH2, I got the entire event String (which I am missing now)
NOTE: the problem only occurred when migrating from OH2 → OH3.
I tested this using the console and sending this command:
things trigger astro:sun:local:morningNight#event START
Of course in the first place it also happens when the event is generated by the astro binding (and also applies for all events in the ‘when’ section of the rule.
Here is my rule:
rule "astro event"
when
Channel "astro:sun:local:night#event" triggered START or
Channel "astro:sun:local:daylight#event" triggered START or
Channel "astro:sun:local:morningNight#event" triggered START or
Channel "astro:sun:local:astroDawn#event" triggered START or
Channel "astro:sun:local:nauticDawn#event" triggered START or
Channel "astro:sun:local:civilDawn#event" triggered START or
Channel "astro:sun:local:rise#event" triggered START or
Channel "astro:sun:local:noon#event" triggered START or
Channel "astro:sun:local:civilDusk#event" triggered START or
Channel "astro:sun:local:nauticDusk#event" triggered START or
Channel "astro:sun:local:astroDusk#event" triggered START or
Channel "astro:sun:local:eveningNight#event" triggered START or
Channel "astro:sun:local:riseSet#event" triggered
then
logInfo("","receivedEvent {} detected at {}", receivedEvent, now)
val convertedEvent = makeAstroEventHumanReadable.apply(receivedEvent)
//logInfo("","convertedEvent = {}", convertedEvent)
LastEvent.postUpdate(convertedEvent)
val mqttActions = getActions("mqtt","mqtt:broker:myUnsecureBroker")
mqttActions.publishMQTT("astroevent",convertedEvent,true)
end
Log File contents graphically
Log File Text:
2021-10-30 12:54:05.450 [INFO ] [openhab.event.ChannelTriggeredEvent ] - astro:sun:local:morningNight#event triggered START
==> /var/log/openhab/openhab.log <==
2021-10-30 12:54:05.456 [INFO ] [org.openhab.core.model.script. ] - receivedEvent START detected at 2021-10-30T12:54:05.456323+02:00[Europe/Berlin]
2021-10-30 12:54:05.459 [INFO ] [org.openhab.core.model.script. ] - makeAstroEventHumanReadable::pEventString = START
As you can see, there is only ‘START’ in the received event.
Thus any subsequent event dependant processing fails.
Any advice or workaround will be appreciated (I spent some time digging in the threads already).
Best Regards,
Uwe