Items and sitemap files undiscovered by OH

Hello,
I’m fairly new to OpenHab2, but frankly amazed but the great job done so far. As a very beginner, I’m just trying to read/set wifi status from my internet box.
I have a python script that I can use to do this, and it’s working on command line basis.

  1. I installed exec binding
  2. I created item file (/etc/openhab2/items/wifi.items)

Switch livebox_wifi "WiFi" {exec="OFF:./sysbus.py sysbus.NMC.Wifi:set Enable=True Status=True, ON:./sysbus.py sysbus.NMC.Wifi:set Enable=False Status=False"}
3. I created sitemap file (/etc/openhab2/sitemap/nbonniot.sitemap)

    `sitemap nbonniot label="Nicolas" {
         Switch item=wifi
      }`

But I can’t even found my sitemap on Basic UI (even when I try to force it with ?sitemap=nbonniot). Item does’nt show up in PaperUI neither…

I’m a bit lost for this start, what am I missing? Thank you very much for your leads.

Cheers,

Nicolas

You have several ways to open your sitemap:

http://docs.openhab.org/configuration/sitemaps.html

Either you go to
PaperUI -> Configuration -> Services -> UI -> BasicUI (or ClassicUI) -> Configure and set your sitemap name “nbonniot” as "Default Sitemap"
or you just call the following urls:
http://<ip_of_your_server>:8080/classicui/app?sitemap=nbonniot or
http://<ip_of_your_server>:8080/basicui/app?sitemap=nbonniot

and it should be
/etc/openhab2/conf/sitemaps/nbonniot.sitemap

Thank yuo for your quick answer ! 2 remarks

  1. I didn’t created the pathes I mentionned. An ls -la on /etc/openhab2 shows
    drwxrwxr-x 2 openhab openhab 4096 Jan 6 14:40 html
    drwxrwxr-x 3 openhab openhab 4096 Jan 6 14:40 icons
    drwxrwxr-x 2 openhab openhab 4096 Jan 9 18:37 items
    drwxrwxr-x 2 openhab openhab 4096 Jan 6 14:40 persistence
    drwxrwxr-x 2 openhab openhab 4096 Jan 6 14:40 rules
    drwxrwxr-x 2 openhab openhab 4096 Jan 6 14:40 scripts
    drwxrwxr-x 2 openhab openhab 4096 Jan 9 11:09 services
    drwxrwxr-x 2 openhab openhab 4096 Jan 9 18:18 sitemaps
    drwxrwxr-x 2 openhab openhab 4096 Jan 6 14:40 sounds
    drwxrwxr-x 2 openhab openhab 4096 Jan 9 18:11 things
    drwxrwxr-x 2 openhab openhab 4096 Jan 6 14:40 transform

Could you confirm me I have to had a “conf” folder ?

  1. I tried the differents steps you provided regarding sitemap, and my sitemap still missing. BUt if everything should go in conf folder, it’s a solid lead.

Could you confirm me thoses pathes?

CHeers,

Nicolas

No, it’s a typo from @sihui. The correct config directory path is: /etc/openhab2/ (just like your folder structure)

In your original post, the path is wrong: /etc/openhab2/sitemap/nbonniot.sitemap.
It should be: /etc/openhab2/sitemaps/nbonniot.sitemap (sitemaps subdirectory). (most likely a typo also :))

Then, go to PaperUI → Configuration → Services → UI → Basic UI → Configure → Default Sitemap and set your sitemap there (note: case sensitive!)

Check also within your .sitemap file the first line that you set:

sitemap My_Map label="My_Map"

THank you for your highlights !
I followed every step and still have “There are no sitemaps available.” on Basic UI first screen. To sumup :

  • I have a sitemap in /etc/openhab2/sitemaps/nbonniot.sitemap. Content :
    sitemap nbonniot label=“Nicolas” {
    Switch item=wifi
    }

  • I have an item file in /etc/openhab2/items/wifi.items. Content :
    Switch livebox_wifi "WiFi" {exec="OFF:./sysbus.py sysbus.NMC.Wifi:set Enable=True Status=True, ON:./sysbus.py sysbus.NMC.Wifi:set Enable=False Status=False"}

THe sitemap still not found, therefore no items displayed. Should I restart OH or something after editing items/sitemap? Do you see anything else that could be wrong?

THanks for your time,

Nicolas

No need to restart OH2. It will re-read the config file and post an entry in the log (check /var/log/openhab2/openhab.log) after you save the sitemap file.

Check file permissions maybe (chown openhab:openhab nbonniot.sitemap)

I can’t see any other possible error… you are doing it correctly :slight_smile:

Just in case (but it shouldn’t be needed): Add a Frame section in your sitemap content:

sitemap nbonniot label="Nicolas" {
	Frame {
		Switch item=wifi
	}
}

Actually not. I’m using the manually installed distro and there you have a /conf folder. :slight_smile:
And because @nbonniot did not tell which version (manual or apt) he is using, the answer got wrong, sorry.

1 Like

Sorry if I didn’t mentionned important details : I used apt packaged installation. It’s interessant to notice there is a folder architecture linked to the installation process. Is there any reason?

I guess that is because of certain files belong to certain folders in a Linux environment.
With a manual install that would be hard to implement so it’s all in one folder …
You may also look at “File Locations” in
http://docs.openhab.org/installation/linux.html#file-locations

@Dim : I tried to add the Frame key, no effect. I noticed strange thing now : even if I remove my sitemap from the default one in Configuration / Services, I still have the welcome message indicating that no sitemap is available.

As a sidenote, I added Yahoo Weather Binding and the 3 items available : temp, pressure and humidity. On events.log, things seems good :

2017-01-10 08:09:08.777 [ItemStateChangedEvent ] - WeatherInformation_Temperature changed from -2 to UNDEF
2017-01-10 08:09:08.807 [ItemStateChangedEvent ] - WeatherInformation_Humidity changed from 80 to UNDEF
2017-01-10 08:09:08.838 [ItemStateChangedEvent ] - WeatherInformation_Pressure changed from 1008.00 to UNDEF
2017-01-10 08:10:03.932 [ItemStateChangedEvent ] - WeatherInformation_Temperature changed from UNDEF to -2
2017-01-10 08:10:03.980 [ItemStateChangedEvent ] - WeatherInformation_Humidity changed from UNDEF to 80
2017-01-10 08:10:04.021 [ItemStateChangedEvent ] - WeatherInformation_Pressure changed from UNDEF to 1008.00

Unfortunately, on openhab.log, last things arrived yesterday. no trace for my sitemap addition trial. if I try to tail -f openhab.log, nothing appears when I CRUD items files in /etc/openhab.items.

Side questions :

  1. Where is stored the default sitemap? (I could try to duplicate it and modify it)
  2. Is there any way to check my openhab install integrity? I used apt so I shoud be OK but seems not.

THanks !

What happens if you activate the demo package with a demo sitemap and demo-item-files etc.? Can you get this one to go?

Other than that, I could only imagine that something is broken with your installation. Since it is relatively fresh, you might think of installing new from scratch, maybe using openHABian, since this is the most secure option to get a working installation.

Thanks for your reply,
I will finally reinstall all and use openHabian if I have to. Before doing this, how can I activate demo package after 1st launch? As stated in /etc/openhab2/services/addons.cfg, the package variable seems to be read once only on startup.

Thanks !

Nicolas

Hmmm… haven’t ever tried this before. In another topic a user has given this hint:

**
Go to /userdata/etc/org.openhab.addons.cfg and edit
package = standard (or whatever you have chosen on 1st install) to
package = demo, then restart openHAB -> never tried that but should work.
**

Maybe you can also find some informations here:

http://docs.openhab.org/configuration/packages.html

Thanks that worked for the demo package. All demo seem loaded correctly, I will start from here and let you know.

NIcolas

1 Like