Apply tags to items added/linked in Paper UI

openhab2
tags
bindingtag
Tags: #<Tag:0x00007f014b921ca8> #<Tag:0x00007f014b921b68> #<Tag:0x00007f014b921a28>

(Schnicki) #5

If I got that right, have a look at HABmin Things’ Channels. You can add Homekit tags there. Works fine for me.


[SOLVED] How to add tags to items?
PaperUI Items in items file
(Russell Anderson) #6

Tried that. It worked insofar as the item now shows up as being available. Oddly, though, switching it on and off does nothing. BUT, if I connect another switch to it, and set up a rule to change switch it on and off like that, then it works…


(Patrick) #7

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


Can't find openHAB in iOS Home App
(Mike Bagdanoff) #8

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.


(Russell Anderson) #9

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.


(Mike Bagdanoff) #10

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


(Ole Kristian Lona) #11

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:


Official Google Assistant Integration for openHAB
Official Google Assistant Integration for openHAB
(Russell Anderson) #12

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


(Frederik) #13

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:


(Michael Turner) #14

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.


(Laurie Harper) #15

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


(Zolon Farsane) #16

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


(Tadey Stasevych) #17

How to add tags to items using Test API?


(AE) #18

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


(dennis de vreede) #19

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


(Joost Westra) #20

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?


(Stas K.) #21

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


(Mdar Ltd) #22

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)


(Stuart Hanlon) #23

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.


(Stuart Hanlon) #24

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.