mikebnz wrote:Here is a quick and dirty way to get Indigo to support the new Aeon MultiSensor 6.
Thanks for the inspiration!
I altered your code a slight bit to grab the variables no matter their value and put the code in a schedule to fire off every 15 minutes:
- Code: Select all
# Scan log for MultiSenor6 ZWave Updates
# Load into variables
# Uses regular expressions
import re
# Number of log entires to go back through and scan
lines = 500
# Custom variables to use
# ****** UPDATE THIS PART ******
humid = indigo.variables[104851327] # "ZWHumid"
lux = indigo.variables[96535918] # "ZWLux"
temp = indigo.variables[169923791] # "ZWTemp"
# *******************************
# Get the last xxx log entires
# indigo.server.log("MS6: Looking for Garage Sensor updates...")
logEntries = indigo.server.getEventLogList(lineCount=lines)
# Split by newline so we can process the array from newest message to oldest
log=logEntries.splitlines()
logs = len(log)
# This is the common text that comes back for the mulitsensor 6
# ****** UPDATE THIS TO MATCH YOUR DEVICE NAME *****
searchLine = 'received "Garage Sensor" sensor update to '
# **************************************************
# Look for Lux ---------------------
# Go backwards through log, newest to oldest
for logevent in reversed(log):
if re.search(searchLine + ".*lux", logevent):
lux = logevent.split(" ")[7]
indigo.server.log(" MS6: RegEx Lux found in eventLog: ["+lux+"]")
# Load into the custom variable ****** UPDATE THIS PART ******
indigo.variable.updateValue(96535918, value=lux)
# Stop looking, we have the newest update, we dont want older ones
break
for logevent in reversed(log):
if re.search(searchLine + ".*%", logevent):
humid = logevent.split(" ")[7] # [69:72]
indigo.server.log(" MS6: RegEx Humidity found in eventLog: ["+humid+"]")
indigo.variable.updateValue(104851327, value=humid) # "ZWHumid"
break
for logevent in reversed(log):
if re.search(searchLine + ".*F", logevent):
temp = logevent.split(" ")[7] # [69:73]
indigo.server.log(" MS6: RegEx Temperature found in eventLog: ["+temp+"]")
indigo.variable.updateValue(169923791, value=temp) # "ZWTemp"
break
I then added another schedule to look for motion updates and have this running every 15 seconds:
- Code: Select all
# Scan log for MultiSenor6 ZWave Updates
# Uses regular expressions
import re
# Number of log entires to go back through and scan
lines = 50
# Get the last xxx log entires
logEntries = indigo.server.getEventLogList(lineCount=lines)
# Split by newline so we can process the array from newest message to oldest
log=logEntries.splitlines()
logs = len(log)
# This is the common text that comes back for the mulitsensor 6
# ****** UPDATE THIS TO MATCH YOUR DEVICE NAME *****
searchLine = 'received "Garage Sensor" status update'
# **************************************************
# Go backwards through log, newest to oldest
for logevent in reversed(log):
if re.search(searchLine + ".*is on", logevent):
indigo.variable.updateValue(103272203, value="true")
# Stop looking, we have the newest update, we dont want older ones
break
if re.search(searchLine + ".*is off", logevent):
indigo.variable.updateValue(103272203, value="false")
break
It looks at fewer lines because we're looking so often and it changes a motion variable to true or false as appropriate.
Finally, I have a schedule looking for battery levels on the sensors running every hour:
- Code: Select all
# Scan log for MultiSenor6 ZWave Updates
# Uses regular expressions
import re
# Number of log entires to go back through and scan
lines = 500
# Get the last xxx log entires
logEntries = indigo.server.getEventLogList(lineCount=lines)
# Split by newline so we can process the array from newest message to oldest
log=logEntries.splitlines()
logs = len(log)
# This is the common text that comes back for the mulitsensor 6
# ****** UPDATE THIS TO MATCH YOUR DEVICE NAME *****
searchLine = 'received "002 - Garage Sensor" status update '
# **************************************************
# Go backwards through log, newest to oldest
for logevent in reversed(log):
if re.search(searchLine + ".*battery level", logevent):
battery = logevent.split(" ")[10]
battery = battery[:-1]
# indigo.server.log(" MS6: RegEx Battery found in eventLog: ["+battery+"]")
indigo.variable.updateValue(1197983521, value=battery)
# Stop looking, we have the newest update, we dont want older ones
break
This enters the percent value in a battery variable that I watch to mark the battery as low when it reaches a certain level.
Very hack-y, but it is sure better than NO multi sensor support!
Looking forward to official support because even though I enjoy writing hacks, I don't like my system running on them.
Rick