Website Displays Poorly - Doesn't Send Commands - Items/Sitemap Problems?

Hey guys,

I started with OpenHAB a few days ago. I bought a few different z-wave things but to get started all i’m trying to do is control two dimmable light switches (Linear WD500Z-1). I’m using a Gen5 Z-Stick if that matters. I had some issues with downloading corrupt .jar files that took me a while to figure out but I finally got everything set up. I can see my zwave devices in HABmin and they show up in the log. I seem to be having problems with the website as well as sending commands and receiving updates.
Edit: I should add that OpenHAB correctly determines the state of my switches when it starts up. I just can’t control them and the status doesn’t change when I hit the switch on the wall.

Here’s my items file:

Group All
Group gGF (All)
Group GF_Bar “Bar” (gGF)
Group Lights (All)
Dimmer Light_GF_Bar_West “Computer” (GF_Bar,Lights) {zwave=“2:command=SWITCH_MULTILEVEL” }
Dimmer Light_GF_Bar_East “Bar” (GF_Bar,Lights) {zwave=“3:command=SWITCH_MULTILEVEL”}
Switch LightSW_GF_Bar_West “ComputerSw” (GF_Bar,Lights) {zwave=“2:command=SWITCH_MULTILEVEL”}
Switch LightSW_GF_Bar_East “BarSw” (GF_Bar,Lights) {zwave=“3:command=SWITCH_MULTILEVEL”}

Here is my sitemap:

sitemap default label=“Main Menu”
{
Frame item=GF_Bar label=“Lights” {
Group item=GF_Bar label=“Ground Floor [%S]” icon=“groundfloor” {
Slider item=Light_GF_Bar_West switchSupport
Slider item=Light_GF_Bar_East switchSupport
Switch item=LightSW_GF_Bar_West
Switch item=LightSW_GF_Bar_East
}
}
Frame {
Slider item=Light_GF_Bar_East label=“Bar [%S]” icon=“light” switchSupport
Slider item=Light_GF_Bar_West label=“Computer [%S]” icon=“light” switchSupport
Switch item=LightSW_GF_Bar_East
Switch item=LightSW_GF_Bar_West
}
}

Here is my (very verbose) log - sorry for formatting, i’m not sure what the best way to upload a huge log is.

the state placeholder should be written in in lower case, please try [%s] in all labels.

fyi: the labels can be set in .items file, you don’t need to define them in .sitemap, though you can, if you need the very same item with different labels, e.g. one frame per room -> label shows “Light Ceiling” and another frame for all lights -> label should show “Light Ceiling Kitchen” and so on…

Thanks for the tip!

I edited my items file to include the [%s] and took the labels out of the sitemap. It’s still broken though :(. Maybe it’s not the items or sitemap after all?

Here’s my items:

Group All
Group gGF (All)
Group GF_Bar “Bar” (gGF)
Group Lights (All)
Dimmer Light_GF_Bar_West “Computer [%s]” (GF_Bar,Lights) { zwave=“2:command=SWITCH_MULTILEVEL” }
Dimmer Light_GF_Bar_East “Bar [%s]” (GF_Bar,Lights) { zwave=“3:command=SWITCH_MULTILEVEL” }
Switch LightSW_GF_Bar_West “ComputerSw [%s]” (GF_Bar,Lights) { zwave=“2:command=SWITCH_MULTILEVEL” }
Switch LightSW_GF_Bar_East “BarSw [%s]” (GF_Bar) { zwave=“3:command=SWITCH_MULTILEVEL” }

Sitemap:

sitemap default label=“Main Menu”
{
Frame item=GF_Bar {
Group item=GF_Bar icon=“groundfloor” {
Slider item=Light_GF_Bar_West switchSupport
Slider item=Light_GF_Bar_East switchSupport
Switch item=LightSW_GF_Bar_West
Switch item=LightSW_GF_Bar_East
}
}
Frame {
Slider item=Light_GF_Bar_East icon=“light” switchSupport
Slider item=Light_GF_Bar_West icon=“light” switchSupport
Switch item=LightSW_GF_Bar_East
Switch item=LightSW_GF_Bar_West
}
}

The switch image appears broken, the links don’t do anything, and it says Loading… at the top. Any idea why that’s happening?

it seem that you edit the sitemap file yourself and not with HabMin :slight_smile:

Try:
sitemap default label=“Main Menu”
{
Frame label=“Bar” {
Slider item=Light_GF_Bar_West switchSupport
Slider item=Light_GF_Bar_East switchSupport
Switch item=LightSW_GF_Bar_West
Switch item=LightSW_GF_Bar_East
}
Frame {
Slider item=Light_GF_Bar_East icon=“light” switchSupport
Slider item=Light_GF_Bar_West icon=“light” switchSupport
Switch item=LightSW_GF_Bar_East
Switch item=LightSW_GF_Bar_West
}
}

an if this works try to edit the sidemap in habmin.

Haha, I’ve been doing a bit of both to be honest. It was HABmin that added the “switchSupport” bit and i’m not exactly sure what it does.
Anyway, I found something interesting in the log when I try to click the On/Off button:

It seems to be getting some kind of null reference exception?

Should I just delete my sitemap and start over? Maybe try the demo again (which was working at some point)?

2016-03-31 14:41:25.497 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2016-03-31 14:41:25.498 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2016-03-31 14:41:25.494 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2016-03-31 14:41:25.501 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2016-03-31 14:41:25.529 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2016-03-31 14:41:25.535 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2016-03-31 14:41:25.536 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
2016-03-31 14:41:25.543 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame

edit: I tried the sitemap you gave me and no dice.

Hi,

the switchSupport is explaint in item switchSupport. may be you can leave it :wink:
Yes make a new sitemap with habmin and sometimes it dosn’t work to assign a item to a sitemap-group or -frame, try without them .

BR
Hubertus

It works! Well, the UI anyway. It appears to be sending commands (according to the log), too. It’s hard to know if the lights are on or off in reality because i’m remoting into my home computer from work and SSH’ing into the PI lol. At least it updates the light status when I restart OpenHAB. I will try that after lunch.

I restarted OpenHAB and the lights are on!! Any idea why it’s not updating? Is there a polling setting somewhere or what?

Sometimes … wait a minute. OH updates the states after startup - normaly no polling is needed.
OR! you define a persistenze for the items (e.g. everyChange/everyUpdate AND restoreOnStartup) then OH will remember and reload the state.