Page 1 of 1

Execute Command on Log Entry

Posted: Monday 22 August 2016 22:10
by Richie1972
I've had a quick look and can't see if this has been asked before.
What I want is to be able to execute a script if a particular event is flagged in the log - so, is there a way of monitoring new log entries and executing a script/command if a specific phrase/error appears?

Re: Execute Command on Log Entry

Posted: Monday 22 August 2016 22:52
by Egregius
What do you want to look for?
And what to do with it?

Re: Execute Command on Log Entry

Posted: Monday 22 August 2016 22:59
by Richie1972
Every so often the OpenZWave driver fails, so i need to stop Domoticz, disconnect the Aeotec USB, reconnect it and restart Domoticz.
At the moment i am not alerted to this, so would, initially, like to have an alert/email sent and, long term, automate the stop, disconnect, re-connect & restart process

Re: Execute Command on Log Entry

Posted: Tuesday 23 August 2016 6:18
by Egregius
Do you have data timeout active for your zwave stick? (hardware tab)

Re: Execute Command on Log Entry

Posted: Tuesday 23 August 2016 6:20
by Egregius

Re: Execute Command on Log Entry

Posted: Tuesday 23 August 2016 10:32
by Richie1972
Yes I have the time out set for thirty minutes. However, when I get the driver failure the only recovery is to disconnect and reconnect the usb controller - it just repeats the driver failure otherwise

Re: Execute Command on Log Entry

Posted: Tuesday 23 August 2016 10:36
by Richie1972
With regard to the link in your other message.
I can write a vbscript or even .net console app to read the file - it is just going to be difficult to check for new instances of the error.
I was hoping that there would be a way to do it in Lua similar to any other events like a switch being operated