If my theory is right it would only not work for a minute or so after a restart of OH which is what it sounded like was going on based on your original description.
If it is not working for many minutes or hours after a restart then that isn’t the problem and I’ve no idea what it is.
OH2 will not ignore a rule after an error. In fact, if the same error is persisting then you should see the same error in the log file every time the rule triggers.
In the past all rules with notifications worked perfectly. I didn’t change anything (just updating OH2 to the newest build from time to time). I can’t figure out the point that behavior changed.
Always, after restarting OH2 i manuell have to reload all rule-files with notifications in it. Without this the rules are not working - never! Strange if i’am the only with this problem.
Hi,
Same problem here with OH2b4 build 477. Java version is 1.8.0_101. Any solution besides reloading the rules?
Also, in SmartHome Designer, I’m getting the warning "The method sendNotification(String, String) is undefined. How can I fix this?
Regards.
SmartHome Designer is a little broken right now. Depending on when you downloaded it it is more or less broken. For example, mine will not recognize any Items, actions, or Joda classes. The rules run fine though. There are issues already submitted so it should get fixed but I wouldn’t spend too much time worrying about it until they get fixed.
Ok, this issue is not important, I can live with it
But, any idea about why sendNotification doesn’t work until rules are reloaded?
By the way, @Kai, I think this is the first time I talk to you: thank you very much for all your work, openHAB is awesome!!!
doenst the issue just say it does not work in the designer?
currently its not working in OH2 … it throws errors on execution … it did work until something like 10 days or so? it stopped with one the latest builds
I have just upgraded from OpenHab 2b4 to latest snapshot today. And I was getting notifications just before the upgrade, and nothing after. Sendmail is working in rules, and access via myOpenhab.org is working.
I am checking the logs, but don’t seem to be getting an exception. The only thing I see is:
2016-10-29 15:50:48.970 [WARN ] [o.myopenhab.internal.MyOpenHABClient] - Jetty request 5111 failed: null
but that doesn’t coincide with when a notification should be sent.
This is my rule:
rule “Back Roboguard Triggered"
when
Item Roboguard_Back received update OPEN
then
if (Roboguard_Notification.state == ON) {
sendNotification("myemail@emailco.com”, “Back Roboguard triggered”)
}
end
Hi, I have updated from OH2 B3 to OH2 Build #560 (past B4).
Notifications did not work in any of the two versions
I have made a base installation, without any bindings or extra things. Just the necesary for notifications to work.
The rule is triggered and no error is logged, but notifications are not send and not even logged at my.openhab.com.
Can you provide the command so as to increase verbosity of notifications module or myopenhab module. Thanks
Regards.
Hi @Kai,
No exception is thrown. We’re getting this error:
2016-11-03 13:05:47.579 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Some rule': An error occured during the script execution: The name 'sendNotification(<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type.
If you force the reloading of the rules by editing the file, notifications start to work.
Regards.
Ok, I think I managed to resolve this issue. My guess is that it is due to the fact that the myopenhab bundle is loaded last and thus the rule parser does not know about its sendNotification action.