HaKuNa
(Remo M)
May 12, 2021, 3:08pm
1
I guess jython thing triggers are no longer working in M4 (or in OH3, not sure if I have tested it after the migration from OH2.5).
Classic DSL rule and NGR rule from the GUI are working.
jython rule
@rule("Charge iPad Openhab failsave", description="If thing OFFLINE charge iPadMini", tags=["myStrom, iPad"])
@when("Thing icloud:account:xxxxxxxx changed")
@when("Thing icloud:device:xxxxxxxx:xxxxxxxx changed")
def myStromiPadFailsave(event):
log.warn("Rule: Charge iPad Openhab failsave started.")
status=event.getStatusInfo().getStatus().toString()
if str(status) != "ONLINE":
events.sendCommand("MyStromKueche_Switch", "ON")
log.warn("iPad Akku wird geladen - account or thing not ONLINE.")
log.warn("Rule: Charge iPad Openhab failsave ended.")
DSL rule
rule "Charge iPad Openhab failsave"
when
Thing "icloud:account:xxxxxxxx" changed
then
logInfo("RULE","=>Charge iPad Openhab failsave<= started.")
val ThingStatusInfo = getThingStatusInfo("icloud:account:xxxxxxxx")
if(ThingStatusInfo.toString.contains("OFFLINE")) {
MyStromKueche_Switch.sendCommand(ON)
logInfo("IPAD","iPad Akku wird geladen - account OFFLINE.")
}
logInfo("RULE","=>Charge iPad Openhab failsave<= ended.")
end
Tested the same with just a log output, still not firing.
Anyone else with this issue ?
rossko57
(Rossko57)
May 12, 2021, 3:57pm
2
What’s the event in your events.log?
HaKuNa
(Remo M)
May 12, 2021, 4:07pm
3
Sorry, “old” DSL rule is working, I tested with the wrong ThingID.
But the jython rule still not fires.
event.log
2021-05-12 16:46:23.739 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from UNINITIALIZED to INITIALIZING
2021-05-12 16:46:27.155 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): iCloud response invalid: null
2021-05-12 17:02:08.827 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from OFFLINE (COMMUNICATION_ERROR): iCloud response invalid: null to UNINITIALIZED
2021-05-12 17:02:08.832 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
2021-05-12 17:02:18.081 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2021-05-12 17:02:19.472 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): iCloud response invalid: null
2021-05-12 17:03:29.016 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from OFFLINE (COMMUNICATION_ERROR): iCloud response invalid: null to UNINITIALIZED
2021-05-12 17:03:29.019 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
2021-05-12 17:03:33.731 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2021-05-12 17:03:35.258 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): iCloud response invalid: null
2021-05-12 17:54:55.632 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from OFFLINE (COMMUNICATION_ERROR): iCloud response invalid: null to UNINITIALIZED
2021-05-12 17:54:55.636 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
2021-05-12 17:55:52.721 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2021-05-12 17:55:54.434 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'icloud:account:233ffb50e9' changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): iCloud response invalid: null
HaKuNa
(Remo M)
May 13, 2021, 9:23am
4
I reinstalled the libs again and now the thing trigger is working too.
Ivan’s Updates to the Helper Libraries
I have decided to start maintaining my own fork of the openHAB Helper Libraries, at least for the time being, in light of the lack of activity in the original repo. There has been growing demand for OH3 support among other things, and I wanted to make that available in one place. In the event that the original maintainer returns, I will work with him to get these changes merged into the original repo.
I will be maintaining a change log detailing what has b…