OneWire2 binding - missing support for DS1923 and DS1420

Current implementation of OneWire binding in version 2 does not support two sensors

  • DS1420 - this id ID chip used in USB to OneWire adapter. It should report only present state. Family id is 81
  • DS1923 - iButton sensor for reading temperature and humidity. It should fit into multisensor category ms-th. Family id is 41.

I can help with testing it.

I have done initial attempt to add this support. I have added to OwBindingConstants.java

        initThingTypeMap.put(OwSensorType.DS1420, THING_TYPE_IBUTTON);
        initThingTypeMap.put(OwSensorType.DS1923, THING_TYPE_MS_TH);

and to OwSensorType.java

    DS1420,
    DS1923,

After upload of the recompiled binding to \\openhabserver\openHAB-share\openhab2-addons\ I got readings for humidity and temperature, however I got also some strange errors

2018-09-28 22:16:47.655 [ERROR] [rg.eclipse.smarthome.binding.onewire] - bundle org.eclipse.smarthome.binding.onewire:0.10.0.201809281925 (219)[binding.onewire] :  Cannot register component
org.osgi.service.component.ComponentException: The component name 'binding.onewire' has already been registered by Bundle 219 (org.eclipse.smarthome.binding.onewire) as Component of Class org.eclipse.smarthome.binding.onewire.internal.OwHandlerFactory

and later after reading values for the first time

2018-09-28 22:16:54.425 [hingStatusInfoChangedEvent] - 'onewire:ms-th:nexx:basement2' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): refresh exception
2018-09-28 22:16:59.427 [hingStatusInfoChangedEvent] - 'onewire:ms-th:nexx:basement2' changed from OFFLINE (COMMUNICATION_ERROR): refresh exception to ONLINE
2018-09-28 22:17:02.451 [hingStatusInfoChangedEvent] - 'onewire:ms-th:nexx:basement2' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): refresh exception
2018-09-28 22:17:09.463 [hingStatusInfoChangedEvent] - 'onewire:ms-th:nexx:basement2' changed from OFFLINE (COMMUNICATION_ERROR): refresh exception to ONLINE
2018-09-28 22:17:14.191 [hingStatusInfoChangedEvent] - 'onewire:ms-th:nexx:basement2' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): refresh exception
... and so on

Is it problem with conflict with the original binding or something more is needed in the binding itself?

Open source means you can do it by yourself, so I did. I have added support for those 2 sensors plus fixed some issues. PR should be ready this weekend.

@J-N-K, please review.

I have seen these error messages before and never could find out why. Usually they disappear after cleaning the cache and restarting OH.