I’ve installed OH2 a few months ago on my RPi 3 and updated it to the latest release last week, and now I wanted to get all my things to the new MQTT binding.
After reading some tutorials I understood how to create things in PaperUI, but I didn’t understand how I can get them to BasicUI, which is the UI I use for control.
Do I still have to create an .items configuration file? If yes, then I don’t understand if I have to create them in PaperUI also. If no, then I’d like to know if I refer to the PaperUI created things in my .sitemap file.
The answer is “either or”, you can use PaperUI to create and link items to your things (even automatically) or you can create the items with a file. While creating the items with a file you can link them to a Thing (or batter a channel) directly or do the linking in PaperUI.
Examples for an items file are posted in the docs.
Ummmm… I would say that this is not correct, sorry. You can create your items either using Paper UI or through manually defined .items files. Once items are defined (it doesn’t matter how you have defined them), you can create your personalized user interface for Basic UI defining .sitemap files. https://www.openhab.org/docs/configuration/sitemaps.html
But the two worlds are totally separated: items and sitemaps. The second ones are created based on the first ones, but it is irrelevant how you have defined the first ones.
Anyway I have problems integrating new things by using the PaperUI.
An example: I have a Blitzwolf switch, MQTT topic is “Blitzwolf_SHP2_02”.
With PaperUI I have configured a thing first and a channel then.
Problem is: I don’t know how to integrate it into my sitemap, what do I have to insert after “Switch item=”? Whats the items name?
Or did I fail to insert the thing itself? Are thing’s NAME and ID relevant for the sitemap?!
I have exactly the same problem/request than “Lemon”.
I tried what you say and add the following line to my mqtt.sitemap file:
Switch item=MyFancyName { channel=“mqtt:topic:SW01:INT_01” }
So that my full file is this one:
sitemap mqtt label=“MQTT”
{
Frame label=“MQTT Demo”
{
Switch item=MyFancyName { channel=“mqtt:topic:SW01:INT_01” }
} // end of Frame
} // end of sitemap
I then have a parsing error. Here is a copy of the log file:
2019-01-17 16:54:45.692 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘mqtt.sitemap’ is either empty or cannot be parsed correctly!
2019-01-17 16:54:46.877 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘mqtt.sitemap’ has errors, therefore ignoring it: [5,27]: mismatched input ‘{’ expecting ‘}’
Did your consider to take a look at the Sitemap documentation
Furthermore you have most probably selected " automated item linking" . That way items are automatically created.
Ok, seems to be clear now.
I’ve discovered that after creating the channel I have to link it and the link name will be the name I have to use in my sitemap file, in this example it will be EinsZweiDrei_Power:
Sorry, but I mixed that up, it wasn’t you stating to have no items file.
Regarding what to put into the sitemap file:
Items are needed in the sitemap file, but only the name is used. The definition of the item ( " {channel…}" ) belongs into the .items file.
The connection between the item and thing-channel is done by linking. The link has no name, you are only referring to the item.
When creating the link via PaperUI you did create an item ( with the selected name ).