Execute Command on Log Entry

Moderator: leecollings

Post Reply
User avatar
Richie1972
Posts: 44
Joined: Saturday 09 April 2016 10:23
Target OS: Windows
Domoticz version:
Contact:

Execute Command on Log Entry

Post 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?
Richie

Aeo S5 USB
3 FGSD002 Smoke
1 FGSM Motion
4 FGBS Binary
1 Horstmann ASR-ZW
2 Aeo Relay
1 FGS222 2xRelay
2 Aeo Multi Gen4
2 Everspring relay
1 Aeo Repeater
1 Popp Switch
1 TKB socket
4 Popp Dimmer
User avatar
Egregius
Posts: 2589
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Execute Command on Log Entry

Post by Egregius »

What do you want to look for?
And what to do with it?
User avatar
Richie1972
Posts: 44
Joined: Saturday 09 April 2016 10:23
Target OS: Windows
Domoticz version:
Contact:

Re: Execute Command on Log Entry

Post 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
Richie

Aeo S5 USB
3 FGSD002 Smoke
1 FGSM Motion
4 FGBS Binary
1 Horstmann ASR-ZW
2 Aeo Relay
1 FGS222 2xRelay
2 Aeo Multi Gen4
2 Everspring relay
1 Aeo Repeater
1 Popp Switch
1 TKB socket
4 Popp Dimmer
User avatar
Egregius
Posts: 2589
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Execute Command on Log Entry

Post by Egregius »

Do you have data timeout active for your zwave stick? (hardware tab)
User avatar
Egregius
Posts: 2589
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Execute Command on Log Entry

Post by Egregius »

User avatar
Richie1972
Posts: 44
Joined: Saturday 09 April 2016 10:23
Target OS: Windows
Domoticz version:
Contact:

Re: Execute Command on Log Entry

Post 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
Richie

Aeo S5 USB
3 FGSD002 Smoke
1 FGSM Motion
4 FGBS Binary
1 Horstmann ASR-ZW
2 Aeo Relay
1 FGS222 2xRelay
2 Aeo Multi Gen4
2 Everspring relay
1 Aeo Repeater
1 Popp Switch
1 TKB socket
4 Popp Dimmer
User avatar
Richie1972
Posts: 44
Joined: Saturday 09 April 2016 10:23
Target OS: Windows
Domoticz version:
Contact:

Re: Execute Command on Log Entry

Post 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
Richie

Aeo S5 USB
3 FGSD002 Smoke
1 FGSM Motion
4 FGBS Binary
1 Horstmann ASR-ZW
2 Aeo Relay
1 FGS222 2xRelay
2 Aeo Multi Gen4
2 Everspring relay
1 Aeo Repeater
1 Popp Switch
1 TKB socket
4 Popp Dimmer
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest