One-Wire Binding setup in openHAB2- newbi mistake?

Hi,

First, thanks to all for a great community, I’ve spent many hours reading the very informative post! Not much of programmer but can make my way with the examples provided but is now a bit stuck with the One-Wire binding in openHAB 2.3.

Running currently a fairly small OH2 network with only Z-wave things for the lights. Now I want to create a watchdog for the heating in the house so therefore the One-Wire interest . I have a basic understanding of how Things-Items-Sitemap fit together but never created a thing from a file before.

Basic Problem
I have tried to display the temperature reading from an OneWire 18b20 sensor in the sitemap. I’m using the OWserver and can read the sensor through it, but I cannot get the reading on to the sitemap.

I hav stayed as close to the One-Wire binding manual as possible:
https://www.openhab.org/addons/bindings/onewire/

I’m hoping somebody can find the mistake or give me some pointers in how to trouble shoot this. All suggestions appreciated! /Regards Daniel

HW + OS

  • Raspberry Pi 2 + Raspbian Stretch + I2C One-Wire board + one 18b20 temp sensor.

openHAB

  • apt-get installed OH2.3
  • PaperUI installed OneWire binding. Configured with Local IP (127.0.0.1) and Port (4304)
  • I get the following in the openhab.log, looks ok to me:
2018-09-02 11:06:35.287 [INFO ] [nternal.connection.OneWireConnection] - Connected to owserver [IP '127.0.0.1' Port '4304']

OWserver

  • OWserver installed, and working. Checking with “sudo owread /28.51DEAD060000/temperature” returns accurate temperature.
  • Modified the “owfs.conf” file with “server: port = 127.0.0.1:4304” (instead of “server: port = localhost:4304”).

Things file - As close to the Manual as possible:https://www.openhab.org/addons/bindings/onewire/#channels

//OneWire server 
Bridge onewire:owserver:mybridge [ network-address="127.0.0.1" ] {
    temperature mysensor   [ id="28.51DEAD060000" ] 
}

Items file

Number:Temperature WDTemp1 "WDTemp1 [%.1f %unit%]" { channel="onewire:mybridge:mysensor:temperature" }

Site map

sitemap arosenius_watchdog label="Aroseniusvägen Watchdog"
{
	Frame label="Temps" {
		Text item=WDTemp1 label="Aktuell TemperaturX [%.1f °C]"
	}

Don’t put a label and a format in items and sitemap definition.
Delete one after the other and try if it helps.

@sihui thanks for the suggestion!

Unfortunately I did not get it to work regardless. Tried the following as shown below, maybe not correct?

Is there a way of debugging the binding somehow?

Items

//Number:Temperature WDTemp1 "WDTemp1 [%.1f %unit%]" { channel="onewire:mybridge:mysensor:temperature" }
Number:Temperature WDTemp1 "WDTemp1" { channel="onewire:mybridge:mysensor:temperature" }

Site map

sitemap arosenius_watchdog label="Aroseniusvägen Watchdog"
{
	Frame label="Temps" {
		Text item=WDTemp1 label="Temperature"
		Text item=WDTemp1 label="Temperature with formatting [%.1f °C]"
	}

What if you changed this part of the channel to “onewire:owserver:mybridge:mysensor:temperature”.

Just a stab at it. I know the docs don’t state this, but curious.

As with all bindings:

Closing the loop.

If I replace the openHAB2 style, Things/Items definition, and replace it with an openHAB 1.x Item connection as per below, things work just fine. (now corrected as per KidSquid’s comment below.)

Maybe this is not so surprising since the PaperUI reports the binding as “binding-onewire1 - 1.12.0”, note the “onewire1”. I just wonder where the openHAB2 version that is described in the documentation ended up?

This works:

Number WDTemp1 "Watchdog temperature" {onewire ="deviceId=28.51DEAD060000;propertyName=temperature;refreshinterval=10"}

Just to be clear for anyone else who stumbles across this thread…

There are no 1.x THINGS…Things only exist in OH2.

You used a 1.x ITEM

Not at all trying to be an ass, just want to help make sure others that come along don’t get even more confused by the nomenclature which is really easy to do! :smirk:

Glad you got it all working.

1 Like

Remains a mystery so far

Appreciate the correction. Completely second the idea of keeping the confusion to a minimum.