OW-Server (EDS)

Hi

Newbie here so pleas be gentle

I though I would share my experience to date of emoncms, emonPi and an OW-Server I bought from Homechip (http://www.homechip.com/index.php/1-wire-controllers/masters/ow-server.html)

My objective was/is to monitor my electricity consumption, generation (PV), gas consumption and iSmart power diverter, the later by monitoring water temperatures in my storage tank.  I may look at trying to tease data out of the iSmart directly at some point.

I have 5 DS18B20 temperature sensors connected to the OW-Server, but will be adding more so I can monitor the central heating circuit as well as the hot water.

Setup of the emonPi was a doddle but unfortunately wifi signal from the Edimax USB wifi dongle just wasn't up to muster, so I ended up using a powerline Ethernet adapter temporarily, I'll run a cable at some point.

Not being a coder (but more of a hack and hope guy) the challenge was to get the data from the OW-Server, Nigel at Homechip was very helpful and provided a Python Script which did broadly what I needed but for another product that Homechip stock (their own RPI interface board  http://www.homechip.com/index.php/raspberry-pi.html)

Being stubborn I set about it my own way and came up with this ugly but functional code.  

The code is admittedly ugly, but functional and quite efficient, its called from crontab every 2 minutes, there is no error error checking as it can’t do any harm if it fails and it gets recalled often by crontab, rather than running all the time in the background.

I did have some issues working out urllib vs urllib2 in Python, especially developing on a windows PC with the host ultimately being the PI

  • I grab the details.xml file from the OW-Server
  • Discard the detail-reposnses
  • Scape the file for EUI/ROMIds and make a list of them
  • Query the PrimaryValue for the first EUI/ROMIds I found
  • Strip the ‘ Deg C’ from the end
  • Build a JSON url
  • Push the JSON url to emoncms
  • Wait 1 second
  • Move to the next EUI/ROMIds in the list unless the next EUI/ROMIds is NULL
  • If the last return was NULL exit

I could not get my head around using OWFS on a remote server, so binned that plan (and Nigel's code) and manipulated the XML file

I could not get the bulk.json commands to work so used separate post.json commands

I’ll have a play with OWFS when I have time/am less fractious  having had my daughter at home all day for the school holidays