Items file vs PaperUI

Hello,

I’m using a lot of Xiaomi things. I tried HomeAssistant and Jeedom, and finally adopted OpenHAB which is way better :slight_smile:
I have a working configuration with all my things, including my Philips Light Bulb (token hassle), except for the Xiaomi Universal Remote (i’ll try to make it work later).

Now I begin to work on sitemaps to have a nice UI, and the doc say that I have to create a .item file first.
I don’t understand something: Since everything is already configured, why do I have to create manually a .item file ? Is there a way to create this file from the PaperUI configuration ?

Thanks :wink:

That’s nice to hear!

Of course there is a way via PaperUI.

I guess you configured the Xiaomi Things via PaperUI, which would look something like this
https://puu.sh/zxrcf/b82958dc83.png
You have already created Items via PaperUI.
If it looks like this
https://puu.sh/zxrfy/99eccb45f2.png
There are no Items linked to the channels. And you need to link items to the channel.

https://puu.sh/zxrgu/3182df89be.png
The option “+ Create new item…” will guide you.
The channel even tells you which type of item you need to use for this channel :slight_smile:
The name given to the item like example this one marked.
https://puu.sh/zxrjD/87dd3f63af.png
can be used in a sitemap file.
Something like this.

sitemap demo label="My home automation" {
    Frame label="Demo" {
        Text item=goal_Switch_KickerBlack_Xiaomi_BewegungsmelderStatus
    }
}

hint: I named this sitemap demo. So you would have to go to the PaperUI tab "Configuration > Services > UI > Basic Ui > Default Sitemap + “demo”, if you want this to be your default sitemap

Thank you very much for this explanation !
Actually, I don’t have any “+” button :

(I use OpenHabianPi)

You have to press the Blue round Button. Which will give you a popup windows :wink:
Did you configure the Things via PaperUI or via. a .things file textual configuration?

Oh OK I found out, it’s the “simple mode” binding which was activated.
I disabled it and not I have the + :slight_smile:

Ahhh the “simple mode” creates items for you and binds/links them to the Thing channels. Which is a nice option for many people.
If you check out the paperui>configuration>items tab you can see all created items.

Yes, you’re right I have everything in the items tab.
Then OK, but now how do I import all this in my .item file ?

No need for that. You can use them already.
If you press on a item inside the paperui > configuration > items tab the heading tells you the item name which can be used in a sitemap. I tried to point this out here

The name given to the item like example this one marked.

can be used in a sitemap file.

Something like this.

sitemap demo label=“My home automation” {
Frame label=“Demo” {
Text item=goal_Switch_KickerBlack_Xiaomi_BewegungsmelderStatus
}
}

Nice, I’ll try to make a sitemap file then.
Will I lose everything if I reboot ?

If this happens the openHAB community would have a lot of work to do :smiley: ( code refactoring etc. )
No, this should NOT happen, never ever what so ever.

Thanks for your help man, that’s great !

1 Like

Still if you are worried about loss of data. There is a backup function :wink:
https://docs.openhab.org/installation/linux.html#backup-and-restore
Report back if you run into trouble again :slight_smile: