varamfer / openhab

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

Onewire binding does not work with onewire hub - easy fix #94

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The Onewire binding forces very strict syntax on the Onewire sensor id:s. This 
causes the Onewire binding to not support Onewire hubs (and hubs are a must to 
build larger Onewire installations). 

The fix is easy! The checkSensorId method in 
org.openhab.binding.onewire.internal.OneWireGenericBindingProvider currently 
has a regexp which only allows sensor id:s such as "10.778413020800". The 
regexp should be updated to allow sensor id:s such as:

1F.905F05000000/main/10.778413020800
1F.905F05000000/aux/28.4887D6020000

and their uncached equivalents such as:

uncached/1F.905F05000000/main/10.778413020800
uncached/1F.905F05000000/aux/28.4887D6020000

I'm no regexp expert so for my tests I just modified checkSensorId to return 
true, and then the Onewire binding works fine with all my hub-connected sensors 
(temp, humidity, A/D converter, counter etc.)

Original issue reported on code.google.com by henrik.sjostrand on 2 Aug 2012 at 8:01

GoogleCodeExporter commented 8 years ago

Original comment by kai.openhab on 2 Aug 2012 at 12:22

GoogleCodeExporter commented 8 years ago
Hi Henrik, good to know that somebody else than me are using the 
onewire-binding ;-)

I removed the regex completely which gives you all the flexibility you need. 
OwServer will complain loud enough if the ID isn't correct.

So many thanks for this error report!

Original comment by teichsta on 2 Aug 2012 at 12:37