-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Changed Category not propagated reliably in sitemaps to BasicUI and OH-Android #3958
Comments
Please read updated documentation |
For question, community forum is a better place. |
Rewriting the sitemap to change the icon will certainly work. But I am writing here, that setting the |
Already discussed. Changing/hacking the category of an item inside a rule, even if made available by few rule engines, is not recommended and not officially supported, so you can't expect any UI to monitor this kind of hack for an immediate update in UI. Even Main UI will not support that. The official and supported way to update an item characteristics is to use the item REST API. I also implemented in 4.1 a clean solution for sitemaps to cover your use case, with a new dedicated syntax so that you can define conditional rules for your sitemap element icon. |
This is the same as for other Item config, e.g. Item metadata. That configuration is meant to be static (at least was that the result from the discussion in openhab/openhab-webui#1725). Therefore, UIs won‘t ever monitor changes to Item config, and I also doubt that unauthorized users are even allowed to subscribe to these events over SSE or WebSocket. I therefore agree to @lolodomo to close this issue, and I would also propose to rewrite the sitemap to dynamically change the icon.
Why? If it is a missing comparison operator, I am sure that someone is willing to work on that. In case there is missing functionality inside the icon rules of sitemaps, please open a new issue to openhab-webui to request that functionality for icon rules. @openhab/core-maintainers Please close this issue. |
@lolodomo and @florian-h05 have already explained why this is invalid. It is not expected to alter items this way. |
That being said and as we all agree, I am asking myself why some rule engines allow updating items in such a way ? IMHO, this is the root cause of all of this. |
Having this possibilities in the rule engines allows to programmatically create (or at least) modify Items. I mean that not in a way of dynamically changing configuration, but in a way of managing your Items. E.g. if I want to change metadata or icon for a group of Items, in can just write a simple JS script instead of having to edit each Item manually. Of course better bulk editing in the UI would help here as well, but at least for me, writing a short JS script is the fastest way to bulk edit Items. |
Yes it is. But back then manual reload was always necessary, while now sometimes manual reload is, and sometimes is not necessary - it is random. So something has improved in the meantime.
I meant rewriting to use the syntax |
I am not sure what is your actual goal with the above example, but in case you want to perform some complex calculation to decide which icon to use, you can create a new icon where you store the result of that calculation to and decide based on the state of that Item which icon to use by using an icon rule. |
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958
• insert the conclusion from openhab/openhab-core#3958 Co-authored-by: stefan-hoehn <[email protected]>
At openhab/openhab-android#3427 and openhab/openhab-webui#1938 I have asked to see updated icon, once I change the “category”. I have this
The resolution of the above items, including #3819 and #3820, was to extend the syntax for icon in sitemaps, to support
AND
,staticIcon
and others. I have updated now to OpenHAB 4.1 . I open a sitemap in two browsers and in openhab-android 3.8.1-beta.With the above
rule
I change the status of an item (e2) in one of the browsers. It appears in the sitemap asText item=e2_power label="E2" labelcolor=[e2==ON="olive", e2==OFF="orange"]
. So any time I toggle the state I expect that the label colour and the icon (category) change in the other browser and in openhab-android. I toggle the state many, many times. The label color does change reliably, every time I toggle the item.The icon however does not change reliably. Often it does change, but sometimes it does not. Moreover the behaviour of the icon is consistent in the browser (Basic IU) and in openhab-android. The only difference is that in the browser sometimes, once the icon is out of sync, on a later state toggle, the icon changes its state several times very fast, while in openhab-android I cannot observe this.
An the symptoms appears in both Basic UI and in OH-Android, the problem must be in OH-core.
The text was updated successfully, but these errors were encountered: