Mapping of item values not correctly shown in HABpanel

Message for HABpanel author: please develop/justify your need in the issue I opened for you in git.

Done.

Hi, since this was a common and recurring issue, I finally resorted to query the API when an item’s state with a transformation applied changes.

Here’s a summary of the changes:

  • There is an additional API query each time the item’s state is updated, but only when for items having a transformedState. If you have a frequent update on items with transforms you might experience some performance issues;
  • Dummy widgets and switches display the transformed (i.e. mapped) state if available;
  • The itemState (formerly itemValue) function in templates also now returns the transformed state by default, unless you set the new second parameter to true i.e. itemState('Item_With_Map', true). Use the raw state in conditions like ng-if without the transformation if possible.

Remember you need to have an openHAB version including @lolodomo’s PR, that is, snapshot 849 or newer.

2 Likes

Where can i find this new snapshot 849, is this a habpanel snapshot?
Or is lolodomo’s PR something else?

Where can this snapshot be downloaded

Is it here ?
https://openhab.jfrog.io/openhab/libs-snapshot-local/org/openhab/ui/org.openhab.ui.habpanel/2.1.0-SNAPSHOT/

That is the runtime snapshot.

You need in addition to that the habpanel snapshot:
https://openhab.ci.cloudbees.com/job/openHAB2-Bundles/lastSuccessfulBuild/org.openhab.ui$org.openhab.ui.habpanel/

A simple uninstall/install again via PaperUI should do it.

1 Like

I uninstalled my previous habpanel, and trye’d to update in Paper UI, but there is only 2.0.0, so I installed the 2.1.0 from your link.
But it still not showing my mapping correctly

do i need to do something more, about itemState/itemValue, I haven’t done anything to my Items only upgraded the habpanel.

Check via karaf which version of habpanel is active:
222 | Active | 80 | 2.1.0.201706022154 | HABPanel User Interface

ng-if="itemState('Gate_Show_OC',true)==2"

works fine for me.

If you are on the stable (2.0.0) openHAB2 runtime release, the new function won’t work.
You need to have the openHAB2 snapshot (2.1.0) release …

Summary: openHAB2 snapshot release newer than #849 (current is #938), habpanel snapshot release newer than about seven days ago.

I don’t know what to do with this ng-if=“itemState(‘Gate_Show_OC’,true)==2”

where do i put this in ??

I have the 2.0.0 stable OH2 version on my openhabian, I will try installing the 2.1.0. in openhabian config.

???

If that contact always shows OPEN, you have a different problem.
Please describe in detail what is not working …

I have the same problem with a doormagnet, I will try to install the new OH2 unstable version later today

I dont know where to put this code ng-if=“itemState(‘Gate_Show_OC’,true)==2”

do I need to put the code in Habpanel or Items or some place else?

In a habpanel template … if you are using that.
As I said earlier: you may have a problem not related to habpanel at all …
Do your items update in BasicUI or ClassicUI?

I am using dummy items to show the status on the magnet contacts, could you show a screendump there to put the code in?

My items shows correct value in BasicUI and ClassicUI

My code is not for the standard widgets (dummy, …), but for a template widget.

The dummy widget should report the mapped state as well if it exists.
@zamzon try http://youropenhab:8080/rest/items/your_item_name in your browser and look for a transformedState value.

I updated to the OH unstable 2.1.0 and installed Habpanel in Paper UI

216 | Active    |  80 | 2.1.0.201706022154     | HABPanel User Interface

that did the trick thanks

Hi
I have problems with my habpanel on my ipad mini 1 ios 9.3.5 (the newest for ipad mini 1).
After upgrade to OH2 2.1.0 Build # 941 and habpanel 2.1.0.SNAPSHOT.

I can’t view templates, they appear only as gray fields
on my iphone and PC it works

@zamzon I reported this here. A fix is in the works.

1 Like