I have visibility set on a couple items in my sitemap. One is a temperature value setting that is only visible when the cooler is turned on. That works great, as soon as you click to turn on the cooler the temperature setting shows up.
I want another app to set a variable which then affects visibility, and it does, but the sitemap has to be interacted with. That is, click back a page and then to the same spot again and it has updated visibility. I can’t see to get visibility to update dynamically on the same page when the item is changed via script. Any thoughts?
Yea, tried setting the item based on a chron rule with the same result. The sitemap doesn’t change until you move away from that page and go back.
Both in the browser and android app.
Version 1.8.0
I was hoping to show a simplified page with security camera feed links for only those cameras that report motion. Hiding those that don’t seemed like the best way, but you have to refresh or move around.
If I update visibility via a door sensor, both clients show the update right away.
Odd that they don’t with timer based rule setting switchitem (that I made just for testing), and they don’t when setting an item via external script.
Do real physical items hit the bus differently than those that only exist in OH?
I can’t think of a reason that a state update for a Contact item vs. a Switch item should be handled differently in the client. Could you make your external script change the state of a test Contact item (using OPEN or CLOSED) instead of the Switch item, to see if you still observe different handling?
Contact items do not accept commands, because you can’t command a door contact to open the door. But you can tell a contact item to update its state to OPEN or CLOSED.
The CMD servlet only sends commands to items; to instead update the item’s state, you would have to use the REST API.
If your rule calls something like postUpdate(item, CLOSED), you see the state change in the UI for that item, but visibility isn’t changed for other widgets that have visibility= referencing that Contact item, then that would show that there is no special-case logic that distinguishes between Contact and Switch item updates.
Could you open issues in github, per client, that report that visibility= does not work unless there is user interaction? An example sitemap, items file, test rule, etc., would be very helpful there.
I’ve noticed the same problem with a contact item which is updated using postUpdate in a rule. In the android client it refreshes fine after a few seconds but if I add a visibility option it does not refresh unless I close the app and restart. Did you find a fix for this?
UPDATE
For some reason it is now working! Weird because I did not change a thing…perhaps something goes on behind the scenes when you first create items???