After upgrading vom 3.4.4 to OH4.0.1 my Rules which switch off my chargerplugs are all the time running. The will not go anymore in the “idle” mode. In principale they work, but all of them are in “running-mode” and not more in “idle-mode”
When the rule gets triggered, it will wait for 20 seconds before doing anything. The rule is running.
After that, when power is low and on, wait for another 5 seconds before switching off.
Power will go low when doing that, so the rule is triggered again, with another 20 seconds wait.
So total cycle is 45 seconds running.
You should try do change this to use timers instead.
Apart from that, what is the item type of Jochen_Zimmer_Steckdose_Power? If it is a Number, you should not be comparing to a string value anymore. OH 4.0.1 is more strict in its types. Also, is the item a pure Number, or a Number with a dimension, in which case you should compare against a QuantityType.
BUT I’m not a developer and have now idea what you mean with “use timers instead”.
The 20 sec at the begin are need, that “everything comes up and is charging”, without it would switch off directly.
Instead of wait, use the after... block. It will not block the thread, just execute what is inside the block after the delay. wait should only be used for short delays.
You do not need to cancel the timer inside the timer block. It will automatically get removed.
If you still want to have the 10 second delay if the condition is met, you can do that with a second nested timer with a different name.