I absolutely love this interface. I don’t so much love needing to run a ruby daemon and add rules to push data from openHAB. I ended up ripping out all of the ruby code and using the new SSE functionality from openHAB 2.0 to push the updates directly to the client. Doing that allows me to serve the dashboard directly from openHAB. I don’t know if there’s much interest, but if anyone wants to check it out - you can see it here: https://github.com/beowulfe/openhab-dashboard/tree/oh2
Just run ‘mvn package’ to build the artifact, and drop it in your addons folder of an openHAB 2.0 install.
I only got the weather, switch, and heating widgets working so far, as that’s all I need. Moving other widgets over wouldn’t be hard though.
Thanks @beowulfe. I have actually just installed a skeleton OH2 on a test machine to look into using SSE. Your work will hopefully save me the effort
I’ve just had a quick look at your code but haven’t had a chance to try out yet. Looking through it though, are the widgets (and also the html in the views folders) compiled in into the OH addon binary? If so, it might be better if we can keep the widgets outside of the binary so that they can be quickly modified by end users.
Yes, they’re compiled in. I build application.js at compile time instead of runtime - mostly because the only non-ruby sprockets implementations I found were node modules.
The HTML for the widgets could be kept separate, but if users need to edit the CSS/JS too, I see three paths forward:
Move application.js out of the JAR, and users need to install node and compile it themselves.
Create a Java implementation of Sprockets to build the file at runtime. I think this might not be that bad.
Figure out if the node build can be executed in Nashorn instead.
@beowulfe Each of the three options sounds better than having them compiled into the jar, which many users will not be able to do. I’ll leave it in your capable hands as to which to go for (option 1 seems quickest but again more work for end users).
Do let me know if there’s anything I can help with. Once you have a solution, I will put a link to your repo in my Readme file for OH2 users.
Changes made to get it working. I cant stress enough, that I dont really know what Im doing - have no programming skills and knowledge.
jquery.gridster.js:
change to max widget size (depends on the used grid see next point) max_size_x: 6,
application.coffee :
change to get a grid for your resolution eg 1920x1080 in my case: 192 colums @ 10px width
Dashing.widget_margins ||= [0, 0]
Dashing.widget_base_dimensions ||= [10, 10]
Dashing.numColumns ||= 192
icons:
e.g. insert data-icon="lightbulb-o" @ Ohswitch in the .erb-file
Ohswitch2:
changed background to transparent !important to get icon only in erb file leave text empty(or not)
background
I put the background image (of my floorplan) into: <div class="gridster" style="background-image:url(/assets/erdge.png);background-repeat:no-repeat;background-position:40px 40px;background-attachment:scroll;">
- not sure if there is a more elegant way to do that
In google chrome / developer tools you can change the html data-row/col and try out the positioining of the items - update your .erb file (somehow I had to sort by rows ascendending - otherwise I would get some items in completly different places then specified.)
big thanks to smar and the OH community for the dashboard
open issues:
background image isnt fading in/out when changing pages (somehow in cycleDashboards.coffee) or change position of background into a own div?
change the floorplan page to block having draggable widgets - how to?
hopefully in the near future there will be some homeautomation icons @ fontawesome
Looks great! I haven’t really looked into the issues you raise so can’t really help. However, there is a lot of information on the net on dashing in general. You may find something there or in some of the other projects that you can adapt.
Great idea - I have set this up on a Raspberry Pi, Dashing + Openhab. It looks and works like a charm.
HOWEVER: The only issue I am having is that dashing is not updating anything. If I hit refresh in the browser, all the values are updated but otherwise not.
In the openhab console + frontend I can see that all the time values are updated, in Dashing in the console I don’t see them coming in / getting there. As I said, only if I hit refresh in the browser - there are new values/readings.
Where do I start looking / What went wrong - any ideas?
Before I start digging around and trying to find out how to make this work maybe someone here has already went down this road. I would like a single Widget for the thermostat that includes temp and setpoint. Is there a way for a single widget to access multiple devices. I’ve used dashing with smartthings and they have a widget already but the thermostat is a single device in smartthings. Here is the widget if anybody is curious. https://github.com/FlorianZ/hadashboard/pull/31/files
Have a look at the Ohheating widget. It does exactly that. However, it requires a rule to combine the data from the two items into a single json string, which is then sent to the dashboard. This rule is also in the dashboard.rules file.
You need to add the rest of the weather items, especially the condition code one, as this is used to determine whether or not to post weather updates to the dashboard.
haven’t been working on my dashboard for a while (because everything works
now i realize i still miss something --> being able to look at my openhab rrd4j-charts.
i know dashing can render stylish charts but i guess making this work together with rrd4j surely is a though task.
has anyone tried to display such chart in dashing? how would i get the .png into my dashboard, as it isn’t saved anywhere but generated when opening the url?