Apply tags to items added/linked in Paper UI

What about adding yet another way of specifying smarthome items, e.g. via groups?
I started working on it and it seems to work pretty well: https://github.com/openhab/openhab-alexa/issues/4

yes, thank you @Schnicki, that totally works and keeps me from having to define extra items just for echo compatibility. It seems like this should eventually go into paperUI as well, but this works for now.

Does the item show up AND work for you? For some reason, it’s showing up but its not responsive. I’m trying to control an item in homekit.

yeah, I can have my echo turn on/off and dim lights & fans

I also tried those things. What got me going, was the REST API. So, just send a PUT request to http://:/rest/items//tags/Lighting to set a tag called “Lighting”. I use the “Advacned REST Client” available as a plugin to Chrome to do this, but you can also go to your OpenHAB-server to URL /doc/index.html, and use the built-in REST client. It worked for me, and I now have tags successfully set, and HomeKit working :slight_smile:

1 Like

Ooooo interesting. I didn’t even think I to try the REST API! I’ll try this out on my end. Thanks!

For me the tag field within HABmin is greyed out and I can’t edit it. I created all items via paperui and don’t have a .items file anymore. Any idea what the greyed out tag field could be caused by?

NoTechi

PS
I got the latest snapshot installed

PPS
A tag field within paperui would be great :slight_smile:

4 Likes

Using the REST API is brilliant. I’ve been looking all over trying to figure out how to set the tags, but there is NOTHING telling me how to do it via the web interface. It is a complete kludge, but it works perfectly. My device became available Alexa straight away after setting the tag and doing a new discovery on the Echo.

I tried the Habmin thing channel method; it worked for some things, but not for others (the tags get cleared on save).
It also doesn’t work for tagging Group items (since there is no associated Thing). I also can’t edit item configuration in Habmin (everything is read-only / greyed out).

Is the REST API the only known solution to these problems? At least it’s better than what I was doing: shut down openhab2 service; edit JSON DB files; restart openhab2 service.

Laurie

1 Like

I have been doing the shut down and editing the json file directly as well.

How to add tags to items using Test API?

For google home support I found this thread and originally used the rest api, but just noticed that you can also add tags in the console which is even easier. Wanted to cross post it here as well.

openhab> items
Usage: smarthome:items addTag - adds a tag to the given item
Usage: smarthome:items rmTag - removes a tag from the given item

1 Like

even faster is to use HabMin - it allows tags to be added. Just unlink channel and re-link with tag…

Nice to see that we have some workarounds. But blocking things like this really stop the adoption of the PaperUI, or even leave users in a state where they would like to transition all there items to config files again. Can we not just make sure that we can add tags from the now recommend PaperUI?

I tried this …
Does not matter whether i unlink or not the “tag” field keeps greyed out in HABmin.

Keeps up with REST, even this is pretty confusing to use

After I worked out how the commands within the console needed to be phrased, I found this the best / easiest solution.

opening the console was my first task…

From a command prompt within the host machine

openhab-cli console

you’ll then get prompted for the password

habopen

It’s then a matter of correctly formatting the “smarthome:items addTag” command.

For example, why could I set the tags for Bath_Red but not for Mid_Red ???

The reason was that I wasn’t using the correct Item name.

I found the best way to locate the correct item name was to go as far as editing the item in PaperUI / Items and copying the text from the orange bar at the top…

Edit Bath_Red

The required command within the console is

smarthome:items addTag Bath_Red Lighting

Or what turned out to be for Mid_Red

smarthome:items addTag BackSuiteColour_Mid_Red Lighting

Now I can tag most items…

Good luck

Reference :- [Official Google Assistant Integration for openHAB](http://Official Google Assistant Integration for openHAB)

1 Like

The other tiny detail I had missed previously was that I hadn’t configured the Cloud Connector correctly.

I had copied my UUID and Secret to link my OpenHab2 instance to the myopenhab.org account, but I hadn’t noticed the “Items to expose to apps such as IFTTT” check list.

I found it all by doing the following:-

Open - PaperUi

Goto - Configuration

Click on - Services

Find “IO” in the tabs

Find - OpenHAB Cloud

Click on - Configure

Open the check list by clicking on - “Items to expose to apps such as IFTTT” - in the top right hand corner.

Click on Save

Plenty of people have commented that the changes are NOT reflected instantly in myopehab or Google Assistant, this I can agree with.

But given that the information has to filter through plenty of gateways and stuff I don’t pretend to understand, I do the following:-

I add tags in the console and check the “Items to expose to apps such as IFTTT” check list.

Leave it all alone for a few hours, change a few thing’s states in the real world or via the app…

THEN ask Google to “Sync my Things”

The next issue I experience is that setting rooms and nick names in Google Assistant doesn’t tend to work well straight after a Sync. “Unable to save changes, please check your settings”

Again…

Leave it a few hours to settle and it seems to respond a lot better.

An interesting observation —

If I leave my instance of PaperUI in Openhab2 in “Simple Mode” while adding Things, any automatically created Items can’t have tags edited using the Console.

Any attempt returns the error “Cannot change tag {x} on item {y} because this item does not belong to a ManagedProvider”.

If I create Items as I add Things, not only do the Items’ names make more sense, I also don’t get a lot of unused Items.

You can’t edit items created in Simple Mode or in .items -files. Have a look at my solution:

HowTo: Move ALL items to JSON dB for easy editing in PaperUI and tagging for Google Home (and Alexa)

Hi All,

i’d like to follow up on this topic as i have the same issue + a weird behavior on the Google Home App.

Little bit of background:
I have created all my things in PaperUI with “simple” mode enabled.
However, at one point i switched “simple” mode off in order to be able to group and reasign items. In any case, i was trying to integrate Google Assistant with Openhab following the documentation. This worked to the extend as i could connect with credentials but couldnt see and devices(items) in the app.

Reading several threads and documentation, this is because the requiered “tags” for google assistant where not applied to the items. So i followed this thread for example ,and were able to assign tags via comand line and via rest api. No problem. I was also able to successfully verify the changes on the items with the added tags.

However, once tge tags are applied, the Google Home App cannot refresh the devices anymore and returns a “configuration error”. If i remove the tags, the app is able again to refersh the devices.

Can anyone commetn on this behavior?

Version: OpenHab 2.5.4 “Master” branch.

Regards

Patrick