Define Things & Channels with OneWire Binding

Hi

I am using OpenHAB 2.4 (Release Candidate) with the “new” OneWire Binding (https://www.openhab.org/addons/bindings/onewire/). After entering the address of my owserver auto discovery works, but I want to define my things manually. So I created a .things-file like in the demo.things example of the documentation:

Bridge onewire:owserver:towserver [ network-address="172.19.1.12" ] {
    temperature 28_FF2526A41504   [id="28.FF2526A41504" ] 
}

This does not work. Paper UI doesn’t show me a channel and if I just use the (non existing?) channel like shown in the documentation (demo.items example) I don’t get an error but also no temperature is shown.

So after some try & error I created this:

Bridge onewire:owserver:towserver [ network-address="172.19.1.12", port=4304 ]{
    Thing temperature 28_FF2526A41504 [ id="28.FF2526A41504", refresh=5 ] { Type temperature-por-res : temperature [ ignorepor=true, resolution=12 ] }
}

This now looks in PaperUI exactly the same like my auto discovered and configured stuff, but it stays on “initialized” forever and never comes “online”.

Any ideas what I am doing wrong?

Have you created an item in the items file to link with your thing?

Item example from the doc’s:

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

You will need to create a item, using your info, similar to the example above in your items file.

Yes I created items for my things. So this works with my auto-discovered thing:

Number Zimmer1_Temp1 "Temperatur vorne [%.1f °C]" <temperature> (Temperaturen, OG3) { channel="onewire:temperature:bc05d8c4:28_FF2526A41504:temperature" }

I can use this item in my sitemap and it shows the temperature (and Paper UI shows the thing as “online”)

But this does not work with my self defined item (which looks the same in Paper UI, but stays on “initializing”)

Number Zimmer1_Temp1 "Temperatur vorne [%.1f °C]" <temperature> (Temperaturen, OG3) { channel="onewire:temperature:towserver:28_FF2526A41504:temperature" }

No temperature is shown when I include this to my sitemap. It stays “initializing”.
And for sure I am not using both with the same name at the same time :wink:

You can use PaperUI or create everything in files but you can not have both.

If you want to merge everything to files, make sure to turn off auto discovery and delete the Items that were discovered by PaperUI. After doing that you should restart OH and have only the items created in files and they will be initialized. If not then you may need to clean the cache to help rid the system of the old items.

To clean the cache do the following:

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo systemctl start openhab2

Thanks, I tried that.

I deleted all auto discovered things, stopped openhab2, clean the cache, started it again and I can only see the things defined in files. But it’s like before: The bridge is online, but my sensor stays on “initializing”…

Do you have error messages in the logs? Maybe try removing the item from a group and see what happens.

This is all what happened in the Log when stopping, clearing the cache and starting openhab2:

2018-12-17 14:18:51.545 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2018-12-17 14:19:01.766 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Stopped HABmin servlet
2018-12-17 14:19:01.861 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Stopped Paper UI
2018-12-17 14:19:01.865 [INFO ] [panel.internal.HABPanelDashboardTile] - Stopped HABPanel
2018-12-17 14:19:01.867 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Stopped Home Builder
2018-12-17 14:19:01.869 [INFO ] [.dashboard.internal.DashboardService] - Stopped Dashboard
2018-12-17 14:19:23.907 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Berlin'.
2018-12-17 14:19:23.917 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '52.37886736269343,9.727896647059897'.
2018-12-17 14:19:23.918 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2018-12-17 14:19:23.918 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Measurement system set to 'SIUnits'.
2018-12-17 14:19:25.447 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 't-owserver.things'
2018-12-17 14:19:25.492 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://172.19.1.13:8080
2018-12-17 14:19:25.493 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://172.19.1.13:8443
2018-12-17 14:19:26.752 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'AmXXX.items'
2018-12-17 14:19:26.934 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-12-17 14:19:27.086 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model '3OG_Guenthi_Tobby.sitemap'
2018-12-17 14:19:27.112 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'AmXXX.sitemap'
2018-12-17 14:20:24.465 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2018-12-17 14:20:24.479 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2018-12-17 14:20:24.670 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 't-mqtt' with clientid paho133344930214568 and file store '/var/lib/openhab2/mqtt/t-mqtt'
2018-12-17 14:20:24.931 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-12-17 14:20:24.971 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin

Doesn’t look like an error… :frowning:

event.log looks like this:

2018-12-17 14:20:24.571 [hingStatusInfoChangedEvent] - 'onewire:owserver:towserver' changed from UNINITIALIZED to INITIALIZING
2018-12-17 14:20:24.596 [hingStatusInfoChangedEvent] - 'onewire:owserver:towserver' changed from INITIALIZING to UNKNOWN
2018-12-17 14:20:24.598 [hingStatusInfoChangedEvent] - 'mqtt:broker:tmqtt' changed from UNINITIALIZED to INITIALIZING
2018-12-17 14:20:24.611 [hingStatusInfoChangedEvent] - 'onewire:owserver:towserver' changed from UNKNOWN to ONLINE
2018-12-17 14:20:24.639 [hingStatusInfoChangedEvent] - 'mqtt:broker:tmqtt' changed from INITIALIZING to OFFLINE
2018-12-17 14:20:24.680 [hingStatusInfoChangedEvent] - 'onewire:temperature:towserver:28_FF2526A41504' changed from UNINITIALIZED to INITIALIZING
2018-12-17 14:20:24.706 [me.event.ThingUpdatedEvent] - Thing 'onewire:temperature:towserver:28_FF2526A41504' has been updated.
2018-12-17 14:20:24.732 [hingStatusInfoChangedEvent] - 'mqtt:broker:tmqtt' changed from OFFLINE to ONLINE
2018-12-17 14:20:24.733 [me.event.ThingUpdatedEvent] - Thing 'mqtt:broker:tmqtt' has been updated.
2018-12-17 14:20:24.746 [hingStatusInfoChangedEvent] - 'ntp:ntp:local' changed from UNINITIALIZED to INITIALIZING
2018-12-17 14:20:24.784 [hingStatusInfoChangedEvent] - 'ntp:ntp:local' changed from INITIALIZING to ONLINE
2018-12-17 14:20:24.821 [vent.ItemStateChangedEvent] - Datum_Uhrzeit changed from NULL to 17.12.2018 14:20:24
2018-12-17 14:20:24.988 [thome.event.ExtensionEvent] - Extension 'ui-homebuilder' has been installed.
2018-12-17 14:20:24.988 [thome.event.ExtensionEvent] - Extension 'binding-mqtt' has been installed.
2018-12-17 14:20:24.988 [thome.event.ExtensionEvent] - Extension 'ui-basic' has been installed.
2018-12-17 14:20:24.988 [thome.event.ExtensionEvent] - Extension 'binding-onewire' has been installed.
2018-12-17 14:20:24.989 [thome.event.ExtensionEvent] - Extension 'binding-ntp' has been installed.
2018-12-17 14:20:24.989 [thome.event.ExtensionEvent] - Extension 'ui-habmin' has been installed.
2018-12-17 14:20:24.989 [thome.event.ExtensionEvent] - Extension 'ui-habpanel' has been installed.
2018-12-17 14:20:24.989 [thome.event.ExtensionEvent] - Extension 'ui-paper' has been installed.

I also removed the item from the two groups, but that didn’t change a thing…

Recheck the things and items file to make sure there is no syntax errors or missing info.

Set the OneWire binding to DEBUG, you’ll get a lot more detail on what’s occurring.

EDIT: You can also try defining the item channel like this:

{ onewire="deviceId=28.FF2526A41504;propertyName=temperature;refreshinterval=5" }

ok so I did a “log:set trace org.eclipse.smarthome.binding.onewire” and restarted openhab2

event.log looks the same, openhab2.log looks like this:

2018-12-17 15:16:10.800 [DEBUG] [rg.eclipse.smarthome.binding.onewire] - BundleEvent [unknown:512] - org.eclipse.smarthome.binding.onewire
2018-12-17 15:16:10.814 [DEBUG] [rg.eclipse.smarthome.binding.onewire] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.type.DynamicStateDescriptionProvider, org.eclipse.smarthome.binding.onewire.internal.OwDynamicStateDescriptionProvider}={service.id=121, service.bundleid=197, service.scope=bundle, component.name=org.eclipse.smarthome.binding.onewire.internal.OwDynamicStateDescriptionProvider, component.id=13} - org.eclipse.smarthome.binding.onewire
2018-12-17 15:16:10.815 [DEBUG] [rg.eclipse.smarthome.binding.onewire] - BundleEvent STARTING - org.eclipse.smarthome.binding.onewire
2018-12-17 15:16:10.817 [DEBUG] [rg.eclipse.smarthome.binding.onewire] - BundleEvent STARTED - org.eclipse.smarthome.binding.onewire
2018-12-17 15:16:10.823 [DEBUG] [rg.eclipse.smarthome.binding.onewire] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=122, service.bundleid=197, service.scope=bundle, component.name=binding.onewire, component.id=14} - org.eclipse.smarthome.binding.onewire
2018-12-17 15:16:11.272 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Berlin'.
2018-12-17 15:16:11.278 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '52.37886736269343,9.727896647059897'.
2018-12-17 15:16:11.283 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2018-12-17 15:16:11.290 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Measurement system set to 'SIUnits'.
2018-12-17 15:16:11.474 [INFO ] [ebuilder.internal.HomeBuilderServlet] - Started Home Builder at /homebuilder
2018-12-17 15:16:11.480 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2018-12-17 15:16:13.099 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'AmXXX.items'
2018-12-17 15:16:13.828 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-12-17 15:16:13.969 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model '3OG_Guenthi_Tobby.sitemap'
2018-12-17 15:16:13.987 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'AmXXX.sitemap'
2018-12-17 15:16:14.088 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 't-owserver.things'
2018-12-17 15:16:14.315 [DEBUG] [nternal.discovery.OwDiscoveryService] - registering discovery service for org.eclipse.smarthome.binding.onewire.internal.handler.OwserverBridgeHandler@647e2389
2018-12-17 15:16:14.316 [DEBUG] [rg.eclipse.smarthome.binding.onewire] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=310, service.bundleid=197, service.scope=singleton} - org.eclipse.smarthome.binding.onewire
2018-12-17 15:16:14.350 [DEBUG] [internal.owserver.OwserverConnection] - opened OwServerConnection to 172.19.1.12:4304
2018-12-17 15:16:14.374 [TRACE] [internal.owserver.OwserverConnection] - owServerConnection already open, skipping input buffer
2018-12-17 15:16:14.375 [TRACE] [internal.owserver.OwserverConnection] - wrote: messageType READ, size 45, controlFlags 0x00000104, payload '28.FF2526A41504/type'
2018-12-17 15:16:14.376 [TRACE] [internal.owserver.OwserverConnection] - read: return code 7, size 31, controlFlags 0x00000104, payload 'DS18B20'
2018-12-17 15:16:14.376 [TRACE] [.internal.handler.OwBaseThingHandler] - updated modelid/vendor to DS18B20 / Dallas/Maxim
2018-12-17 15:16:14.498 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://172.19.1.13:8080
2018-12-17 15:16:14.500 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://172.19.1.13:8443
2018-12-17 15:16:14.744 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 't-mqtt' with clientid paho136694951437978 and file store '/var/lib/openhab2/mqtt/t-mqtt'
2018-12-17 15:16:14.789 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-12-17 15:16:14.841 [INFO ] [ui.habmin.internal.servlet.HABminApp] - Started HABmin servlet at /habmin
2018-12-17 15:16:15.314 [TRACE] [internal.handler.OwBaseBridgeHandler] - called owRefresher at 1545056175313, 1 childs
2018-12-17 15:16:15.314 [TRACE] [internal.handler.OwBaseBridgeHandler] - getting handler for Temperatursensor 28_FF2526A41504 - Tobby vorne (1 to go)
2018-12-17 15:16:15.315 [TRACE] [internal.handler.OwBaseBridgeHandler] - Temperatursensor 28_FF2526A41504 - Tobby vorne not initialized, skipping refresh
2018-12-17 15:16:16.315 [TRACE] [internal.handler.OwBaseBridgeHandler] - called owRefresher at 1545056176315, 1 childs
2018-12-17 15:16:16.316 [TRACE] [internal.handler.OwBaseBridgeHandler] - getting handler for Temperatursensor 28_FF2526A41504 - Tobby vorne (1 to go)
2018-12-17 15:16:16.316 [TRACE] [internal.handler.OwBaseBridgeHandler] - Temperatursensor 28_FF2526A41504 - Tobby vorne not initialized, skipping refresh
2018-12-17 15:16:17.317 [TRACE] [internal.handler.OwBaseBridgeHandler] - called owRefresher at 1545056177317, 1 childs
2018-12-17 15:16:17.318 [TRACE] [internal.handler.OwBaseBridgeHandler] - getting handler for Temperatursensor 28_FF2526A41504 - Tobby vorne (1 to go)
2018-12-17 15:16:17.319 [TRACE] [internal.handler.OwBaseBridgeHandler] - Temperatursensor 28_FF2526A41504 - Tobby vorne not initialized, skipping refresh
2018-12-17 15:16:18.344 [TRACE] [internal.handler.OwBaseBridgeHandler] - called owRefresher at 1545056178344, 1 childs

The last messages get repeated every second (until I set the log-level back to info).

I tried your channel definition:

Number Zimmer1_Temp1 "Temperatur vorne [%.1f °C]" <temperature> (Temperaturen, OG3) { onewire="deviceId=28.FF2526A41504;propertyName=temperature;refreshinterval=5" }

But no change.

Did it work via PaperUi with the refresh interval at 5? Maybe try changing the refresh interval to 600. Also try using the UOM feature on the item

Number:Temperature  Zimmer1_Temp1 "Temperatur vorne [%.1f °C]" <temperature>

Yes, with Paper UI and autodiscovered things the refresh interval of 5 worked. I set it to a higher number but no change…

I will now try to reinstall the whole thing and look if its reproducible ^^

Uninstall then reinstall the binding with your files in place might work.

So I purged my whole openhab2 installation including zulu-8 and reinstalled it from the testing-repository. Then put my .items, .things and .sitemap files back in place, restarted openhab2, installed “binding-onewire” in PaperUI aaaand … it didn’t change anything :frowning:

I also tried removing some special letters (spaces, dots, underscores, …) everywhere. But that wasn’t the problem either :smiley:

Did you change the item to use UOM feature (add Temperature) like below?

Number:Temperature  Zimmer1_Temp1 "Temperatur vorne [%.1f °C]"

Changed “Number” to “Number:Temperature” in my items-file. No change, still “initializing” (and no value is shown when viewing my sitemap in the Basic UI)

Was your Bridge also deleted from PaperUI after adding it to your things file? I ask b/c the log mentioned the connection already open. I would also rename the file from t-owserver.things to t_ownserver.things.

In case your wondering, yes I’m grasping for straws at this point.:neutral_face:

Yes, I purged everything (the whole installation) and added all devices just by using the things-file…
Tried to rename my things file, too.

No change :frowning:

I now added some MQTT stuff by defining it in my things file. This works. But my temperature sensors still don’t :frowning: Maybe I should open an issue on Github.

Hi there,

I have the same issue with my openhab 2.4 release. The Thing stays on INITIALIZING.

22:26:39.216 [TRACE] [.internal.owserver.OwserverConnection] - owServerConnection already open, skipping input buffer
22:26:39.231 [TRACE] [.internal.owserver.OwserverConnection] - wrote: messageType READ, size 45, controlFlags 0x00000104, payload '28.FF3373B31603/type'
22:26:39.275 [TRACE] [.internal.owserver.OwserverConnection] - read: return code 7, size 31, controlFlags 0x00000104, payload 'DS18B20'
22:26:39.280 [TRACE] [e.internal.handler.OwBaseThingHandler] - updated modelid/vendor to DS18B20 / Dallas/Maxim
22:26:39.294 [INFO ] [smarthome.event.ThingUpdatedEvent    ] - Thing 'onewire:temperature:mybridge:KG_Technik_T_onewire' has been updated.
22:26:39.300 [TRACE] [.internal.handler.OwBaseBridgeHandler] - called owRefresher at 1545168399298, 3 childs
22:26:39.304 [TRACE] [.internal.handler.OwBaseBridgeHandler] - getting handler for Temperature sensor (3 to go)
22:26:39.308 [DEBUG] [.internal.handler.OwBaseBridgeHandler] - Temperature sensor handler missing
22:26:39.312 [TRACE] [.internal.handler.OwBaseBridgeHandler] - getting handler for Temperature sensor (2 to go)
22:26:39.316 [DEBUG] [.internal.handler.OwBaseBridgeHandler] - Temperature sensor handler missing
22:26:39.320 [TRACE] [.internal.handler.OwBaseBridgeHandler] - getting handler for Temperature sensor (1 to go)
22:26:39.324 [TRACE] [.internal.handler.OwBaseBridgeHandler] - Temperature sensor not initialized, skipping refresh

So you both habe the same problem: it works from PaperUI but not from text files? I‘ll have a look, but not before the weekend.

I never tried from PaperUI, only from textfile.