Home Automation Dashboard (HAD)

Unfortunately, doing a fresh download and installation did not work.
I am logged into SSH as root and have installed the files in /etc/pydashie
I run python main.py from the prompt, and about twenty seconds go by before I start seeing the errors scrolling by.
Even while the errors are running, if I visit http://192.168.1.251:5000, it redirects me to the ST Auth page. I’m able to authorize it to control devices, and then it redirects me to the grey page.

I would suggest not running this out of the /etc folder… I would just use git to clone it to the home directory of your user ~/

once there copy the sample_oauthin.jason from the Documents folder to the ZP_PyDash folder and add your keys in and modify the url from localhost to 192.168.1.251. I think part of the problem is the fact that you are running it out of the /etc folder and it is trying to create more files.

My original location was in /home/pi, and the issue occurred there as well. :frowning:

My original install was exactly as you are suggesting.

It did create the smartthings.json file, and all files appear to have been created properly.

I’m seeing an error with CoffeeScript.
Wonder if that is the culprit.

root@raspberrypi:/etc/pydashie# python main.py
Trying to set Host URL
auth..
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 760, in run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/repeated_timer.py", line 16, in _run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/dashie_sampler.py", line 37, in _sample
    data = self.sample()
  File "/etc/pydashie/smartthings_samplers.py", line 94, in sample
    zp_st.updateDimmer()
  File "/etc/pydashie/zp_pydashie_interface.py", line 241, in updateDimmer
    allDevices['dimmer'] = smartThings.updateDimmer()
NameError: global name 'allDevices' is not defined

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 760, in run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/repeated_timer.py", line 16, in _run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/dashie_sampler.py", line 37, in _sample
    data = self.sample()
  File "/etc/pydashie/smartthings_samplers.py", line 49, in sample
    zp_st.updateColor()
  File "/etc/pydashie/zp_pydashie_interface.py", line 171, in updateColor
    allDevices['color'] = smartThings.updateColor()
NameError: global name 'allDevices' is not defined

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 760, in run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/repeated_timer.py", line 16, in _run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/dashie_sampler.py", line 37, in _sample
    data = self.sample()
  File "/etc/pydashie/smartthings_samplers.py", line 19, in sample
    zp_st.updateSwitch()
  File "/etc/pydashie/zp_pydashie_interface.py", line 165, in updateSwitch
    allDevices['switch'] = smartThings.updateSwitch()
NameError: global name 'allDevices' is not defined

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 760, in run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/repeated_timer.py", line 16, in _run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/dashie_sampler.py", line 37, in _sample
    data = self.sample()
  File "/etc/pydashie/smartthings_samplers.py", line 34, in sample
    zp_st.updateContact()
  File "/etc/pydashie/zp_pydashie_interface.py", line 177, in updateContact
    allDevices['contact'] = smartThings.updateContact()
NameError: global name 'allDevices' is not defined

Exception in thread Thread-9:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 760, in run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/repeated_timer.py", line 16, in _run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/dashie_sampler.py", line 37, in _sample
    data = self.sample()
  File "/etc/pydashie/smartthings_samplers.py", line 64, in sample
    zp_st.updatePresence()
  File "/etc/pydashie/zp_pydashie_interface.py", line 183, in updatePresence
    allDevices['presence'] = smartThings.updatePresence()
NameError: global name 'allDevices' is not defined

Exception in thread Thread-7:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 760, in run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/repeated_timer.py", line 16, in _run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/dashie_sampler.py", line 37, in _sample
    data = self.sample()
  File "/etc/pydashie/smartthings_samplers.py", line 110, in sample
    zp_st.updatePower()
  File "/etc/pydashie/zp_pydashie_interface.py", line 195, in updatePower
    allDevices['power'] = smartThings.updatePower()
NameError: global name 'allDevices' is not defined

Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 760, in run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/repeated_timer.py", line 16, in _run
    self.function(*self.args, **self.kwargs)
  File "/etc/pydashie/dashie_sampler.py", line 37, in _sample
    data = self.sample()
  File "/etc/pydashie/smartthings_samplers.py", line 170, in sample
    zp_st.updateMode()
  File "/etc/pydashie/zp_pydashie_interface.py", line 228, in updateMode
    allDevices['mode'] = smartThings.updateMode()
NameError: global name 'allDevices' is not defined

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/etc/pydashie/main.py", line 318, in javascripts
    import coffeescript
ImportError: No module named coffeescript

Try to do a sudo pip install coffeescript and see if that helps… all of the other errors are normal for the startup…

Bingo. I can now see the dashboard, though I have to state that it isn’t my dashboard. I see yours as you posted in the screenshots above.

I’m seeing KeyError on the terminal, but I suspect that is related to my devices not coinciding with the device shown on the dashboard.

Odd that reinstalling Coffee fixed it. I did reboot the Pi for the first time in over a month today before trying again so maybe it just needed a swift kick.
Thanks for the help!

1 Like

Im happy that it worked out for you! So now if the fun part of figuring out how you want to lay out your dashboard :slight_smile:

Sadly, I have a major deficit in programming skills. This includes CSS and the like.

I’ll poke at it and see what I can figure out. :smile:

At this point all of what you should have to edit is main.html and you just need to give the SmartThings device names from the apps and the device type. and for the icons take a look at: http://fortawesome.github.io/Font-Awesome/cheatsheet/ just put the name of the icon you want with out the ‘fa-’

How do I determine the “data-device=”?
Is that just the name of my device in ST?

Yup. Then ‘data-title=’ is how you want it to display on the dashboard.

Would any android tablet work for this? Here is the one I’m looking at:

http://www.amazon.com/Prontotec-Android-Cameras-Standard-G-sensor/dp/B00GD4ZCR8/ref=sr_1_12?ie=UTF8&qid=1434126882&sr=8-12&keywords=android+tablet

@florianz,

Incredible work on the dashboard! I came across it the other day, thought it was amazing, and immediately went out and bought a SmartThings Hub, and a corresponding water sensor (I picked up an IRIS-compatible one from Lowes). Hooked it up, and it worked AWESOME!

The one thing that your dashboard didn’t have was an ability to track moisture / water sensors. I noticed it hadn’t been implemented yet, so I started working on it last night, and got it working!

Basically, it tracks the events detected from the water sensors, as a status of water: [wet | dry], and updates the widget accordingly. I updated the groovy application to allow for selecting of water widgets and performing events on it, as well as added a Stmoisture widget type to add on the display.

I just submitted a pull request for you to take a look at, and merge in as you wish. Apologies as I’m fairly new to the whole git pull / squash process, so I sent you a pull request with a bunch of commits in it! Please take a look at it when you’d like. If it doesn’t work, due to all of the commits, please let me know and I can try to figure out how to squash them for you!

Thanks again for such an awesome dashboard!

1 Like

@eternalwolf,
I am extremely happy to see people contribute to git! It is always nice to see projects evolve and grow as people pitch in and add what they would like to see!

I will have to check that out and see if I can add that into my python dashboard as well. I can not thank @florianz enough for the work that you have done!

1 Like

@florianz
I am having trouble with this part:

$ heroku config:set
DASHING_AUTH_TOKEN=some-random-uuid
DASHING_URI=http://your-app-name.herokuapp.com
HEROKU_OAUTH_EMAIL=your@email.com
HEROKU_OAUTH_ID=uuid-from-above
HEROKU_OAUTH_SECRET=uuid-from-above
SESSION_SECRET=some-random-uuid
ST_CLIENT_ID=from-step-3
ST_CLIENT_SECRET=from-step-3

I have replaced the invalid values with the the things it said in the instructions, but I am not having any success… I have zero coding experience, but I seem to have gotten every step up to this point to work correctly. Like I said I have absolutely no coding experience; do I push enter after I’ve put in each line of the above code? What should happen when I’m done putting all of that information in? After a normal command, I get this after I push enter:

Adams-MacBook-Pro:hadashboard adamhelgeson$

but after I’ve finished putting in the last of the above information and hit enter, I get this:

And if I push enter again, it gives me this message:
! Usage: heroku config:set KEY1=VALUE1 [KEY2=VALUE2 …]
! Must specify KEY and VALUE to set.

I would greatly appreciate any help I can get. Thanks in advance!

Excellent! I have been looking for a reason to buy a Raspberry PI, and I like the idea of running this at home rather than in the cloud. I have the heroku version running already so will be interested to see if this runs any better (although TBH I suspect most of the wrinkles I have seen in the past have been at the ST end)

1 Like

@zpriddy - Are you using the standard Raspian install for this? Just got my Pi delivered and getting ready to dive in!

The standard raspin should work just fine. I have a habit of judging using Ubuntu when I can. I also think I may be pushing some updates later today on the code.

Cool - I have my OS install done, I’ll hold off for a couple of days before I sync.

I contributed a couple of pieces to the original dashboard - the multiple CSS pages which it looks like you have, but I also have support for a specific type of garage opener that I will port and contribute back if you are interested.

Wow… and just when I thought ST couldn’t get any better, I found this. Now I just have to decide whether to dive in or try the SmartTiles approach. HAD seems more appealing but complicated. Is it possible to install this on my own server? I don’t really like the idea of hosting my home stuff on a public free webserver like heroku. I suppose it just requires having the auth stuff set up and a working version of Ruby, which I do. Has anyone else tried this?