Dashboard UI suitable for tablets

I need some help. In short, my widgets are not updating.

When I click on an OHswitch, for example, everything works fine. But when I turn the actual light on (or if I turn on/off the light from the openhab app itself) the dashing widget will not update unless I reload the page. The weird part is, my time and weather widgets are working fine.

There are no error messages in the log file, it says that the changes are posted, but they only show up in the browser then I reload the page.

What i’ve tried so far:

  1. deleting and reinstalling the openhab-dashboard

  2. deleting and reinstalling dashing

  3. changing the whole setup so that only one openhab item is sent to dashing (a random demo button)

  4. setting up a new dashing dashboard and sending it curl requests just to make sure dashing was working…it is

  5. tried from chrome, safari, firefox and the browser on my raspberry pi

  6. restarted the raspberry pi

  7. restarted the computer

What can I do? Can anyone help me?

Hi all,

I´m also using and adapting this nice dashboard for my purposes.

I extended the OHtext widget by mappings. For example:

`

  • ` In the above example, the mode piped to dashing is a numeric value between 0 and 3. Based on the attribute data-map="..", the widget shows the according text.

    However, an error is raised if no mapping was found and the dashboard will not work anymore.

    If anybody is interested, the widget can be downloaded here:
    https://dl.dropboxusercontent.com/u/20189963/ohtext.zip

    BR
    André

    @Jonathan_Dunn1: I ditched my OpenHAB-dashboard project, but I remember having to set it to ‘subscribe’ to a group of which the items must be members, if their states are to be ‘pushed’ to the dashboard. The OpenHAB rule that is supplied with the project must correspond with that group.

    …you didn’t explicitly mention replacing/reinstalling the rule…

    Hey thanks for the reply! Why did you ditch the project? its so awesome!

    I’ll try replacing the rule, but I thought that if I just put the items in gDashboard group, the rule will push them to dashing. Also, I dont think the problem is on the openhab side. Dashing records that the changes, they just dont show up on the board until i reload the browser.

    Try enabling the logInfo in the openhab rule for dashing, and make sure that the rule is being triggered each time that an event occurs in openHAB. This is where the state updates are pushed from openHAB to dashing.

    When I turn my dining room light on and off with the openhab app, for example, this is what I see in the log

    127.0.0.1 - - [10/Jan/2016 17:40:14] “POST /widgets/DiningRoomScene HTTP/1.1” 401 16 0.0056
    127.0.0.1 - - [10/Jan/2016 17:40:25] “POST /widgets/DiningRoomScene HTTP/1.1” 401 16 0.0043

    But these changes are only represented in the widget when i reload the browser

    Continuing the discussion from Dashboard UI suitable for tablets:

    No, I meant remove the comment marker from the dashboard.rule file. If you look about a third of the way down that file, you’ll see:

    //logInfo("Dashboard","Dashing group rule triggered.")

    Remove the // so that the line reads:

    logInfo("Dashboard","Dashing group rule triggered.")

    There are another two logInfo lines towards the end of the file. These should also have their comment markers removed if present.

    Save the rule file and then see what your logs show when an update happens.

    Ah, got it. Done. This is what shows up in openhab when I turn on a switch:

    2016-01-11 09:27:45.198 [DEBUG] [.myopenhab.internal.MyOHClient] - on(): request
    2016-01-11 09:27:45.200 [DEBUG] [.myopenhab.internal.MyOHClient] - Got request 40326
    2016-01-11 09:27:45.201 [DEBUG] [.myopenhab.internal.MyOHClient] - {“content-length”:“3”,“accept-language”:“en-us”,“host”:“my.openhab.org:443”,“content-type”:“text/plain”,“accept-encoding”:“gzip, deflate”,“accept”:"/",“user-agent”:“openhab-cloud/0.0.1”}
    2016-01-11 09:27:45.203 [DEBUG] [.myopenhab.internal.MyOHClient] - Request method is POST
    2016-01-11 09:27:45.204 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header content-length = 3
    2016-01-11 09:27:45.205 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header accept-language = en-us
    2016-01-11 09:27:45.206 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header host = my.openhab.org:443
    2016-01-11 09:27:45.207 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header content-type = text/plain
    2016-01-11 09:27:45.208 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header accept-encoding = gzip, deflate
    2016-01-11 09:27:45.209 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header accept = /
    2016-01-11 09:27:45.210 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header user-agent = openhab-cloud/0.0.1
    2016-01-11 09:27:45.222 [DEBUG] [.io.net.http.SecureHttpContext] - security is disabled - processing aborted!
    2016-01-11 09:27:45.223 [DEBUG] [.myopenhab.internal.MyOHClient] - Transport.EVENT_REQUEST_HEADERS
    2016-01-11 09:27:45.238 [DEBUG] [o.i.r.i.resources.ItemResource] - Received HTTP POST request at ‘items/JDHome’ with value ‘OFF’.
    2016-01-11 09:27:45.245 [DEBUG] [m.r.internal.engine.RuleEngine] - Executing rule ‘Post changes to Dashing Dashboard’
    2016-01-11 09:27:45.250 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Date = Mon, 11 Jan 2016 14:27:45 GMT
    2016-01-11 09:27:45.251 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header X-Atmosphere-first-request = true
    2016-01-11 09:27:45.253 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header X-Atmosphere-tracking-id = 2eff54a8-38f3-4eb8-9b1c-a5773208d706
    2016-01-11 09:27:45.254 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Expires = -1
    2016-01-11 09:27:45.256 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Cache-Control = no-store, no-cache, must-revalidate
    2016-01-11 09:27:45.256 [DEBUG] [m.r.internal.engine.RuleEngine] - Executing rule ‘Post changes to Dashing Dashboard’
    2016-01-11 09:27:45.257 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Pragma = no-cache
    2016-01-11 09:27:45.258 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Location = https://my.openhab.org/rest/items/JDHome/state
    2016-01-11 09:27:45.260 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Content-Length = 0
    2016-01-11 09:27:45.262 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Server = Jetty(8.1.3.v20120522)
    2016-01-11 09:27:45.262 [DEBUG] [o.o.i.m.i.MyOpenHABServiceImpl] - store(JDHome), state = OFF
    2016-01-11 09:27:45.266 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty finished receiving response header
    2016-01-11 09:27:45.269 [DEBUG] [.myopenhab.internal.MyOHClient] - Sent headers to request 40326
    2016-01-11 09:27:45.271 [DEBUG] [.myopenhab.internal.MyOHClient] - Transport.EVENT_REQUEST_HEADERS
    2016-01-11 09:27:45.272 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty request complete 40326 with status 201
    2016-01-11 09:27:45.275 [DEBUG] [.myopenhab.internal.MyOHClient] - Finished responding to request 40326

    Your log indicates a 401 error. That’s ‘not authorized’:

    127.0.0.1 - - [10/Jan/2016 17:40:14] "POST /widgets/DiningRoomScene HTTP/1.1" 401 16 0.0056
    127.0.0.1 - - [10/Jan/2016 17:40:25] "POST /widgets/DiningRoomScene HTTP/1.1" 401 16 0.0043
    

    I would guess that’s where this comes from, too:

    2016-01-11 09:27:45.222 [DEBUG] [.io.net.http.SecureHttpContext] - security is disabled - processing aborted!
    

    Something changed there, like a token? :wink:

    Hi,
    firstly thx for the cool ui.
    I am a noob at html, css and so on and would need some pointers.

    I use a 14inch tablet with 1920x1080 and would like to show the Dashboard centered and zoomed fullscreen. Where need I make adjustments for that?

    thx in advance.

    hi,

    in opt/dashboard/assets/javascripts/application.coffee you find the following lines:

    Dashing.on ‘ready’, ->
    Dashing.widget_margins ||= [5, 5]
    Dashing.widget_base_dimensions ||= [145, 157]
    Dashing.numColumns ||= 7
    Dashing.cycleDashboards({timeInSeconds: 0, stagger: true, page: 1});

    contentWidth = (Dashing.widget_base_dimensions[0] + Dashing.widget_margins[0] * 2) * Dashing.numColumns

    now you can calculate the dimensions you need to fill your 1920 x 1080 screen and change the values.
    in my example its 5px margin on all sides of a widget… adding that to the dimensions (145px wide and 157px high) a widget is 155px x 167px effectively. that multiplied by 7 columns and in my case 4 rows --> 1085px x 680px

    thanks a lot - fixed it

    another question: How do I change the Icon size. For example the dimmer plus/minus?

    hi,

    “font-size” in opt/dashboard/widgets/ohdimmer/ohdimmer.scss:

    .secondary-icon {
    position: absolute;
    bottom: 0px;
    font-size: 25px;
    width: 32px;
    color: #888888;

    &.plus {
      right: 24px;
    
      i {
        padding-top: 10px;
        padding-left: 30px;
      }
    }
    
    &.minus {
      left: 8px;
    
      i {
        padding-top: 10px;
        padding-right: 30px;
      }
    }
    

    }

    you might have to adjust the left, right and padding values too.

    Thanks for all of your help. My auth_token wasn’t the same between the openhab rule and the config.ru file. Now I don’t get the 401, but its still not updating on the dashboard unless I refresh the browser. This is what I get now

    openhab log 2016-01-13 14:52:12.873 [INFO ] [openhab.model.script.Dashboard] - URI: http://localhost:3030/widgets/SandraHome; JSON = {“auth_token” : “103082”, “state” : “ON”}
    2016-01-13 14:52:13.087 [DEBUG] [g.openhab.io.net.http.HttpUtil] - About to execute 'http://localhost:3030/widgets/SandraHome
    2016-01-13 14:52:15.731 [DEBUG] [.myopenhab.internal.MyOHClient] - on(): request
    2016-01-13 14:52:15.735 [DEBUG] [.myopenhab.internal.MyOHClient] - Got request 19005
    2016-01-13 14:52:15.737 [DEBUG] [.myopenhab.internal.MyOHClient] - {“x-atmosphere-framework”:“1.0”,“accept-language”:“en-us”,“x-atmosphere-tracking-id”:“0”,“host”:“my.openhab.org:443”,“accept-encoding”:“gzip, deflate”,“user-agent”:“openhab-cloud/0.0.1”,“accept”:“application/xml”}
    2016-01-13 14:52:15.738 [DEBUG] [.myopenhab.internal.MyOHClient] - Request method is GET
    2016-01-13 14:52:15.739 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header x-atmosphere-framework = 1.0
    2016-01-13 14:52:15.740 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header accept-language = en-us
    2016-01-13 14:52:15.741 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header x-atmosphere-tracking-id = 0
    2016-01-13 14:52:15.742 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header host = my.openhab.org:443
    2016-01-13 14:52:15.743 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header accept-encoding = gzip, deflate
    2016-01-13 14:52:15.744 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header user-agent = openhab-cloud/0.0.1
    2016-01-13 14:52:15.745 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty set header accept = application/xml
    2016-01-13 14:52:15.750 [DEBUG] [.io.net.http.SecureHttpContext] - security is disabled - processing aborted!
    2016-01-13 14:52:15.751 [DEBUG] [.myopenhab.internal.MyOHClient] - Transport.EVENT_REQUEST_HEADERS
    2016-01-13 14:52:15.762 [DEBUG] [.r.i.resources.SitemapResource] - Received HTTP GET request at ‘sitemaps/home/home’ for media type ‘null’.
    2016-01-13 14:52:15.764 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
    2016-01-13 14:52:15.769 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
    2016-01-13 14:52:15.775 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
    2016-01-13 14:52:15.778 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
    2016-01-13 14:52:15.783 [DEBUG] [o.u.i.items.ItemUIRegistryImpl] - Cannot retrieve item null for widget org.openhab.model.sitemap.Frame
    2016-01-13 14:52:15.975 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Date = Wed, 13 Jan 2016 19:52:15 GMT
    2016-01-13 14:52:15.977 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header X-Atmosphere-first-request = true
    2016-01-13 14:52:15.978 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header X-Atmosphere-tracking-id = 220b745d-24f8-4c99-b6d3-301152714240
    2016-01-13 14:52:15.979 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Expires = -1
    2016-01-13 14:52:15.979 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Cache-Control = no-store, no-cache, must-revalidate
    2016-01-13 14:52:15.980 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Pragma = no-cache
    2016-01-13 14:52:15.981 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Content-Type = application/xml
    2016-01-13 14:52:15.982 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header X-Atmosphere-Timeout = 300
    2016-01-13 14:52:15.984 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Content-Length = 4576
    2016-01-13 14:52:15.985 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received header Server = Jetty(8.1.3.v20120522)
    2016-01-13 14:52:15.986 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty finished receiving response header
    2016-01-13 14:52:15.988 [DEBUG] [.myopenhab.internal.MyOHClient] - Sent headers to request 19005
    2016-01-13 14:52:15.989 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty received response content of size 4576
    2016-01-13 14:52:15.990 [DEBUG] [.myopenhab.internal.MyOHClient] - Sent content to request 19005
    2016-01-13 14:52:15.991 [DEBUG] [.myopenhab.internal.MyOHClient] - Jetty request complete 19005 with status 200
    2016-01-13 14:52:15.993 [DEBUG] [.myopenhab.internal.MyOHClient] - Finished responding to request 19005

    dashing log

    10.0.1.90 - - [13/Jan/2016 14:52:04] “GET /events?lastEventId=&r=351700980681926 HTTP/1.1” 200 - 60.2419
    127.0.0.1 - - [13/Jan/2016 14:52:13] “POST /widgets/SandraHome HTTP/1.1” 204 - 0.0034
    10.0.1.90 - - [13/Jan/2016 14:52:45] “GET /events?lastEventId=&r=5213862599339336 HTTP/1.1” 200 - 30.1344

    Hi torsteinsunde,

    i noticed, that you put the sunrise and sunset time into the clock widget.
    Would you please be so kind to tell me how to do that? I was playing arround with the clock widget to do so, but didn’t get it to work.

    Thanks in advance,
    Daniel

    Just love this dashboard. I have 3 cheap KOBO 7HD tablets ($50 a piece) wall mounted.
    I wanted to do something regarding always plugged in so I came up with the following and it works great. I already use MQTT on my linux server for inbound/outbound arduino messages.
    Using Tasker, I downloaded the MQTT plugin for it, set it up to send MQTT the battery level every 2 minutes.
    Then in OpenHab I set an item for the battery level, and an item for the charger (a Zwave plugin dimmer in fact).
    Set up a rule to read the battery level and turn off the charger if charge > 98 and turn it on if < 10. This way the charger isn’t on all the time causing battery issues later on.
    Was also thinking about sending the %TEMP from the tablet, which would give me local temp from where the tablet is but these cheap tablets don’t seem to have that ability.
    I want to combine/build the dashboard itself out a bit too. I have it set up pretty basic but there is so much you can do with it.

    Norm

    @Jonathan_Dunn1 The logs seem to show that the rule is posting the message as expected. If as you said in an earlier post, posting updates to dashing using curl work fine, then I’m not sure what else to suggest. May be try again using curl but this time posting exactly what the log is showing as its json and url (using copy/paste to ensure that everything is kept exactly the same), i.e: post to http://localhost:3030/widgets/SandraHome the json payload {"auth_token" : "103082", "state" : "ON"}

    OK so I followed your advice, and something very strange happened. I curled a command to a switch (lets say AwayMode) and it immediately showed up on the dashboard. But then after that, that widget started working (even when I changed it within openhab). What I ended up doing was using curl for every widget and my dashboard works now! I have no idea why this is the case though. Any ideas?

    It sounds as if your sendHttpPostRequest action is failing. As far as I am aware, this should be a pre-defined action built in to the runtime and so should not require anything special. Maybe try creating a test rule with just a static sendHttpPostRequest post (again, maybe copied and pasted from your previous post) and try triggering that rule (e.g. via a test switch). Put logging in before and after calling the post command. Also you can try running openHAB in debug mode and see if there is anything related to the http post action showing up.