Dashboard UI suitable for tablets

@karsten_kaiser_1971 how is the performance on the raspberry pi?

@smar - the weather items do not have to be added to gDashboard group in openhab because there is a job that refreshes every five minutes, correct? (it wasnā€™t clear in the readme)

@apatel Yes thatā€™s correct.

In theory we could have used the gDashboard group but then we would then have to hack the openHAB rule so that it collated all the weather items and formed a json string for the whole set, which it would then have to post to the dashing weather widget. As weather updates are not that time sensitive, I decided to keep the openHAB rule clean, and just use the 5 minute scheduler.

EDIT: Updated the Readme as well!

Great thanks, makes perfect sense. This seems to me to be the most appropriate approach.

havent it up and running so far. still suffering with the installation and getting the startup script running. When i have it live will let you know,

@smar sorry to keep pestering you with questionsā€¦butā€¦

do you know if dashing loads all of the widgets in the widgets folder, or calls them when needed? The reason I ask is that in anticipation of moving this to a rapsberry pi, iā€™m thinking of ways to improve performance on a system with limited/fewer resources.

I have this running on my Ubuntu 14.04 desktop, and running other apps, seeding, etc, it feels a little sluggish as is. i.e. responsiveness from the tablet to dashing to openhab and back. (openhab is already running on an rPi and plan to put dashing on a second rPi that i have).

Once setup, I plan to disable most of the logging, and that should help. Any other thoughts on performance improvements?

@apatel No problem at all - please do ask whatever you need to know.

WRT dashing widgets, from what Iā€™ve read I think that the widgets are only loaded once they are defined in a dashboard and that dashboard is loaded in a client. Logically also it wouldnā€™t make sense for them to be loaded before they are defined in a dashboard as then they wouldnā€™t have their widget IDs by which dashing/batman.js could track and moreover, they may be missing required parameter bindings etc.

I am running it on a an Ubuntu 14.10 server, which is itself running in a virtual machine (under esxi 6) on a HP Microserver Gen 8. The HP box is also running at least 4 other (linux based) VMs at any given time (pfSense firewall with caching proxy, Open Media Vault nas, Logstash and Zabbix). There are other VMs running from time to time.

My dashboards are VERY responsive. There is no lag that I nor my family have noticed. Until your post, I had just assumed that dashing was very light on resources and hence itā€™s responsiveness. My brother also has a similar set up, and again he does not experience any lag. In fact, I have configured his dashboard for him over the internet many times, and the dashboard responsiveness has been very good even over the internet.

In the first instance, I would suggest monitoring the performance on both your Ubuntu box and the rPi, whilst you are using the dashboard. I would start using a simple top command and monitor CPU/memory (Iā€™m assuming your disk storage is ok). I would then open shells and monitor logs on all the systems at the same time, and try to see visually if there is any lag in the events/messages getting through.

Also I havenā€™t tried openHAB on an rPi, but from what Iā€™ve read it seems as if this can be sluggish unless you have the latest hardware. Could this itself be your bottleneck?

You could also check the responsiveness of dashing itself by sending curl commands from a shell, first from the Ubuntu system and then from the rPi (examples are on the dashing page under API). That will hopefully highlight if there are any performance issues on this aspect.

Hope the above gives you some ideas to start from.

My first test was also to use a raspberry pi.
What about using a docker container?

Which files are needed by dashing?

config.ru /dashboards /widgets

anything else?

I havenā€™t tried putting together a docker container, but donā€™t see any issues - should be relatively straight forward.

I suspect though that you will need all the dashing related files and folders and not just the few youā€™ve listed. Certainly assets, dashboards, jobs and lib are also required which more or less makes it all the dashing default install folders.

First, thank you for all your suggestions. I think the sluggishness was due to a combination of a few factors including: 1) I was running tail -f on the openhab logs on the rPi whilst I was testing. . iā€™m using a LG gPad 7, and frankly, its not that great performance wise, but was only $100 bucks; 3. I had recently replaced my wifi router (used as an AP) with a new one, and some how my main cisco sg-300 lost its role as root-bridge.

With some network clean up, itā€™s much better than before on the gPad and it quite responsive on my Tab S2. So i think iā€™m good for now.

As a complete aside, I took your Ohdimmer widget and created a new called Ohdimmer2 that uses a horizontal slide bar to set the lights. The left 40% is a switch for on/off and the right side is the slider. The code is probably terribly inefficient and not very elegant, but Iā€™m not nor have ever been a programmer (two months ago, iā€™d never written a single line of html/css/ruby/jQuery and its been over 10 yrs since I was forced to a semester of Java in college). I would greatly appreciate any feedback to improve it / make it better, as I find it to be a useful feature.

https://drive.google.com/file/d/0B2wRI0BstQFtenk1cGZuRktjM2c/view?usp=sharing

in the items file, i created a simplified dimmer item for the lights used:

Dimmer office_light (gDashboard) { hue=ā€œ7;brightness;2ā€ }
Dimmer livingRoom_light (gDashboard) { hue=ā€œ8;brightness;2ā€ }

And these are the items in default.rb

  <div data-id="livingRoom_light" data-view="Ohdimmer2" data-title="Living Room Floor Lamp" data-device="livingRoom_light"></div>

for the the init.d script in the /service file: at the top of the file in the comments sections, the instructions say:

$ sudo cp dashboard /etc/init.d/

which should read:

$ sudo cp dashing /etc/init.d/

for that and everything else. I guess the easy thing is just to rename the file to dashboard.

EDIT: also, for anyone copying over the entire directory, they need to run bundle first before doing anything, to install the missing dashing dependencies.

1 Like

What he said, took me a min but I finally was able to get all of my errorrs to stop. The only thing is now nothing shows. When starting Dashing I see in terminal that it is pulling my information however I am not getting anything but a blank screen when going to the dashboard. I donā€™t see any errors so Iā€™m not sure what is causing this. Anyone able to point me in a direction to see why nothing is displayin. Is it because I am using the default file and I dont have any of those items? I am really looking forward to getting this installed.

Also another thing when I tried to just copy the directory I was missing things like do_postgres and do_sqlite3 which I needed to do sudo apt-get install sqlite3 before running bundle. I kept getting an error otherwise. Looking forward to seeing all the things this will let us do.

Iā€™ve tried only placing just weather which I know is pulling and still do not see anything. When doing a Inspect Element in Chrome I am getting this error:

Cannot read property ā€˜prototypeā€™ of undefined
Connection opened Event {}

Are you seeing they grey background? If so, I suspect something is off in one of the coffee scripts thatā€™s not allowing it to compile properly. If you go into inspect element in Chrome, did you see any errors in the console section at the bottom?

@apatel Good to hear youā€™ve got your performance issues resolved. Had a quick look at your slider dimmer - excellent work for a non-programmer!! I had a few issues with the label not showing, so I moved the title outside of the div you had defined and put it above the slider. I also increased the width of the icon section so that the round circular on/off switch is centered in its panel. Certainly a nice style, and something you could extend to the other switch types for consistency. Great to see you taking this forward :smile:

Thanks for pointing out the service script notes issue. Iā€™ve just corrected this (this is what happens when you cut/paste from many sourcesā€¦).

@Robert_Burgess Normally when Iā€™ve seen empty dashboards, itā€™s because of either an error in my dashboard layout or an error in a coffeescript. You have to be very careful with indentations in the coffeescript as well. I had an extra indentation in a script which made the whole dashboard fail.

I suggest you start with a very simple dashboard, maybe the original one that I gave in the repo. You should see the dashboard even if you donā€™t have the items defined in your openHAB (they just wonā€™t do anything). Also make sure you are using all the files from the repo to start with without any changes, as we know that they are from a working system. Only make changes to the openHAB server settings. That will hopefully limit the number of areas to check for further issues.

Yes itā€™s the gray screen and I get the error I posted below. I can look at the coffee script but what exactly would I be looking for. Also I received the same issue when I tried to use the directory in the repo. I havenā€™t actually modified the cofeescript but I removed everything from the dashboard file and just placed in a clock and weather to try and go from there.

Are you using original files from the repo? Maybe worth downloading again, and starting clean, just to make sure that no inadvertent errors have crept in.

I will do so when Iā€™m in front of my computer again a quick question I see coffee mentions batman but I have no batman.js file. Guess that isnā€™t part of the download

That should have been installed along with your main dashing install. Mine (on Ubuntu) is in the folder /var/lib/gems/2.1.0/gems/dashing-1.3.4/javascripts/batman.js

This is just what I was looking for to setup on a tablet. I was able to get it up and I can see all the default dashboard. Iā€™m trying to get Wunderground working first but it doesnā€™t seem to be updating so Iā€™m thinking there is a problem with it connecting to openhab. I copied all the Wunderground weather items and they work fine in openHab. I updated my server settings in lib/ohapp.rb and didnā€™t modify auth_token. Iā€™m thinking maybe since i have security enbled on openHAB its not connecting correctly. Does anybody have any suggestions on where to start troubleshooting or configs I may need to add?

So its definately related to the security. I turned it off and Weather started updating. I prefer not to leave it off since I have openHab accessible from the outside. Does anybody have a sample of what configs I need to change to have dashing connect to a security enabled openHab?