I have been reading these sensors with a Vera plugin and am just now moving them over to be handled "natively" within Indigo. I presumed that the DigiTemp plugin wouldn't read the EDS data, and so have started to try to figure out how to get at the sensor data by parsing XML that is served from the EDS server.
Update: most current version...
- Code: Select all
#!/usr/bin/env python2.5
# -- coding: utf-8 --
"""
EDS 1wire Server.py
Method: SimonHA
http://www.navitron.org.uk/forum/index.php?PHPSESSID=49fdbed74c0ad7f1763b8959accc79f5&topic=10951.msg228595#msg228595
This script looks for a running EDS 1-Wire Server on the specified IP and parses the
details.xml file for enumerated sensors. When new sensors are added the script must be
edited manually to include the new sensors.
"""
indigo.server.log("Polling 1-Wire sensors....")
import urllib2
import xml.etree.ElementTree as etree
def degSym(val):
# Converts value to a whole number string and appends the degree symbol.
val = float(val)
val = int(val)
val = str(val) + "°"
return val
f = urllib2.urlopen('http://<OW-SERVER-IP>/details.xml')
root = etree.fromstring(f.read())
for tempSensor in root.findall('./{http://www.embeddeddatasystems.com/schema/owserver}owd_DS18B20'):
romID = tempSensor.find('{http://www.embeddeddatasystems.com/schema/owserver}ROMId').text
health = tempSensor.find('{http://www.embeddeddatasystems.com/schema/owserver}Health').text
channel = tempSensor.find('{http://www.embeddeddatasystems.com/schema/owserver}Channel').text
temp_c = tempSensor.find('{http://www.embeddeddatasystems.com/schema/owserver}Temperature').text
# Convert deg C to deg F
temp_f = float(temp_c) * 1.8000 + 32.00
temp_f = ("%.2f" % temp_f)
temp_f_d = degSym(temp_f)
if romID == "5D000003C74F4528": # Basement
indigo.server.log("Basement:")
indigo.server.log(" ID: " + romID)
indigo.server.log(" Temperature: " + temp_f)
indigo.server.log(" Channel: " + channel)
indigo.server.log(" Health: " + health)
indigo.variable.updateValue(317778779, temp_f)
indigo.variable.updateValue(15164509, temp_f_d)
elif romID == "9D000004DC860328": # Main Attic
indigo.server.log("Main Attic:")
indigo.server.log(" ID: " + romID)
indigo.server.log(" Temperature: " + temp_f)
indigo.server.log(" Channel: " + channel)
indigo.server.log(" Health: " + health)
indigo.variable.updateValue(1761230880, temp_f)
indigo.variable.updateValue(132185490, temp_f_d)
else:
indigo.server.log(" ID: " + romID)
indigo.server.log(" Temperature: " + temp_f)
indigo.server.log(" Channel: " + channel)
indigo.server.log(" Health: " + health)
indigo.server.log("New sensor added to network. Modify script and add variable to Indigo.")
f.close()
It's more of a proof of concept at this point than anything else, but it does seem to work pretty stably. Based on the manual, it's also possible to get at the data through an http:// GET. Not sure which method would be better...
Would be interested in hearing whether this is something that could be a fork of the DigiTemp plugin (and whether you would be okay with that) or incorporated directly.