Onewire on rpi with openhab2 will not work

I am running Openhab2 on a RPI with OWFS installed as well. I have attached a 1wire temperature sensor via a USB 1wire adapter to the RPI. The temperature can be read by access the sensor on mnt/1wire/. I have attached the Onewire binding but I do not get the temperature sensor in the openhab2 inbox. In the binding configuration I have tried to use different options for the OWserver IP adress (localhost/ IP) but I never get the sensor in the inbox. I have tried to use the 4304 port and to omit the port number as well. How do I get openhab2 to access the 1wire temperature sensor?

The onewire binding is an openhab 1.x binding and doesn’t support the inbox or auto-discovery. You’ll have to manually add it to your items file. For example:

Number  Temp_BR_Nightstand    "Nightstand Temp [%.1f °F]"    <temperature>   (Temp_Bedroom)       { onewire="deviceId=28.A8DFBD030000;propertyName=temperature;refreshinterval=600" }
Number  Temp_BR_Window    "BR Window Temp [%.1f °F]"    <temperature>   (Temp_Bedroom)         { onewire="deviceId=28.23756B020000;propertyName=temperature;refreshinterval=600" }
Number  Lux_LR_Server_Raw    "Light RAW [%.2f V]" { onewire="deviceId=26.1C84E1010000;propertyName=VAD;refreshinterval=300" }

If the binding is throwing errors about the hostname being null, you might need to grab the latest snapshot from cloudbees.

1 Like

I have created an “onewire.items” file in etc/openhab2/items/ with the tempsensor as in your example. I can not find the item in the PAPER UI. Where should the onewire sensor appear? Have I located the item file in the wrong loacation? How is the link established to the sensors at mnt/1wire/? Sorry for all the questions but I have just started to use Openhab and Linux.

OH talks to owserver, not OneWire filesystem.

  1. install owserver (you should have it already)
  2. install onewire1 binding
  3. edit services/onewire.cfg and put the address of the host running owserver like ip=
  4. configure your item(s) as shown earlier

check the log (I have owserver running on another host):

[INFO ] [nternal.connection.OneWireConnection] - Connected to owserver [IP ‘rpi.lan’ Port ‘4304’]

I have now installed the owserver (it was never installed, just owfs). I can now see that the temperature is updated in the events.log. But how do I access the sensor in Openhab2? I can not find it in the Paper UI. Do I have to add it manually some how?

yes, as it was suggested earlier:

You’ll have to manually add it to your items file.

Thank you Andrew!
I did not realise that I need to use the BasicUI to access the onewire devices. When I manually created a sitemap for the Basic UI (not Paper UI) the onewire devices appeared.

Where do i have to create those files ?
My directory is openhabian@openHABianPi:~$.
In the Manual is written : Through text .items files located in the $OPENHAB_CONF/items folder.
This folder does’nt exist.

What is wrong ?