Polling Everspring ST814 (Temp/Humidity Sensor)
Posted: 24 Jan 2011 19:32
The ST814 can not answer multiple poll commands correctly. Its only allowed to send one GET and wait for the REPORT before the next getis sent. This means that only one single GET can be queued for the next wakeup. The work around is a slight change in the polling script:
# Sensor Polling. Work around the ST814 bug. Version 21.12.2010
import time, logging
devices = ZWaveAPI.devices
pollCCs = [0x30, 0x31, 0x32, 0x30, 0x25, 0x26] # sensorB, sensorML, Meter, switchB, switchML
skipNodes = [ZWaveAPI.controller.data.nodeId.value,255]
for nodeId in filter(lambda (x): x not in skipNodes and not devices[x].data.isFailed.value, devices.keys()):
for instanceId in filter(lambda (x): x > 0 or len(devices[nodeId].instances) == 1, devices[nodeId].instances.keys()):
i = devices[nodeId].instances[instanceId]
for ccId in filter(lambda (x): i.commandClasses.has_key(x), pollCCs):
if len(devices[nodeId].instances) == 1 or devices[nodeId].data.manufacturerId.value != 0x60:
i.commandClasses[ccId].Get()
else: # workaround for Everspring Multichannel Devices such as ST814
if not filter(lambda(job): job.buffer[4] == nodeId and job.buffer[10] == ccId, ZWaveAPI.queue):
if not devices[nodeId].data.has_key("oldInst"):
devices[nodeId].data.Add("oldInst")
devices[nodeId].data.oldInst.Update(instanceId)
if devices[nodeId].data.oldInst.value % (len(devices[nodeId].instances)-1) == (instanceId-1):
devices[nodeId].data.oldInst.Update(instanceId)
i.commandClasses[ccId].Get()
# Sensor Polling. Work around the ST814 bug. Version 21.12.2010
import time, logging
devices = ZWaveAPI.devices
pollCCs = [0x30, 0x31, 0x32, 0x30, 0x25, 0x26] # sensorB, sensorML, Meter, switchB, switchML
skipNodes = [ZWaveAPI.controller.data.nodeId.value,255]
for nodeId in filter(lambda (x): x not in skipNodes and not devices[x].data.isFailed.value, devices.keys()):
for instanceId in filter(lambda (x): x > 0 or len(devices[nodeId].instances) == 1, devices[nodeId].instances.keys()):
i = devices[nodeId].instances[instanceId]
for ccId in filter(lambda (x): i.commandClasses.has_key(x), pollCCs):
if len(devices[nodeId].instances) == 1 or devices[nodeId].data.manufacturerId.value != 0x60:
i.commandClasses[ccId].Get()
else: # workaround for Everspring Multichannel Devices such as ST814
if not filter(lambda(job): job.buffer[4] == nodeId and job.buffer[10] == ccId, ZWaveAPI.queue):
if not devices[nodeId].data.has_key("oldInst"):
devices[nodeId].data.Add("oldInst")
devices[nodeId].data.oldInst.Update(instanceId)
if devices[nodeId].data.oldInst.value % (len(devices[nodeId].instances)-1) == (instanceId-1):
devices[nodeId].data.oldInst.Update(instanceId)
i.commandClasses[ccId].Get()