hektiker1983 / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

Implement/Enhance binding for OW-SERVER from EDS #381

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be great to get and set values of 1-wire-devices via an OW-SERVER from 
EDS.
http://www.embeddeddatasystems.com

There are several interfaces to connect to (see manual):
• HTTP—service provides delivery of html and xml data files via http get 
command, and 
firmware upload via http post
• SNMP—provides access to data from all connected sensors, and pushes SNMP 
traps to 
remote listeners for alarming capabilities
• Telnet—service provides ability to monitor the internal activities of the 
OW-SERVERENET-2 for diagnostic purposes
• 1-Wire Interface—service provides a TCP client that implements a 
command/response 
low level interface that may be used to directly control the 1-Wire bus
• POST Client—provides a method of pushing XML data about connected 1-Wire 
devices 
to a server; ideal for circumventing firewall issues

I think the 1-wire-TCP-interface is the way to go.
See manual:
http://www.embeddeddatasystems.com/OW-SERVER-1-Wire-to-Ethernet-Server-Revision-
2_p_152.html

There are some workarounds already.
- 
https://code.google.com/p/openhab-samples/wiki/BindingConfig#How_to_get_temperat
ures_from_OW-SERVER_via_HTTP_binding
- use an owfs-server as proxy (www.owfs.org)

Original issue reported on code.google.com by christop...@gmail.com on 16 Jul 2013 at 1:42

GoogleCodeExporter commented 8 years ago
Better rename the title to "OW-SERVER from EDS" to avoid confusion with the 
linux program "owserver" from the owfs-project.

Original comment by christop...@gmail.com on 16 Jul 2013 at 1:49

GoogleCodeExporter commented 8 years ago
done

Original comment by teichsta on 16 Jul 2013 at 1:50

GoogleCodeExporter commented 8 years ago
There is also open source java code available to read/write data from/to the 
device.

Original comment by christop...@gmail.com on 16 Jul 2013 at 1:59

GoogleCodeExporter commented 8 years ago
which one? could you please refer to it?

Original comment by teichsta on 16 Jul 2013 at 6:32

GoogleCodeExporter commented 8 years ago
There are some examples in the KnowlageBase.
https://eds.zendesk.com/forums/348798-OW-SERVER-and-HA7Net

https://eds.zendesk.com/entries/23608632-Reading-XML-Data-from-a-OW-SERVER-using
-Java
https://eds.zendesk.com/entries/23608762-Writing-to-1-Wire-Sensors-with-a-OW-SER
VER-using-Java

btw:
I just realized you can only use up to 24 devices via HTML/XML and SNMP.

Using the Low-Level-Interface more devices are supported.
But I don't know how difficult it would be to implement.

Original comment by christop...@gmail.com on 28 Jul 2013 at 12:02

GoogleCodeExporter commented 8 years ago
I wrote a plugin for another HA system quite a while ago and now have a working 
binding now on OH. Just needs a bit more testing...
I think 24 devices is actually quite a lot - you might find problems with bus 
impedance if you have more. Using the low level interface is a lot more work.

Original comment by ch...@cd-jackson.com on 31 Jul 2013 at 6:13

GoogleCodeExporter commented 8 years ago
Attached is a first cut at a binding for the EDS OW-Server.
To use, put the bundle in the addon directory as normal. Note that this will 
likely only work with OpenHAB 1.3!
In the openhab.cfg file, there needs to be some "owserver" configuration. There 
are currently 3 settings that can be changed -:
owserver:timeout - sets the timeout (in milliseconds) to wait while 
communicating with the OWSERVER. Defaults to 5000ms
owserver:granularity - sets the period (in milliseconds) between each update 
check. Defaults to 1000ms
owserver:cache - sets the cache timer (in milliseconds). Defaults to 2500ms.

The binding implements a short term cache to avoid downloading the XML file for 
every Item (which would result in a LOT of network traffic). If items are 
updated within the "cache" time since the last retrieval of the XML data, then 
it uses the cached version, otherwise the XML file is downloaded again, and the 
cache updated.

Bindings take the following format -:
{ owserver="<192.168.2.202:0D0010000021AF7E:Humidity:10000" }

The first part is the address of the OWServer.
Second part is the ROMId of the sensor.
Third part is the sensor name. You can use any variable returned in the XML 
file (Temperature, Humidity, Health, etc).
The last part is the update rate (in milliseconds). I probably should make this 
optional. There's probably also a case for simply making this global for all 
bindings, but I think this is more flexible to account for different types of 
sensors.

Currently this only supports IN-Bindings.

Original comment by ch...@cd-jackson.com on 1 Aug 2013 at 10:03

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Chris, good news. Does your developer clone reflect the current state of the 
code? Regards, Thomas E.-E.

Original comment by teichsta on 1 Aug 2013 at 11:01

GoogleCodeExporter commented 8 years ago
No - I haven't yet pushed the OWSERVER binding - just the SNMP changes I made. 
I'll do this tonight.

Original comment by ch...@cd-jackson.com on 1 Aug 2013 at 11:18

GoogleCodeExporter commented 8 years ago

Original comment by teichsta on 13 Aug 2013 at 8:09

GoogleCodeExporter commented 8 years ago
Hi Chris,

many thanks for this contribution. Please find below my review comments:

# OWServerBindingProvider
* javadoc is missing for getName(), getAddress() and getRomId()

# OWServerGenericBindingProvider
* javadoc on classlevel is wrong. It does not parse OWServer XML file but 
*.items files
* the ip address of the owserver should be configured in openhab.cfg rather 
than in the *item-config (see onkyo-, mpd binding for examples how to handle 
multiple host configurations

# OWServerBinding
* L109 setProperlyConfigured() should not be set without the knowledge if this 
binding is properly configured ;-) Better call this method at the end of 
update()
* L133-134, 145-146, 148-149 please remove TODO and printStackTrace() and use 
proper logging instead

# openhab_default.cfg
* please add an owserver section explaining the parameters 'timeout', 
'granularity' and 'cache'

Best, 

Thomas E.-E.

Original comment by teichsta on 18 Aug 2013 at 8:55

GoogleCodeExporter commented 8 years ago
Thanks for the review - hopefully I've implemented all your comments :)

I haven't added the server config to the openhab_default.cfg. The format is as 
per the Onkyo binding you referenced -:
owserver.name.host=address
where "name" can be any name.
The binding string then changes to -:
{ owserver="<name:0D0010000021AF7E:Humidity:10000" }

"name" is case dependant!
Multiple OWServers can be supported in this way.

Original comment by ch...@cd-jackson.com on 19 Aug 2013 at 4:35

GoogleCodeExporter commented 8 years ago
Hi Chris,

thanks for incorporating most of the review comments. I merged the code to 
default branch (see 
http://code.google.com/p/openhab/source/detail?r=a8d11a0656d12a848e009598461258b
50849fe1f). For better understanding i renamed the 'address' variable to 
'serverId'. I hope you don't mind.

Best,

Thomas E.-E.

Original comment by teichsta on 20 Aug 2013 at 9:22

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Great work! I'm new to openHAB and have a couple of ENET-OWSERVER-ENET-2 boxes 
so this is just what I was after! How do we update the bindings wiki? (I don't 
mind doing it if someone gives me permission).

Original comment by Sim...@veriton.co.uk on 9 Sep 2013 at 9:09

GoogleCodeExporter commented 8 years ago
Permission to edit the wiki granted :-)

Original comment by kai.openhab on 11 Sep 2013 at 5:04