Notifications not working in rules, but in scripts

Hi everyone,

I have switched to the latest OH version and recommended java version a while ago. Now I have a strange behaviour on DSL rules that have worked for ages so far.

Sometimes notifications don’t go out to the OH cloud. They aren’t visible in myopenhab.org and of course never reach the mobile app. When I take the EXACT same DSL code and paste it into a script in UI and run it - it works.

Even if I open the rule in UI and then open the inline script and push “run now” it does not send the inline notification while the same code copied to script works fine.

How can the very same code not trigger a notification within a rule, but do so as a script?

Everyhting else is working like a charm. And no… there is no log entry at all!

Thanks for any advice!

Add some logging to the beginning of the rule to determine whether the rule is running and the sending of the notification is failing, or if the rule is not running at all.

The rule is running fine because it executes everything else that’s in the rule. Even sends out an email notification if I add that as a backup. Just skips the OH notification.

It’s relevant for all my rules that contain notification. All of which have been running flawless unchanged for months if not years.

The error doesn’t always occur. Sometimes a notification makes it through. But mostly it doesn’t

The next step is to put the cloud connector binding into debug or trace level logging and post the logs covering when a notification fails to be sent.

I have set org.openhab.io.openhabcloud to TRACE but nothing shows up in the logs. Am I doing anything wrong?

How did you set it, through the UI, Karaf console, or by editing the log4j2.xml file?

That appears to be the correct logger.

Through UI and checked in karaf if logging level was set correctly

A restart of openhab has brought back the notification in DSL - for now. Yet, I don’t think this is a permanent fix. Will have to see if it comes back… I will update this post.