[NEEDS UPDATING] Home Automation Dashboard (HAD)

This is fantastic. Would it be possible to run this on a local server instead of a heroku app? If so, what software would be required?

You can run a server locally by simply calling dashing start from the hadashboard directory. You might have to call bundle before to invoke the bundler, which will make sure that all the dependencies are installed on your local machine.

You will have to have a static IP address for your server and open up the relevant ports, in order for the SmartApp to be able to make HTTP requests to your server to communicate with the Dashing backend.

Also, you will still need to set up the environment as per the instructions posted on the GitHub website… just locally instead of via Heroku.

Can dashboards be linked together with buttons? If we were to create multiple dashboards can we link to them via buttons ?

Yes, you will have to create a new widget, but you can take the Reload widget as a template. In the CoffeeScript file, do:

onClick: (node, event) ->
 window.location.href = 'http://your-app-name.herokuapp.com/dashboard-name'

This will redirect the browser to the new dashboard when the user interacts with the widget.

Thanks @florianz I can’t say enough how awesome of an idea this is so much going through my brain right now it’s on overload. I can’t wait to see more widgets for power, temp changes, motions, presence sensors.

I have been banging my head on this for long enough. Any idea what’s wrong with this? I’ve never used Coffeescript before:

class Dashing.Stmeter extends Dashing.Widget
  constructor: ->
    super
    @observe 'value', (value) ->
      $(@node).find(".stmeter").val(@queryState).trigger('change')

  @accessor 'value', Dashing.AnimatedValue

  queryState: ->
    $.get '/smartthings/dispatch',
    widgetId: @get('id'),
    deviceType: 'power',
    deviceId: @get('device')
    (data) =>
      json = JSON.parse data
      @set 'value', json.value

  ready: ->
    Stmeter = $(@node).find(".Stmeter")
    Stmeter.attr("data-bgcolor", Stmeter.css("background-color"))
    Stmeter.attr("data-fgcolor", Stmeter.css("color"))
    Stmeter.knob()

I know the SmartApp code is good because I was getting the value fine previously but something in trying to get it into the meter widget is not working. I just copy/pasted the meter folder into an stmeter folder and renamed things were appropriate. I believe my error is somewhere in the stmeter.coffee code.

I believe you need to change that to val(value). The property value is where you really get your value from. You can call the queryState method in the line before to prime the value, but don’t forget the empty parenthesis. Coffeescript does not allow for omitting parenthesis on methods that don’t take any arguments. Semantically, that would mean you want to get to the function pointer (or whatever the CoffeeScript equivalent :wink: )

Try this code:

class Dashing.Stmeter extends Dashing.Widget
  constructor: ->
    super
    @queryState()
    @observe 'value', (value) ->
      $(@node).find(".stmeter").val(value).trigger('change')

  @accessor 'value', Dashing.AnimatedValue

  queryState: ->
    $.get '/smartthings/dispatch',
    widgetId: @get('id'),
    deviceType: 'power',
    deviceId: @get('device')
    (data) =>
      json = JSON.parse data
      @set 'value', json.value

  ready: ->
    Stmeter = $(@node).find(".Stmeter")
    Stmeter.attr("data-bgcolor", Stmeter.css("background-color"))
    Stmeter.attr("data-fgcolor", Stmeter.css("color"))
    Stmeter.knob()

Alright, I finally got it. Essentially I believe the problem boiled down to spacing in Coffeescript and how exceedingly important it is, which I’m not used to, but I could be wrong.

Seems like weather takes a little while to update? All of my screenshots are immediately after I’ve opened the dash, but you’ll notice most of them don’t have updated weather/forecast info.

Next I’d like to get my presence sensors up there as well.

@florianz, let me know if you’re interested in me creating a pull request for some of this. Obviously it’ll include some stuff that is custom to my application, so you can pick and choose what you include but the important bits are the widget, smartapp, and the main.erb, but the widget is called like any other so the erb isn’t THAT important.

Got a presence widget now. I think I’m getting carried away, hah…the wife is beginning to get annoyed with me. Might be it for a little while.

@florianz I downloaded the immersive app and got things mostly working in Firefox on a Nexus 7 I have. Obviously not mounted or anything, just playing with it. Is there something I’m missing with the address bar and removing it? It seems like a random series of events including salt throwing gets it to hide, but I’m not sure what is doing it yet.

@bmmiller are you going to share the widgets you’ve created? I found that by creating a desktop icon for the favorite that it opens full screen, well sometimes it doesn’t hide the android title bar but it always hides the address bar.

Here is mine, doesn’t look as fancy as yours.

I will absolutely share what I have done, i just would prefer to incorporate it into the existing codebase, so I need some input from @florianz to get that done.

There are a few things that get changed and/or added so it’s more complicated than just copy/pasting a few lines of code here, unfortunately.

Creating a shortcut to the app on the home screen doesn’t seem to have any effect for me. There must be some other setting I don’t have set that you do.

EDIT: I added a small bit of code to application.coffee which prevents movement of the widgets on mobile devices. I don’t know about you but it was pretty darn annoying. I also am now using a Fullscreen add on for Firefox in conjunction with the Immersion app and fullscreen seems to be working pretty well now.

I got this running but one of my motion sensors (AeroSense) is not giving a temperature. The ID is configured, and its authorized and it reads a temp within Smartthings but not on the dashboard. Anyone ever see this?

EDIT: Seemed to be fixed when I renamed the device

It has to support the device.temperature attribute. If there is something special about that particular sensor and device type that doesn’t inherit ā€œtraditionalā€ temperature classes, then it’ll probably have an issue.

I’m not familiar with the AeroSense, what device type are you using for it?

Another question: the weather isn’t updating. Is there a specific SmartApp to install to get the weather to update?

It usually takes a few minutes for the weather to update, just wait it out. On another note, I had to remove my code that prevent widget movement on mobile devices. It seems to have caused a lot of flakyness on switches causes double presses and such.

Been waiting for a bit but will continue :slight_smile:

Well, it isn’t using a 3rd party service to get weather directly. It is using SmartThings built in functions to call the outside service instead so it’s an extra hop. It keeps the data sources consistent, but introduces some delay where there doesn’t have to be. Different methodologies whether it makes sense to go direct or through SmartThings, neither is really right or wrong.

I’m stuck at this point (Step 5), can anyone help?

The backend periodically pushed the weather information to the widget every 15 minutes. It may take up to 15 minutes to fill it in the first time after you (re)started the backend. There are ways to improve this, but so far I haven’t found a particularly satisfactory one. I may give the weather widget some more love in the future.

The widget pulls the weather through SmartThings, because they have a license for Wunderground API access. I have found Wunderground to be by far the most accurate weather service in my area. Your milage may vary. However, Wunderground access is not free (except for low volume requests and limited data). SmartThings is already paying for the service to be used by third-party apps. Might as well take advantage of that.

There are a few other weather widgets available for Dashing, if you want to try one of those.

Try:

$ git config --global push.default simple
$ git push heroku master