How to setup things files?

Your Thing definition is wrong, or at least differs from mine. Mine is working. :wink:

I wrote the light id twice. Although it’s the same entity, the parameter “lightId” is not the same as the address number between bulb type and bulb name.
Make it look like that

Bridge hue:bridge:1 [ ipAddress="192.168.X.X", userName="XXX" ] {
    0200 5 bulb1  [ lightId="5" ]
}
1 Like

thanks… but still not working…

is there way to check if the hue authentification is working?

Sure, you may check the logs.

If you are using openHABian, you could point your browser to http://openhabianpi:9001 to review them.

1 Like

Thanks…
Here is the log entry:

[WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'home.things' is either empty or cannot be parsed correctly!
[ThingUpdatedEvent         ] - Thing 'hue:bridge:1' has been updated.
[ThingUpdatedEvent         ] - Thing 'hue:0200:1:bulb1' has been updated.
[WARN ] [ome.core.thing.internal.ThingManager] - Cannot delegate command 'ON' for item 'Light1_Toggle' to handler for channel 'hue:0200:5:bulb1:color', because no thing with the UID 'hue:0200:5:bulb1' could be found.`

This is confusing… there seems to be a problem parsing the things file, but he updates the things anyway…

This message says “either empty”, wich happens for a short moment, while the file is being written. The file-changed event is a bit too early

My suggestion is to discover the things via PaperUI. You can copy the channel information to your items definition file. Later on, when you are familiar with the items, you can add the things per file, restart, and it’s done. PaperUI is a great help for starting.

And, by the way, it’s best to use the id-notation which is used by PaperUI instead of an own id scheme. (Did it, switch back due to some annoyances, but nothing too serious.)

2 Likes

This message says “either empty”, wich happens for a short moment, while the file is being written

ok. can i assume that this is the case here? and there is no problem with my things file? When I intentionally add a syntax error, it will be shown in the log file with a line number as well. So I guess there is no problem.

[quote=“job, post:14, topic:36812”]
My suggestion is to discover the things via PaperUI[/quote]

That’s exactly what I want to avoid… Last time it wasn’t possible to delete things, it stopped with an error message and then everything was screwed up…

This is the major problem I see at OpenHab… that makes it sooooo damn difficult to get started: there are always two ways to do something… Two UIs, three ways to add things/items two ways to address items etc…

I see this as a feature! You may choose whatever you prefer :grinning:
I’m using a mix of everything (PaperUI things, channels via text files linked to those things, manually created items without any binding config linked to auto discovered things and channels, …) and it all works fine.

1 Like

In PaperUI under Add-ons, when you click on an add-on’s name it opens that add-on’s README in another browser tab.

Or you can go to http://docs.openhab.org and browse to the User Manual, Add-ons and the add-on you are interested in.

Or you can go to http://docs.openhab.org and search for the addon you are interested in.

Another misunderstanding. Bindings are add-ons. The Inbox is where you will find the Things that your Bindings have automatically discovered.

First, you install a binding. Then you configure a binding according to its README. Then, if the binding supports it, you accept automatically discovered Things out of the Inbox.

That is a Thing ID. You can find the Channels for a given Thing in all the ways I already described. Or you can look at the README in one of the ways I describe above.

You say you have read the documentation but you have some major confusions about key concepts with OH which is probably the main source of your frustraitions and difficulty.

And like I said, not all bindings will currently support that. And given your confusion about very basic concepts like the difference between a binding and a Thing I have to recommend against this. I think your issues is misunderstanding, not the UIs. Until you have a bit more experience with OH I would:

  • Install bindings through PaperUI
  • Use PaperUI to accept automatically discovered Things out of the Inbox.
  • Use PaperUI to discover available Channels on a given Thing
  • Do everything else in text configs.

This is the easiest path.

If this is an apt-get installation the JSONDB is located in /var/lib/openhab2/jsondb.

They are plain text JSON formatted files. Do not edit these files while OH is running.

That may be the case, but your harmonyhub:hub:HarmonyHubWohnzimmer is most definitely a Thing and if it was an automatically discovered Thing (i.e showed up in the Inbox) you will find it in the JSONDB.

Your questions and misuse of termonology indicate you do not, in fact, understand these concepts.

OK so far

That is an automatically discovererd Thing. You need to accept it out of the Inbox. It will then appear under Things in PaperUI. Click on that and it will list all of the Channels available on that Thing at the bottom of the page. Some have only one Channel, some have dozens of Channels.

Since the HueBridge is a contorller, you may need to do something else to have the rest of your Hue devices discovered or manually create them through PaperUI or .things files. Looking at the Hue Binding README

Discovery

The Hue bridge is discovered through UPnP in the local network. Once it is added as a Thing, its authentication button (in the middle) needs to be pressed in order to authorize the binding to access it. Once the binding is authorized, it automatically reads all devices that are set up on the Hue bridge and puts them in the Inbox

Excellent, progress!

And this is why there is the recommendation to use PaperUI or the Karaf Console to aut9omatically discover Things where possible.

Thousands of Hue Users, many of which are not technical, have been very successful in setting up Hue through PaperUI. But if you don’t want to use PaperUI, you can do the same operations from the Karaf console.

http://docs.openhab.org/administration/runtime.html#inbox

It is an opensource project currently undergoing a major re-architecture while maintaining backwards compatibility that supports the integration of 200+ technologies and APIs and tens of thousands of devices from hundreds of different vendors. Its going to be complex.

But, like sihui, I see the fact that we have options for how we want to set it up which will meet our individual needs is a feature.

1 Like

Yes I know those “features”… I’m a softwar developer… Said this a thousand times “It’s not a problem - it’s a feature

You may choose whatever you prefer

Maybe… half a dozen different solutions and none is really working properly.
That’s the reason why everone is talking about Apple Homekit, Philipps Hue and Amazon Alexa - and nobody talks about OpenHab.

but you have some major confusions about key concepts with OH

I don’t think so. I’m well aware of the differnce between bindings and things… (as I said: I’m using OpenHab vor a couple of months now and build my own RestAPI, accessing, things and items). It’s just hard to describe something, if you can’t use neutral expressions like “item” and “thing”,

Use PaperUI to accept automatically discovered Things out of the Inbox

If that had worked I would still use it. But automated adding of things caused a lot of problems at my previous Installations (e.g. I was not able to delete things via GUI)

They are plain text JSON formatted files

Ah that’s good… than I can import the DB from my old installation

armonyhub:hub:HarmonyHubWohnzimmer is most definitely a Thing

Yes, but It hasn’t been added yet… It’s neither in the JSON DB nore in the GUI and not in my things file. It just has been deteceted by OpenHAB, after I added the binding…

You need to accept it out of the Inbox

Yes but as I said before: I want to handle things via file and NOT via GUI. Thats the whole idea why i started from scratch

And this is why there is the recommendation to use PaperUI or the Karaf Console to aut9omatically discover

If the GUI would be working, I would use it. But it doesn’t! The GUI just sucks… Looks like an early Beta…

you can do the same operations from the Karaf console

It seems that you misunderstood me, maybe because English is not my mother tongue…
But again: I want to use files to setup things!
NO CONSOLE
NO PAPER UI

It is an opensource project currently undergoing a major re-architecture

Then you should have done the re-architecture BEFORE you published a new release that is not working - or publish the new release AFTER you write proper tutorials and documentation…

And it doesn’t help me that OH is able to support hundrets of different APIs when the three APIs that >I< need aren’t working properly…

Which is why I use Item when referring to an OH Item and item when using it for the general meaning. Same with Thing.

“Working properly” is a subjective measurement, but the thousands of successful and happy OH users seems to point to OH doing something right. Noone here has claimed it is all roses and puppy dogs and lots of work id being done to make it better.

I see OH talked about everywhere, but everyone is in their own individual media bubble. What I see may not be what you see.

But I do find it interesting how many users migrate to OH FROM those systems because of their limitations.

So, you have said this many times. You have provided no details except “it didn’t work”. So we haven’t addressed it. I’ve not seen other reports of this particular problem. Maybe the fix to your rare and otherwise not yet reported problem is as simple as Clear the Cache

All we are getting is “PaperUI didn’t work so it and all people who use it are evil.” What do you expect from us?

So are you just ignoring all the times I’ve said “or you can do it from the Karaf console?”

And you may not understand me.

This cannot be done yet for ALL bindings. Look at the README for the three bindings you need to see whether or how to define Things in text files. If it doesn’t tell you how to create Things, you can only use automatically created things.

Even when it can be done it will be harder for you.

They did. OH 2.2 works great for thousands of users and 2.1 works perfectly for thousands more.

You’ve provided no details about the PaperUI problem except to say you couldn’t delete Things. You’re a programmer. Logs? Errors? Exceptions? Ask for help on the forum?

No, lets burn the whole thing down and then get mad when OH doesn’t let me do it exactly the way I want to.

2 Likes

I reinstalled OpenHAB about five times (new SD card, new Raspberry) and always ran into the same problems with the GUI.
So for me the fix is: Don’t use files!! Every OH user I know personally recommended this… So now this is what I do. So please stop trying to convince me to use the GUI again.

What do you expect from us?

That you accept that I DONT WANT TO USE THE FILES - as said in the headline of this thread.
You may find that Paper UI is the coolest piece of software this earth has ever seen, but I still don’t want to use it.

Is this so hard to understand? I’d like to have help setting up OpenHAB using >>>FILES<<<… is that so hard to understand?

lg, Dave

Then use the F@#$ing Karaf Console. Like I’ve suggested three times already.

I understand but you ignore what I’ve said three times now.

IT

IS

IMPOSSIBLE

FOR

SOME

BINDINGS

TO

DEFINE

THINGS

IN

TEXT

FILES

For those bindings that DO support manually created Things

READ

THE

BINDING

README

FOR

HOW

TO

DEFINE

THINGS

IN

.THINGS

FILES

Did I mention, that I want to use files???

but you ignore what I’ve said three times now.

No, but you just didn’t read what I posted… I HAS read the documentation. I posted a link to the Hue documentation that clearly sais that the configuration via file is possible.

THIS IS WHERE I MADE SOME MISTAKE!!! HERE I NEED HELP!
TO SETUP THE THINGS/ITEMS FILES!!!

Am I speaking Chinese? Because it’s not possible that my English is THAT bad!

regards,
Dave

Your English appears very good but there is clearly a communication problem. I stopped posting on this thread because it felt like most questions and suggestions were ignored, possibly misunderstood, but after you’ve tried a few times to put things across in a few ways but it still seems to get thrown back at you you end up thinking ‘I’ve got better things to be spending my time on’.

These are from my first post and as far as I see it still pertinent:
As you’re a developer I’d highly recommend the file route, you can always play with the GUI to see stuff but do final build in files.

What I also found really handy was you can read the PaperUI JSON database because it’s basically a text file, just look in the openhab2/jsondb folder and you’ll find the appropriately named files for things, items and channel links etc. If you’re stuck on something you can usually read what PaperUI is doing from it’s database and reverse it back in to the required native file format.

So if you can add Things linked via channels to Items in PaperUI and it all works then do it! At that point stop OH, copy the PaperUI JSON DB files out for backup, restart OH and clear out those Items and Things via PaperUI and start building you own FILES but look in the (text based) JSON DB files to see how it dealt with those very important little details. I can’t give you my Hue Things and Items cause I don’t have any, but this process is exactly what I did for converting from PaperUI to files.

Good luck.

I don’t know if you have your Hue bulb set up properly yet but just quickly looking at the thing you set up, and the log output, shows you have something set up wrong. The log is telling you that the thing hue:0200:1:bulb1 was updated, but you’re trying to use an item linked to hue:0200:5:bulb1:color

The below is perhaps a solution to this problem:

Bridge hue:bridge:1 [ ipAddress="192.168.X.X", userName="XXX" ] {
    0200 1 bulb1  [ lightId="1" ]
}

This would have the hue bridge defined by your IP be associated with a bulb thing with the id of 1.

You can also take things further if you DESPERATELY want to see the things clearer in PaperUI.

Bridge hue:bridge:1 "Hue Controller" @ "Hue" [ ipAddress="192.168.X.X", userName="XXX" ] {
    0200 1 bulb1  "Bulb 1" @ "Hue" [ lightId="1" ]
}

The text in quotes is used to determine the tab the things are shown on.

1 Like

This is exactly my frustration. I should follow your example and just bow out. Nothing frustrates me more than thatn freely offering up my help only to be ignored.

This is my last post in this thread.

In the future, you can save us all a whole lot of time but actually leading with your specific problem, not a general complaint about how much OH sucks and a general question.

Your original post states you want to use .things file for EVERYTHING. You don’t mention Hue until the fourth post and then only in passing. At that point you have said and done things to indicate you didn’t really understand key concepts (i.e. calling the Thing in the Inbox a Binding, not appearing to understand the difference, thinking you could just post Ray’s example Things in your setup and that they would do anything for your specific setup, especially control your Hue lights since nothing he posted addresses Hue). Next time then say that you need help with Hue Things. No where in your original posting do you mention Hue. You just complain about how much OH sucks and ask general questions.

When you Bring Hue up again it comes across as a single example. I continued to address your original question: “How to I use .things file for ALL Things?” At this point you apparently switched to “How do I make .things files for Hue?”

The answer to “How do I use .things file for ALL Things?” is still “You can’t, some bindings do not support that.” The answer to “How do I make .things files for Hue?” is in the Hue README. And if you are having trouble, as you saw with job and paul’s postings, we can start to help with specifics.

No, you didn’t. You posted this:

http://docs.openhab.org/configuration/things.html

The generic documentation explaining how Things work and can be defined for those Bindings that support them in general.

The Hue specific documentation is here

http://docs.openhab.org/addons/bindings/hue/readme.html

I provided no fewer than three ways you can find this README, which all indications are you ignored since you think you posted the link to the Hue documentation along with other things you’ve posted.

And you can see there is copious documentation about how to create and populate a Hue Thing in a .things file. The fact that you

So to summarize, I’m frustrated that you are ignoring my answers, do not has quite as good of an understanding of how OH works as you think you do, and you switched the question half way through the posting. I continued to answer the original one. Finally, you will be more help and those of us helping are far more likely to be patient if ask specific questions and save your “OH sucks” comments for later in the thread.

2 Likes

Thanks to @job who heloed me last night I found the problem…The inbox showed the wrong ID of the hue bridge…
I copied the ID from my old JSON DB… now with the correct ID it’s working…

thanks a lot

Sorry, to bother again…

Although the Hue lightbulbls are working fine now… OH didn’t find the Hue motion sensor and the hue remote…
Everything else was found by autodiscover, but not these items…

thx
best regards
Dave

thx…
Why is this such a problem to implement that? The issue is open for more than a year now…
Hue provides a very easy-to-use REST API. I was able to program an interface in PHP to read the sensor in less then two hours… ok read-only without extensive unctionality, but it didn’t seem that complicated.

regards, Dave