Switch with mappings error

Hello

I have a Problem and dont know how to get a solution …

When i add a switch with mappings to my sitemap like:

Switch item=AL_STATS  label="TestSw:" mappings=[0="Test1", 1="Test2", 2="Test2"]

I get the following error:

2017-11-07 21:27:40.625 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file '/etc/openhab2/sitemaps/whg.sitemap': null.
java.lang.NullPointerException
	at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.getAllItems(PageChangeListener.java:125)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
	at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.updateItemsAndWidgets(PageChangeListener.java:75)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
	at org.eclipse.smarthome.io.rest.sitemap.internal.PageChangeListener.sitemapContentChanged(PageChangeListener.java:217)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
	at org.eclipse.smarthome.io.rest.sitemap.SitemapSubscriptionService.modelChanged(SitemapSubscriptionService.java:277)[117:org.eclipse.smarthome.io.rest.sitemap:0.9.0.b5]
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:286)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:136)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:234)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processWatchEvent(FolderObserver.java:297)[122:org.eclipse.smarthome.model.core:0.9.0.b5]
	at org.eclipse.smarthome.core.service.WatchQueueReader.run(WatchQueueReader.java:206)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

If i remove it everything works fine …

Sorry for my bad english :frowning:

Thanks

The formatting looks correct. Could you post the rest of your sitemap file? Also, what version of OH are you using?

Hi

I use Openhabian with openHAB 2.1.0.

The system is up to date (upgrade/update)

Sitemap and Itemfiles etc. are written in nano editor so there should no formating errors like when you edit it with texteditor etc.

My Sitemap file (just a test file):

sitemap whg label="test" {
Frame label="testwhg" {
Group item=AL_STATUS label="testalm" icon="alarm"
{Switch item=AL_STATS  label="TestSw:" mappings=[0="Test0", 1="Test1", 2="Test2"]
}
Group item=Licht label="Licht" icon="light"
{Switch item=LVZ1
 Switch item=LAB1
 Switch item=LWC1
 Switch item=LBA1
 Switch item=LKU1
 Switch item=LWO1
 Switch item=LBZ1
 Switch item=LSZ1
 Switch item=LKZ1}
}}

thanks

I have reinstalled openhab now it works again …