EDS One Wire Server

Manage a 1-wire temperature sensor network.
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

EDS One Wire Server

Post by DaveL17 »

Hello - I use the EDS OW-Server Rev 2.

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.
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
User avatar
travisc
Posts: 346
Joined: Tue Sep 07, 2010 7:24 am
Location: Toronto, Canada
Contact:

Re: EDS One Wire Server

Post by travisc »

Hi,

Ya feel free to fork it and add support for that device. If it works out that the two setups can co-exist in the same plugin without too many compromises then we can certainly roll it into this plugin if that's something you're interested in.

I guess the code should be added to github or google code so it can be easily forked by others.
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: EDS One Wire Server

Post by DaveL17 »

Hi Travis, thanks.

I will see what I can accomplish, and will report the results here (unless it's too OT.)

Cheers,
Dave
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: EDS One Wire Server

Post by jay (support) »

travisc wrote:I guess the code should be added to github or google code so it can be easily forked by others.
Send us an email if you want to add it to our GitHub account. We can make sure you have full permissions on that repo.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: EDS One Wire Server

Post by DaveL17 »

I have been working on the EDS 1-Wire plugin, and have reached what I would call proof of concept. I am able to run the plugin reliably, and can put the temperature sensor values into variables. It has config elements for EDS server IP, centigrade or fahrenheit, and polling intervals. Next on the list is to include the capacity to create devices, events, and triggers. I am able to create devices now, but I'm still working on getting the sensor values to the devices.

It didn't wind up being much of a fork of your plugin Travis, since your's a wrapper around a binary. But I will say that deconstructing how it worked helped me to get cracking. So thanks for that.

With the next report, I'll start a different thread outside Travis' forum.
Dave
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
Post Reply

Return to “DigiTemp 1-Wire Temperature Plugin”