The error:
- Code: Select all
Enabling plugin "WEL Data 1.0.0"
Starting plugin "WEL Data 1.0.0" (pid 562)
Started plugin "WEL Data 1.0.0"
WEL Data Error exception in deviceStartComm(Web Energy Logger): 'key returnDeltaT not found in dict'
- Code: Select all
"hotWaterTemp":'Water_Hot',"coldWaterTemp":'Water_Cold',"returnDeltaT":'AirRetDeltaT'
The XML output from the WEL:
- Code: Select all
<Devices>
<Device Name="Date" Value="09/24/2020"/>
<Device Name="Time" Value="15:52:29"/>
********* Snipped to save space
<Device Name="HP_ReturnDnT" Value="70.137489"/>
<Device Name="HP_ReturnUpT" Value="71.599998"/>
<Device Name="AirRetDeltaT" Value="1.480553"/>
<Device Name="Water_Hot" Value="100.399986"/>
<Device Name="Water_Cold" Value="75.537498"/>
</Devices>
The pertinent part of devices.xml from the plugin package:
- Code: Select all
<?xml version="1.0"?>
<Devices>
<!-- Define some devices -->
<Device type="custom" id="welData">
<Name>WEL Data</Name>
<ConfigUI>
</ConfigUI>
<States>
<State id="dataDate">
<ValueType>String</ValueType>
<TriggerLabel>Data Date</TriggerLabel>
<ControlPageLabel>Data Date</ControlPageLabel>
</State>
<State id="dataTime">
<ValueType>String</ValueType>
<TriggerLabel>Data Time</TriggerLabel>
<ControlPageLabel>Data Time</ControlPageLabel>
</State>
*******Snipped for brevity ***********
<State id="upstairsReturnTemp">
<ValueType>Number</ValueType>
<TriggerLabel>Upstairs Return Temp °F</TriggerLabel>
<ControlPageLabel>Upstairs Return Temp °F</ControlPageLabel>
</State>
<State id="downstairsReturnTemp">
<ValueType>Number</ValueType>
<TriggerLabel>Downstairs Return Temp °F</TriggerLabel>
<ControlPageLabel>Downstairs Return Temp °F</ControlPageLabel>
</State>
<State id="hotWaterTemp">
<ValueType>Number</ValueType>
<TriggerLabel>Hot Water Temp °F</TriggerLabel>
<ControlPageLabel>Hot Water Temp °F</ControlPageLabel>
</State>
<State id="coldWaterTemp">
<ValueType>Number</ValueType>
<TriggerLabel>Cold Water Temp °F</TriggerLabel>
<ControlPageLabel>Cold Water Temp °F</ControlPageLabel>
<State id="returnDeltaT">
<ValueType>Number</ValueType>
<TriggerLabel>Return Temp Difference °F</TriggerLabel>
<ControlPageLabel>Return Temp Difference °F</ControlPageLabel>
</State>
</State>
</States>
</Device>
</Devices>
The Global fields from plugin.py:
- Code: Select all
fields = {"dataDate":'Date',"dataTime":'Time',"TEST":'test',"propHeat":'PropHeating',"outdoorTemp":'OutdoorT',"stage2":'HP_ComprHi',"cooling":'HP_Cool1S',"heating":'HP_Heat1S',"defrost":'HP_Defrost',"vaporTemp":'HP_VaporT',"liquidTemp":'HP_LiquidT',"supplyTemp":'HP_SupplyT',"downstairsReturnTemp":'HP_ReturnDnT',"upstairsReturnTemp":'HP_ReturnUpT',"hotWaterTemp":'Water_Hot',"coldWaterTemp":'Water_Cold',"returnDeltaT":'AirRetDeltaT'}
The Device Update code from plugin.py:
- Code: Select all
def update(self,device):
self.debugLog("Updating device: " + device.name)
# download the file
try:
f = urllib2.urlopen(theUrl)
except urllib2.HTTPError, e:
self.errorLog("Error getting data: %s" % (device.pluginProps["address"], str(e)))
return
theXml = f.read()
theDocTree = parseString(theXml)
for node in theDocTree.getElementsByTagName("Device"):
for state,fieldName in fields.iteritems():
name = node.getAttribute("Name")
value = node.getAttribute("Value")
if name == fieldName:
newValue = value
if (fieldName == "OutdoorT")|(fieldName=="HP_VaporT")|(fieldName=="HP_LiquidT")|(fieldName=="HP_SupplyT")|(fieldName=="HP_ReturnDnT")|(fieldName=="HP_ReturnUpT")|(fieldName=="AirRetDeltaT")|(fieldName=="Water_Hot")|(fieldName=="Water_Cold"):
newValue = str(round(float(value),1))
if value == "0.000000":
newValue = "0"
if value == "1.000000":
newValue = "1"
self.updateDeviceState(device, state, newValue)
I've obviously made an error entering the three new devices/states, but I can't see any discrepancy among the various places the new name pairs appear, nor do I see any difference with the already added devices, which the plugin processes without a problem. Any help here would be appreciated!