My Insteon Error Catch Solution.
For each problematic Insteon device, I’ve created some triggers to help them out.
For each device I’ve created a variable and 2 triggers:
Variable: ErrorCatchDevice_Name
1st Trigger:
Name: Error Catch - Device_Name Off
Type: SQL Logger Event
Event: Error in Event Log
Errors to monitor for: Internal Indigo Errors
Sting to match: Device_Name(.*)no ack
Condition: Always
Actions:
- turn off “Device_Name”; delay 00:05:00
Modify Variable ErrorCatchDevice_Name, Increment by 1
2nd Trigger:
Name: Error Catch - Device_Name Off 5th time
Type: SQL Logger Event
Event: Error in Event Log
Errors to monitor for: Internal Indigo Errors
Sting to match: Device_Name(.*)no ack
Condition: if variable ErrorCatchDevice_Name is greater than value 4
Actions:
- set variable ErrorCatchDevice_Name to 0
Send pushover notification: Title: Error Catch Message: Device_Name Off, 6th Attempt.
Turn off “Device_Name”; delay 00:05:00
Finally, I have another trigger that writes my no acknowledgment errors to a CSV file in dropbox so I can review it every now and then to see what’s acting up in my system…..
Name: Error Catch DropBox Log No Acknowledge Events
Type: SQL Logger Event
Event: Error in Event Log
Errors to monitor for: Internal Indigo Errors
Sting to match: (.*)no ack
Condition: Always
Action: Execute Script, Embedded Python
- Code: Select all
logList = indigo.server.getEventLogList(lineCount=3)
import datetime
import os.path
from os import system
csvFilePath = "/Users/williammoore/Dropbox/Indigo/Error Catch.csv"
csvHeaders = "3 Lines Captured from Error no Ack" + "\n"
THIS_SCRIPT = 'Error Catch Log'
TIME = '{date:%Y-%m-%d_%H:%M.%S}'.format(date=datetime.datetime.now())
# Check and see if the file exists. If not, create and write the headers.
if not os.path.isfile(csvFilePath):
csvFile = open(csvFilePath, "a")
csvFile.write(csvHeaders)
# Write new values to the file.
csvFile = open(csvFilePath, "a")
element = logList + "\n"
csvFile.write(element)
# Close the file.
csvFile.close()