It would be Nice to use errors and warning messages in rules, so you can send them with pushbullet or to your email. Now you only know that something is wrong by looking at the gui.
-
[workaround]Rules with log messages
-
@sweebee That’s a nice idea. May be you can ellaborate on this a little bit. Do you have in mind how an condition expression should look like? Does it require some entity (variable or device) to represent the log last message?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
The easiest way would be a device with 3 attributes. 1: sender (pimatic, homeduino, mysensors) 2: type (warning, error) 3: message (error polling x)
This device shows the last message.
So for a rule:
If $log.message is updated and $log.type is "error" then push title: "$log.type $log.sender" message: "$log.message"
-
Used pimatic logreader, atleast i can send myself a message. still have to figure out how to get the full message sent.
Now i can use as rules:
if log warning or log error then ....
device:
{ "id": "log", "name": "Log", "class": "LogWatcher", "file": "/home/pi/pimatic-app/pimatic-daemon.log", "attributes": [], "lines": [ { "match": "error:", "predicate": "log error" }, { "match": "warning:", "predicate": "log warning" } ] },
-
Trying to catch the messages but no luck.
{ "id": "debug", "name": "Debug", "class": "LogWatcher", "file": "/home/pi/pimatic-app/pimatic-daemon.log", "attributes": [ { "name": "error", "type": "string" } ], "lines": [ { "match": "error:", "error": "$1" } ] }
@leader21 your an expert on this, you know what to do?
-
I’ll have a look at this.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
i tested this setup :
{ "id": "debug", "name": "Debug", "class": "LogWatcher", "file": "/home/pi/pimatic-app/pimatic-daemon.log", "attributes": [ { "name": "error", "type": "string" }, { "name": "warning", "type": "string" }, ], "lines": [ { "match": "error:(.+)", "error": "$1" }, { "match": "warning:(.+)", "warning": "$1" }, ] },
for me it works - BUT - debug messages that contain error: false like at the max plugin will be shown also!!
anyhow, give it a try and report if it works for you.
maybe you can check your log in an editor forerror:
if there are messages that are not related to an “real” error we should try to alter the match accordingly.pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
@leader21 yes okay, for me not a problem since i only enable debug when i’m testing, normally i have debug disabled by default.
But what if we set it to:
"match": "] error:(.+)",
Works, thanks!
-
good to hear! so that’s a nice and easy workaround
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !