Best way to add hue Lamps to openhab 2.4

Hello, everybody,

i wanted to ask about the best way to integrate lamps (hue) into openhab 2.4. I have installed the binding in the Paper ui so far. Then I searched for all lamps which are now listed in the Paper ui under “things”.

Is this the right approach? Does it make more sense to create the things in a hue.thing?

Should the items be created in the Paper Ui or should I do this in a hue.item?

When cooled there are 1000 possibilities. What is the best way to do it?

Thank you very much :slight_smile:

Ah, a veeeeery difficult question. Ask ten people and you will get fifteen answers :grin:

I am firmly in the “use files” camp, @David_Graeff quite the opposite with “use the UI” and other people will have other opinions on what the “best” way is.

I let Paper Ui create my things and write item files by hand in text editor. is good…

I too use paperui for things (otherwise they constantly get duplicated in the inbox) and then use text files for items

I think the majority will agree with Andrew and Dave, manage Things through the UI and write Items by hand in .items files.

But let me explain why.

  • .things file syntax is a bit finicky and it can be a challenge to get it right. The proper syntax and parameters is not always adequately documented in the individual binding documents. So it can be much more challenging to get it working in the first place.

  • Most OH 2.x bindings will automatically discover Things saving you a whole lot of work. To take advantage of this and avoid having two ways to manage your Things. Do not underestimate the value of consistency.

  • If you create a Thing through PaperUI the syntax is guaranteed to be correct. You may have messed up the parameters but at least you will know without a doubt that there isn’t a typo in the format. Also, the available parameters and in many cases what they mean will be apparent and documented right in front of you so there is no need to go look it up or guess. For example:

Everything I need to know to properly configure an MQTT Channel is apparent and documented in place.

  • Things get stored into a plain text database so you can, if you need to inspect or manually edit the resultant configs you can. This was particularly helpful when migrating between MQTT 1.x and MQTT 2.x for me. I created one Generic MQTT Thing in PaperUI, closed openHAB (you cannot edit the JSONDB file while OH is running), found the entry for the MQTT Thig, copied, pasted, and edited to create the dozen or so more MQTT Things/Channels I needed. The JSONDB where they get stored also get automatically backed up periodically automatically. And because they are plain text they can be saved to source control and the like if that’s your thing. It’s not perfect but for many the advantages listed above override the drawbacks of JSONDB.

  • PaperUI does not have complete support for Items. In particular, the ability to add tags (required for Google Assistant, Alexa, Hue Emulation, and HABot), or use OH 1.x bindings cannot be done through PaperUI.

This doesn’t make this approach any more correct than other approaches. Do what makes the most sense for how you want to work. But these are the reasons why I manage all my Things through PaperUI and my Items through .items files. If there were complete support for everything I need with Items in PaperUI, I’d probably move my Items to JSONDB too.

1 Like

Many thanks for the numerous answers and especially @rlkoshak for the very detailed answer. As I understood it and thought, the mix of Paper ui for the things and editor for the items makes sense. I was very confused, because there are innumerable tutorials and each one has a different procedure. I expected that to be a little different.

Then I would add a question, even if it is a bit offtopic.

How and where would you create rules? In Node-Red or rather with the Openhab board?

I prefer to stick to openHAB for Rules. Unless you have a very compelling reason like NodeRed does something OH doesn’t support that you need or you really really want a graphical environment to build rules, I’d stick with OH.

I too only use openhab text files for rules, and separate the files out into categories based on the items they control such as lights.rules or for more complex things such as bedtime routines I would have a separate file routines_bedtime.rules

I try to limit the amount of separate program instances running to minimise delay’s / keep my pi from being overloaded.

1 Like