[SOLVED] HABPanel sluggish

these are the bindings that I am using on 2.4 (habpanel-filter and habpanel): https://www.dropbox.com/s/hy8kb2laphliqbn/openhab2-addons.zip?dl=0
I will try building habpanel 2.5 this weekend (good luck to me with that … hurray the mvn black magic)

to use: simply copy to the addons folder and you are almost done - just add items that you wish to use in the habpanel to the group named ‘Group_HabPanel_Dashboard’ (and do not forget to create the group itself). There is no need to add items that you won’t be displaying (meaning you can still use any items that you would be sending commands to in habpanel without adding them to the mentioned group).

let me know if there are any questions.

@arctus from my review and understanding of the rest API a call to [GET] [/items/{itemname}] when called to a group item will return all items which are part of that group in addition. So I am curious why the additional need of the custom rest api binding?

From my review this could actually be a very good solution. Modify the HABpanel loadItems(){} function to make a call to a user configurable groupname. This way all the user needs to do is create the group in there items and then add the items to that group? Am i missing something?

function loadItems() {
            $http.get('/rest/items/$insertvariblegroupnamehere')
            .then(function (data) {
                if (angular.isArray(data.data)) {
                    console.log("Loaded " + data.data.length + " openHAB items");
                    $rootScope.reconnecting = false;
                    $rootScope.items = data.data;
                    if (!liveUpdatesEnabled) registerEventSource();
                } else {
                    console.warn("Items not found? Retrying in 5 seconds");
                    $rootScope.reconnecting = true;
                    $rootScope.items = [];
                    $timeout(loadItems, 5000);
                }
                $rootScope.$emit('openhab-update');
            },
            function (err) {
                console.warn("Error loading openHAB items... retrying in 5 seconds");
                $rootScope.reconnecting = true;
                $timeout(loadItems, 5000);
            });
        }

Bigger problem is not loading the items but the event stream. The addon also does filter events that happen for the items present in the group. It also filters device changed and update events thus reducing processing power required for javascript on habpanel side.

2 Likes

Ah that’s what i was missing.

1 Like

i have succeeded in building habpanel, so updated the zip file (https://www.dropbox.com/s/hy8kb2laphliqbn/openhab2-addons.zip?dl=0) with 2.5 version of the habpanel. Enjoy and do let me know if it helped you!

2 Likes

I’ve downloaded the file and tried it on 2.4 and get the following

I downloaded the 2.4 version this afternoon but seems the 2.5 and the 2.4 are the same.
Once I out the jars in the addon folder it breaks HP all together. :slight_smile:

Any chance of getting a specific 2.4 version please?

Hi @arctus,

I just installed your modded habpanel but it does not work for me (I am on the latest snapshot #1689).
When opening Habpanel in a browser it states “Connection lost, trying to reconnect” and the log is flooed with the following error message

2019-09-15 21:29:46.859 [INFO ] [er.internal.web.FilteredItemResource] - Received HTTP GET request at 'items-filtered'

2019-09-15 21:29:46.870 [WARN ] [org.eclipse.jetty.server.HttpChannel] - /rest/items-filtered

javax.servlet.ServletException: javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoSuchFieldError: editable

Any idea?

@CDriver these are the libraries I use personally on 2.4 and they work without any problems: https://www.dropbox.com/s/6jgqktsqo8ix1ka/habpanel-2.4.zip?dl=0
@Chrishab it seems there were too many changes to openhab after my last compilation for 2.5, these are the libraries compiled for latest snapshot: https://www.dropbox.com/s/2mpdydkzxprrs3b/habpanel-2.5.zip?dl=0

3 Likes

Thanks. I’ll try this evening.

Thanks for this @arctus. Would it be possible to have the filter group name as a user-defined parameter? Maybe via paper UI?

It is possible, but as this was done mainly for me - I did not bother much :slight_smile: If this plugin gets recognition, we can make this as a parameter.

1 Like

That would be great.

BTW, I am still getting the connection lost message using your latest files, running on 2.5.0M3.

It should!

The latest version of this (it is the first, that i tried) does not work for me… I´m on oh 2.5 snapshot #1665 (i made update at 19.08.2019).

I get an empty habpanel. I added all of my lights to this new group. And the habpanel with my lights on it also was empty.

just to confirm, you are using both the files from the zip: habpanelfilter and habpanel? Also, when you say empty - do you mean that habpanel does not even show any html markup, just empty screen? If it does not show the markup, that means it is not connected to the habpanel that I provided - if it would not work, you won’t see any values for the items, but html markup would still be visible.

Is this a constant message or habpanel works, but this message just appears from time to time?

1 Like

Constant message. Habpanel does not show any items. I just get the panel selection screen. Putting the original habpanel jar into the addons folder immediately brings all items and panel layouts back again (albeit with the usual performance issues)

thanks, are there any javascript issues in the development menu?

Thanks and yes, the following are constantly repeated:

Error loading openHAB items… retrying in 5 seconds openhab.service.js:64:25

Error: [sprintf] expecting number but found string b.format@http://openhab:7070/habpanel/vendor/vendor.js:365:1026 b@http://openhab:7070/habpanel/vendor/vendor.js:365:117 @http://openhab:7070/habpanel/vendor/vendor.js:536:91 recurse/<@http://openhab:7070/habpanel/vendor/vendor.js:255:77 s/c<@http://openhab:7070/habpanel/vendor/vendor.js:130:277 l/<@http://openhab:7070/habpanel/vendor/vendor.js:128:439 $digest@http://openhab:7070/habpanel/vendor/vendor.js:144:320 $apply@http://openhab:7070/habpanel/vendor/vendor.js:147:363 l@http://openhab:7070/habpanel/vendor/vendor.js:99:194 K@http://openhab:7070/habpanel/vendor/vendor.js:103:376 tg/</N.onload@http://openhab:7070/habpanel/vendor/vendor.js:104:338

This one is definitely not mine.

Btw, what do you get when you go to http://youropenhab:8080/rest/items-filtered (replace your openhab with your openhab address)? Did you see any problems when installing habpanelfilter addon?