[SOLVED] HABPanel sluggish

I’m not sure I ever thanked @arctus for this. It has definitely transformed the use of Habpanel for me.
Thank you!

2 Likes

Question does installing this erase created panels or custom widgets? If so how do you backup your panels prior to installing. Really want to try this out but don’t want to lose my panels.

No. You’ll be OK.
Handy to make sure a backup anyway.

@ysc - have you decided to merge the code yet?
Seems a game changer to me

As much as I appreciate the need for a solution and the fact that this one is working for some, my position is still this:

It simply cannot be merged as-is - in an add-on classified as a “HABPanel filter” binding, providing filtering capabilities to members of a hardcoded group and expose it as an alternative API - because it has virtually no chance of getting past a review by the add-ons maintainers:

  • First, on a conceptual level, it isn’t the purpose of a binding to provide an extension to the API. Of course it can be reclassified as a “misc” add-on but…
  • Second, they will likely say (rightfully) is that what needs to be done instead is to add/extend generic filtering capabilities to the existing API, for example as additional parameters to the rest/events endpoint (currently we’re only able to filter events by topic), then HABPanel and others can be modified to use it.

I have however merged two PRs recently which are supposed to improve the perceived performance, without changing the backend. You can download the .jar from the CI server (or use the latest distro snapshot) and report back if they help a little and more crucially if you see regressions, especially right after switching dashboards.

1 Like

Thanks you for the fantastically verbose and on point response - you are a legend.

I agree with you on the point of filtering against the API - especially on the hardcoded grouping. I do however feel that HabPanel could do with a native ability to fire requests straight against the API without a need for event tracking and status updates (I actually got onto this discussion, because I am trying to code an AV remote (Custom widget: Direction buttons) that uses Openhab as the backend for posting instructions to devices. (AngularJs http 'Get' in a function, hosted in HabPanel)

My exact scenario is that I want to be able to scroll through a menu quickly (down, down, down, down, down, down, down,) as button clicks on my remote and have every single click processed by Openhab, - If I send a series of down instructions to the API using Powershell, or Curl, they are all happily processed, but if I try button clicks in HabPanel, I miss about half of the clicks - I have several hundred items in my config, which I know doe snot help.

sadly, my AngularJS is terrible - else I’d build a script function on my ‘remote’ in HabPanel, that simply sends whichever click I am sending, straight to the old school API, rather than rendering it through the HabPanel refresh / event engine.

I don’t know the architecture beneath HabPanel, I am not quite sure why an instruction takes long to process - but if we are unable to amend the API for information gathering, it would still be nice to enable some extension to HabPanel that allows stateless execution of certain instructions? (e.g. a button click that is used for scrolling down a menu does not need any event tracking, as long as the selection on your TV screen changed?)

Irrespective, thanks for the hard work, I’ll try your enhancements for now, to see how much improvement they make.

If you’re doing things like ng-click="sendCmd('item', 'cmd')"in your widget it shouldn’t be relevant how many items you have, all it does is send the command request. You should open the developer tools of your browser, and check on the Network tab (and the Console) what’s happening, and how much time a request takes.
maybe replacing ng-click with ng-mousedown can help too.

Thanks again Yannick,

I have had a quick play and noticed something. I initially assumed that it was HabPanel that slows me down, but instead it looks like what is happening is that the browser on my iPhone is actually skipping the clicks.

If I hit a button 10 times in a row on my phone, it registers in my Openhab logs only 5 times - if I do the same on my mouse (from a remote PC) I seem to get all 10 clicks.

It seems that the browser on my phone somehow suppresses the multiple clicks? I assume that it is trying to prevent the screen zooming but treating the second click as an attempted double click(which it then ignores) I have to look into this - just not sure where to start.

This link demonstrates the issue - you’ll see only every second click register when using an iPhone (https://codepen.io/juliogcampos/pen/BzdjwY).

OK - so reading through the link:

I see it as saying that no code change is required for use to get fast click functionality in IOS - using the current HabPanel - yet I am clearly missing something, since I am unable to get fast clicking working?

Where to find this addon?

Do I miss something?
Even on the brand new OH 2.5 stable I don’t see any habpanel-filter addon.

there is no such official addon, it is build custom by me. link for download is somewhere in the thread above both for 2.4 and 2.5.

Thanks!
Found it on Post 27 (dropbox).

Do I need both habpanelfilter and ui-habpanel or can I use the official ui.habpanel from s.5 stabel as well?

EDIT:
Sorry, never mind… :smiley:

Does this work with nested Groups as well?
(I would like to put all required Groups into the Group_HabPanel_Dashboard)

It does work for groups, but it does not forward any nested groups. All required items/groups need to be marked by the Group_HabPanel_Dashboard.

Alright - thanks a lot for this solution!
I am really keen on seeing my (slow) tablet at home showing up the panel lightning fast :wink:

If I would have a wish, I would like to choose a custom Group name (like G_HabP).
But that’s just nice-to-have

:slight_smile: yes, there are some plans, unfortunately they are all on hold because of my tight schedule. :frowning:

Don’t worry. :slight_smile:
I greatly appreciate your efforts!

It seems, that even with filtering, my Habpanel still loads all items.
When comparing
http://OH-IP:8080/rest/items-filtered
with
http://OH-IP:8080/rest/items?recursive=true
it’s a 1/6 th of the full items list.
The Webbrowser Debug still mentiones “items” are loaded and it takes 6 seconds.

In the details of the items analysis I see items, which are not in the group Group_HabPanel_Dashboard
Do I need to activate this somewhere?
(I just copied the two addons in the addons folder and don’t use the officcial habpanel of the 2.5 stable release)

EDIT:
Damn, I am an idiot. I called the “static” webside.
After using
http://OH-IP:8080/habpanel/index.html#/view/Home
it mentiones items-fltered

However, it’s still slow.

Which brings me to another feature request :slight_smile:
2 (or more) independent filter groups (one for my phone, which is fast enough), one for the wall tablet (which is slow and just requires a few items)

Well, it appears to not work at all in 2.5 release.
I just upgraded from 2.4 to 2.5 and copied the files for 2.5 release (albeit SNAPSHOT)

I drop them in the addons folder and wait. HABPanel breaks totally. Red message Lost connection.
Paper UI is also broken with Jetty Not ready yet.

I removed them, stopped OH, cleared cache and tmp and restarted. Everything back to normal albeit slowerer :frowning:

Any chance of an upgraded version for 2.5?