OpenHAB1 items in PaperUI

Maybe someone could help me here.

I have a switch item in an OpenHAB1 item file:

 Switch hof "hofschalter" ["Switchable"] {mqtt=">[mosquitto:noderf/send/arctech_switch_old::command:*:MAP(rf433.map)]"}

and want this to be “clickable” and visible in PaperUI but I do have NO CLUE how to get this done with things & channels & stuff. Would be nice if someone could help me here.

PaperUI is for configuration, you should use something like BasicUI or ClassicUI. To use this you will need a sitemap file with your items.

If using mqtt1.x binding then you only need an items file no things file or channel required. You have OpenHAB1 in your post so I assume your using 1.x mqtt binding. The latest OH version 2.4 has the 2.x mqtt binding that does use PaperUI, things, channel, etc…

I see you have an item posted but have you verified the mqtt topic is correct and working?

Sitemap Example:

home.sitemap

sitemap home label="SmartHouse"
{
	Frame label="My Switch"
	{
		Switch item=hof
        {
}

Note the sitemap file name needs to match the sitemap name,e.g. file name is “home” and sitemap name is “home”. You can change this to anything you like as long as those two names are the same.

1 Like

Thank you. So after adding home.sitemap, my “default” sitemap containing all things and items from paperUI is gone now?

Sorry, didn’t know you already had a sitemap. If that’s the case then you only need to add your item to default.sitemap and remove home.sitemap. You may need to stop OH and restart after making sitemap changes. The commands for this is:

sudo systemctl stop openhab2

sudo systemctl start openhab2

Actually I didn’t - but I guess PaperUI did generate a “default” one with all my PaperUI things and items.

Is there a way to generate a “default” sitemap containing all paperUI things with all channels?

UPDATE: The “all things sitemap” is still visible in classicui

Try adding your mqtt item to that sitemap. Note, you will need to comment out or delete the item from the other sitemap.

Now I get it (partly).

There is a _default sitemap with ALL things (generated by PaperUI itself i guess). Any idea how to get this sitemap as .sitemap file to modify?

Did you select the Demo Package when setting up OH? If so, I think that package comes with some items, things, sitemap files. Of you selected the Standard Package then all the files will need to be created from scratch.

What are you using to create and edit files in OH? You should be able to edit the sitemap file the same as any other file.

I guess we’re talking about different things here.
I do know how to edit config files, but there is a “generated” _default sitemap (but there’s no file in config folder for it).
Go to the PaperUI > Configuration > Services > ClassicUI or BasicUI
If you enter “_default” in Default Sitemap and open the BasicUI without parameter, this sitemap displays ALL things. How to get that configuration as text (file) to edit it further?

or try http://YOUR_IP:8080/basicui/app?sitemap=_default

Paper_UI

From the picture above your setting the name of the sitemap that you want to use as the default.

To edit the sitemap file you will need to connect via ssh and type cd /etc/openhab2/sitemaps then type ls to show the files inside this directory. To edit the file use sudo nano default.sitemap now you can edit the file. When done hit Ctrl + x then Enter to save the changes. If you want to only view whats inside a file, without opening an editor, use cat default.sitemap.

Also note that if you want to create a new file, then the same command is used just name it whatever you like. e.g. sudo nano home.sitemap will create a new (and empty) sitemap file that’s named “home”.

As a tip, you may want to look at setting up samba share and use VSCode with the openhab extension for editing and creating files. Makes life a lot easier.:wink:

Please just try the link I gave you (modify your openhab ip) with sitemap=_default parameter. There is no such sitemap file in openhab config dir.

Why? I’m using home as my default and have no other files in my sitemap directory.

As you mentioned there is no default file in my directory. I think that is just an example?

Moving away from the sitemap confusion, at least for now, I made a few changes to your mqtt item.

 Switch Hof "hofschalter" ["Switchable"] { mqtt=">[mosquitto:noderf/send/arctech_switch_old:command:*:MAP(rf433.map)]" }

It’s recommended to use a capitol letter to start the item name so I changed hof to Hof. Not sure what device this is so I have no idea about what the topic should look like but I removed an extra : that will likely cause an error.

NOPE - it’s not. Just try to open it. There are ALL of YOUR items in it. Just open the URL and you could see for yourself.

Thanks for modifying the switch item.

there is no file. that sitemap is generated dynamically in memory. you have to create a new sitemap file yourself.

1 Like