openhab / org.openhab.ui.habmin

HABmin - a graphical user interface for openHAB 2
231 stars 92 forks source link

Habmin sitemap : not triggering events #180

Open aschor opened 8 years ago

aschor commented 8 years ago

In my item, I have created a simple switch : "Switch testSwitch"

in my sitemap, also a very simple declaration : " Switch item=testSwitch"

then a rule (I'm learning ...) :

rule "test" when Item testSwitch changed or Item testSwitch received command or Item testSwitch received update then logInfo("test :",testSwitch.state.toString() ) end

however, playing with the switch will never trigger anything, nothing gets logged. Going to PaperUI, and playing there triggers the actions

polarathene commented 8 years ago

I just ran into this myself. Been troubleshooting for the past day a KNX binding, I got everything working but the UI, turns out this is due to HABmins sitemap, classical UI sitemap(http://localhost:8080/classicui/app?sitemap=knx_sitemap) works as expected. I am unable to test elsewhere as I don't know the sitemap url for UI like Paper UI. I have not found documentation on how to create things that UI does not support adding(KNX 1.9), this would supposedly work.

/openhab/conf/items/knx.items: Switch knx_desk_light "Ceiling Lamp" { knx="<0/0/3" }

/openhab/conf/sitemaps/knx_sitemap.sitemap:

sitemap knx_sitemap label="KNX Sitemap"
{
    Frame {
        Switch item=knx_desk_light label="Desk Lights" mappings=[1="ON", 0="OFF"]
    }
}

Using cURL as follows works: curl --header "Content-Type: text/plain" --request PUT --data "ON" http://localhost:8080/rest/items/knx_desk_light/state

When viewing sitemap UI in HABmin2, I have my switch and toggling it on/off does not seem to affect the KNX address. When I trigger it via a physical switch openHABs log picks up on it, so communication read/write seems to be fine, just the UI is not updated and does not trigger a state change to the group address?

More info on community forum post here.

cdjackson commented 8 years ago

Sitemaps aren't something I've spent a lot of time on yet since there is currently no OH2 sitemap concept and I don't want to spend too much time trying to get it working on the old OH1 system.

polarathene commented 8 years ago

What is the approach for controlling devices with HABmin2 instead? Dashboard? I've not found it easy to figure out how to use that yet. I use the KNX 1.9 binding, which doesn't seem to be OH2 supported with creating things, no HABmin2 UI pages seem to assist with manual creation of items/things, I've been able to create my knx.cfg, knx.items, knx.sitemap files and use the binding, but I've not had much luck finding information on how to create .things which Paper UI seems to require, and I guess HABmin2?

sihil commented 7 years ago

Also just been bitten by this, spent a good hour experimenting with my first sitemap in order to set a new virtual switch. Eventually thought to try it on an existing switch to find it was habmin rather than my virtual switch. Classic UI worked fine.

Not sure what the replacement is in OH2, but in the meantime I wonder if you (@cdjackson) would consider making it clear in HABmin that WIP features (such as this or the scheduler) are not well tested? Maybe a warning banner or alternatively hide them from view entirely unless a "here be dragons" preference is set.

HABmin is a victim of it's own success, the first parts I used worked so well that it has taken me by surprise when I started using a part of HABmin that wasn't as polished!