I have been using OH for over a year now and I am very happy with how things work. However, since upgrading to OH 4, my rules will not trigger any more. Specifically, the ones coupled to Eltako Enocean Door Sensors (Thing: enocean:mechanicalHandle:xyzxyzxyzxyz via EnOcean USB300 bridge).
The door sensors work fine- I can see the open/close state in Openhab and I can also see historic data for each event. I am using the following rule and a script to trigger a WhatsApp Message if the door is opened while a virtual switch “Alarmanlage” is on.
Since the update, even if the switch is on, no message is sent. The rule will either not trigger (unlikely, given that the door sensor correctly transmits its state) or the script will not run.
I have already checked the messaging service I use and the https-command will send a WhatsApp message correctly. If I dry-run the rule in OH, it will also not work.
Please, whenever possible, don’t paste pictuers but code (and of course mark it as code).
There is a special view “Code” for each rule.
Do you see any updates (and especially changed events) for the given item?
Please take a closer look at the channel. Is it still the same type as in openHAB3? Maybe the Type changed, maybe now it’s a Trigger Channel and you can’t link it to an Item any longer but have to use Channel xyz triggered OPEN or something similar.
Uh, sorry about the code. But it is just a short fragment and probably not something anybody needs to copy.
I am not sure what you mean by “updates for the given item”. The door sensor channel is listed as a “contact” item and looks just as it was before OH4 in the items list and the model. It does record “open” events correctly and they are displayed in the OH BasicUI dashboard. In the item view, it also correctly shows “open” or “closed” when the door is moved.
It does, however, not send out updates via the Apple HomeKit metadata.
Can it be an issue with the new Java version in OH4? The script uses org.openhab.core.io.net.http.HttpUtil
Your rule provides absolutely no logging (as best as one can tell on a phone looking at the screenshot, I’ll reiterate @Udo_Hartmann’s request, screen shots are next to worthless to us).
Add logging to the script. I believe executeURL returns something when the command is done. So log that out.
Add a log to the top of the rule that always runs so you know when the script starts executing.
Thank you for the replies. I must admit, that I am under some time pressure to get the notifications for item events to work again and do not have time to log and debug right now . I was somehow hoping for an easy solution to my problem with the script, but I understand that things are almost never simple . So I played around a bit with the push notification feature in the rules, and I think I can omit the script completely. This is not a fix but a workaround. However, it works for me for now…
I’ll report back when I have found time to fix the original notification script.