Hello,
I'm having probems with a rule that send a notification via my.openhab. This is the rule:
rule "check_batteries"
when Time cron "0 0 5 * * ?"
then
logInfo("FILE", "check_batteries BEGIN")
if (! G_baterias.allMembers.filter([state < batteryThreshold.state]).empty) {
val report = G_baterias.allMembers.filter([state < batteryThreshold.state]).sortBy([state]).map[
name + ": " + state.format("%d%%")
].join("\n")
val message = "Pilas con carga por debajo de " + batteryThreshold.state + ":\n\n" + report + "\n\nRegards,\n\nopenHab"
logInfo("FILE", "check_batteries: " + message)
sendNotification(emailTo, report)
}
logInfo("FILE", "check_batteries END")
end
If I use sendMail to send an email instead of a my.openhab notification, the email is sent without any problem. With the sendNotification if fails most of the time. In my log file I get:
2016-03-21 05:00:00.033 [INFO ] [org.openhab.model.script.FILE ] - check_batteries BEGIN
2016-03-21 05:00:00.174 [INFO ] [org.openhab.model.script.FILE ] - check_batteries: Pilas con carga por debajo de 30.0:
scs317_bateria: 21%
Regards,
openHab
2016-03-21 05:00:00.192 [INFO ] [org.openhab.model.script.FILE ] - check_batteries END
2016-03-21 05:00:02.785 [ERROR] [.myopenhab.internal.MyOHClient] - Socket.IO error: io.socket.engineio.client.EngineIOException: websocket error
2016-03-21 05:00:02.793 [INFO ] [.myopenhab.internal.MyOHClient] - Disconnected from my.openHAB service (UUID = 2d904de4-4a11-4950-8c63-2efa775c3cd5, local base URL = http://localhost:8000)
2016-03-21 05:00:25.739 [INFO ] [.myopenhab.internal.MyOHClient] - Connected to my.openHAB service (UUID = 2d904de4-4a11-4950-8c63-2efa775c3cd5, local base URL = http://localhost:8000)
Any help?