EDS One Wire Server

Posted on
Mon Dec 30, 2013 10:44 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

EDS One Wire Server

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] - [My Forums]

Posted on
Tue Dec 31, 2013 11:58 am
travisc offline
User avatar
Posts: 346
Joined: Sep 07, 2010
Location: Toronto, Canada

Re: EDS One Wire Server

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.

Posted on
Tue Dec 31, 2013 3:35 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: EDS One Wire Server

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] - [My Forums]

Posted on
Tue Dec 31, 2013 4:27 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: EDS One Wire Server

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

Posted on
Wed Jan 29, 2014 7:55 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: EDS One Wire Server

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] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests

cron