Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection and Switch (with mapping) don't trigger an update #35

Closed
gersilex opened this issue Dec 1, 2014 · 6 comments
Closed

Selection and Switch (with mapping) don't trigger an update #35

gersilex opened this issue Dec 1, 2014 · 6 comments

Comments

@gersilex
Copy link

gersilex commented Dec 1, 2014

Hi there!

Selection and Switches with mappings should trigger an update (GET sitemap). Currently one has to reload the whole page (push back and re-select Text Item or Group)

Reproducable:

  • Add Switch (with mapping) or Selection to Sitemap
  • Use mapping=[0="foo", 1="bar"]
  • Create Colorpicker Item with `visibility=[switchitem==0]
  • Use openhab.android to switch the state. The page will not update until you leave and reenter the page.

Sitemap:

        Text label="Lichter" {
            Selection item=AACC_modus mappings=[0="Aus", 1="Farbspiel", 5="Tageslicht", 4="Farbe"]
            Colorpicker label="Eigene Farbe" item=Light_Leroy_LED visibility=[AACC_modus==4]
        }

This works fine and almost-instant in the ClassicUI on the PC. I'm willing to contribute with moderate coding skills, if you can lead me to the right files.

EDIT: This seems to be an Android OS related issue, as this happened in the ClassicUI as well (from the same device). Obviously the device did not receive the changes that were pushed (or broadcasted?) to it. Today it works well. But I restarted the runtime and my Android 4.4.4 device. So I can not really tell the reason. At least more people seem to have this issue.

Will keep track of it and post updates on this.

@belovictor
Copy link
Contributor

Which version of openHAB do you use? I'm afraid this is a long known problem with long-polling updates on item changes in the openHAB itself. Also can you please check if it works for you on widgets overview page in demo mode?

@belovictor
Copy link
Contributor

I'm closing this as there is no response.

@gersilex
Copy link
Author

Sorry, I didn't see the last mail. I can tell you from my last experiences, that this happens when the sitemap model gets refreshed after configuration changes.

It does only happen on specific changes but unfortunately I still don't know which ones. Restarting the openhab runtime fixes the problem in every case.

As the issue comes from another problem, this can remain closed.

@aaronsutton
Copy link

This issue is still present and is the single reason why I don't use openHAB daily. Switches with mappings just won't update. How can I fix this? I'm not incredibly savvy when it comes to coding related stuff, but I would love to get this resolved!

@gersilex
Copy link
Author

I think I found the reason for this:

For me, it breaks always if I have changed the "items" model file. After dynamically reloading the items model by openhab (my file refresh interval is set to 10 seconds in the openhab.cfg), all bindings will get removed from all the items (therefore closing tcp connections, serial connections, etc.) and re-added.

After this happened the long-polling seems to be broken. Reloading the page (or using openhab.android's "clean cache" menu item) shows the correct status then.

So if you change your items model, be sure to restart openhab. You could also create a script which monitors the file and restarts openhab. I can give you a quick snippet, if you using it on linux.

@aaronsutton
Copy link

Thanks for the tip, but unfortunately this doesn't resolve the issue. I haven't changed the items file in months and restarted about 10 times yesterday. I am running openHAB on ubuntu 14.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants