Hi,
is it possible to make a rule which reacts on a specific error entry in the pimatic log?
When error "bla blupp" occurs then do some stuff
Trigger rule with error in log
Hi,
is it possible to make a rule which reacts on a specific error entry in the pimatic log?
When error "bla blupp" occurs then do some stuff
Hey @ortin,
Check pimatic-logreader. If you set it up to tail pimatic-daemon.log it will probably do what you want and maybe some more
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins
Yes, that was as well my idea, but had a small hope to get it on a simpler way…
@ortin I think it can only be made as simple as you describe if a plugin providing and handling a predicate would be developed. Something might be said to make this core Pimatic functionality, but I’d rather leave it up to @mwittig and @leader21 to decide upon if and when this would be implemented.
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins
Nice idea indeed. I did something similar with the logreader. In parse the daemon log and show the error messages in a text frame. Sure you can grep every error you like and take some action then.
Could be an interesting idea for a plugin imho…
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
@leader21 Just quickly reviewed the log-reader code and although not very explicitly clear in the plugin description, it allows for Javascript Regex to be used for pattern matching (see snippet below). The difference @OrtiN suggests, is to be able to provide the pattern as part of the predicate instead of the device config. This should be achievable as added functionality in log-reader I think. Don’t mind forking log-reader and having a stab. Before I do, I’d also like to ask @mwittig if he has any thoughts on the topic.
for line in @config.lines
# for a match.
matches = new RegExp(line.match).exec(data)
if matches?
# If a match occures then emit a "match"-event.
@emit 'match', line, data, matches
return
"Screw the captain. It's the engineer running the ship!"
pimatic-telegram, pimatic-tts, pimatic-woox, pimatic-lg-smart-tv, pimatic-spotify, pimatic-wakeuplight and some not-announced plugins