.things file not being loaded

Hi, I am trying to migrate OH 1.9 to OH 2.0 with little success.

I have to say I am a little bit disappointed. I expected OH 2.0 to be much easier than the previous versions but I found it confusing and inconsistent. I have been using OH for quite a long time and I was happy. I had no problems setting up OH 1.x four years ago but I am having many problems with this new version that it was supposed to ease things.

I have migrated my KNX binding with success (it is not an OH 2 native binding so it does not feature “things”).
I am using the KNX items I was using for OH 1.x and they work. I use an .items file and these items are shown in PaperUI. This is the expected behavior…

However, I am trying to use OH 2.x native bindings and use the new “thing” concept with no success at all.
I tried to setup a .things file (in \conf\things folder, I use Windows 7), but there is no way I can see the things I define there in PaperUI, nor do they show in the Karaf console (I type “things” and “no things found” is displayed) nor in the Rest service. Of course I cannot link my items with these things since they simple don’t exist, do they??

I have tried the Samsung TV binding, the Ntp binding and the Yahooweather.binding, with no success at all. I think it is clear that the bindings are not the problem…

For instance, for the Samsung TV I include this in the .things file:
Thing samsungtv:tv:myTV [ hostName=“192.168.1.10”, port=55000, refreshInterval=1000 ]

None of the binding seem to load anything using a .things file. Nothing is shown in PaperUI / Karaf console / Rest service.
The NTP does seem to work when using things discovery in PaperUI (and they appear later in the json file). The other two bindings do not seem to be ready for this. In any case, I would like to use the .things file.

My questions are:

  1. Are things added by means of a .things file supposed to be shown in PaperUI?
  2. Are things added by means of a .things file supposed to be shown in Karaf console and Rest service?
  3. Does the things file need to be created with a special editor? I use Notepad++
  4. Does the things file need to have a special name?
  5. Can there be several .things file (one per binding, for instance)? Or only one file is allowed?
  6. Is there anything I should consider/do before that I am missing. I am sure there must be something since this behavior does not make sense at all…

Please help. I ran out ideas.

I don’t know if this will make a difference, but you are missing the Label in your thing definition
My example:

Thing samsungtv:tv:0d1cef00_00dc_1000_8d3a_5056bf08cbbf "Living Room TV" @ "TV" [hostName="172.16.13.111", port=55000, refreshInterval=1000]

Syntax:
Thing <ID> <"Label"> @ <"location"> [hostName="<IP>", port=55000, refreshInterval=1000]

Note, I use the Thing ID that PaperUI discovers in order to avoid having the binding report a new TV Thing being discovered in the Inbox of PaperUI.

Things are added in 2 ways:
(i) Auto via discovery in PaperUI
or
(ii) manual by hard coding them in %openhab_conf%/things folder. Example for windows: C:\openHAB2\conf\things and for Linux: /etc/openhab2/things/.

In both cases, they will show up also in PaperUI->Configuration->Things.
In case (i), the Thing config is stored in the jsonDB (and no info can be found in the manual config file). You can edit the Thing from PaperUI.
In case (ii) the Thing config is stored in the manual config file (and no info can be found in the jsonDB). You can NOT edit the Thing from PaperUI.
You can have in your system Things that are created using both cases. They live happily together :slight_smile:

Same as above. As long as they created, they will appear both in Karaf smarthome:things list and REST API http://<IP>:8080/rest/things

No. Any text editor will do. Note: Some editors create auto backup files and these can cause havoc. Make sure that you delete any auto-generated backup files from your things directory (if the case).

Only the extension matters (*.things). Of course, I would avoid using any “special” characters for the filename.

Yes, there can be. This is how I configure my Things also (one for SamsungTV, one for Astro, one for ntp, etc)

Something is going wrong and your OH2 system does not load up correctly your manually defined *.things.
Double check the syntax (based on each binding) and the folder contents & permissions (and proper location of the files).

I have tried the syntax you provided me and it does not make any difference.
No things are added.
It is like the .things files were completely ignored…

I promise the file is in the right folder and the extension is .things.
I don’t use any special characters for the file name.
I use OpenHAB 2.0.0. with Windows 7.

I create the .things file as I did with the .items file.
However, the items are loaded and the things are not.

Has anyone experienced something similar?
Am I the only one?

Do I need to add the bindings manually If use the .things file?
I am adding the bindings through the PaperUI.

PS: By the way, how are the bindings added manually?
With OH 1.x you just had to copy the .jar file (of the binding you chose) in the addons folder.
I don’t find separate .jar files with OH 2.0.0, just a 128 .kar file with all the bindings. I am confused…

Watch the console and/or openhab.log file during startup. Do you see I line like the following for your .things files?

2017-05-08 12:06:48.791 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'weather.things'

When you edit and save the .things file do you see a line like the following?

2017-05-08 13:33:10.436 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'weather.things'

If you do not see these and especially if you see error messages instead there is a problem with the .things files. Try opening a new file and copying the things definitions over line-by-line to strip out any hidden characters which could be causing the parser problems. I also recommend using ESH Designer to see if there might be some sort of syntax error that is not apparent to us in your posting.

Finally, just as a warning, there have been reports that the Yahoo Weather binding is not working correctly right now. I don’t know if that has been resolved or if it is still a problem or what.

No, things are not being loaded.

In any case, I have decided to switch to OH 2.1.0 since I am unable to make this version work propoerly. This seems to solve the problem, although I feel it is very strange that OH 2.0.0 does not…

Thanks anyway.

Hi Guys,

I have the same problem…

I’m using the OH 2.1.0 docker image and my openHAB ignores every things-file.
Loading item-files works fine. There is no “Loading model” entry in the logfile.

My “network.things”:

Thing network:device:sdr "SDR" @ "IT" [ hostname="192.168.0.5", port=0, retry=1, timeout=5000, refresh_interval=60000, use_system_ping="false", dhcplisten="false" ]

If I set it up via PaperUI it works fine.

Any ideas?

Regards,
Jens

Does no one have an idea?
I use the official docker image…

Usually you will get more attention if you post a new thread instead of replying to an existing thread that had been resolved for months.

Have you places the files in the things directory? Do the files end in .things?

1 Like