SmartThings + Raspberry Pi & Homebridge = Siri HomeKit Controlled Smart Home

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Otto-Mate
    Founder
    • Jan 2004
    • 882

    SmartThings + Raspberry Pi & Homebridge = Siri HomeKit Controlled Smart Home

    Here’s everything you need to get Siri controlling your Samsung SmartThings, Philips Hue lighting and Sonos using a Raspberry Pi running Homebridge. Automated Home reader (and media producer) Paul Gale takes us through his step-by-step guide finishing up with a rather impressive seasonal smart home video...



    M.
    Editor AutomatedHome.co.uk


    www.facebook.com/AutomatedHomeUK
    www.twitter.com/ottomate
    www.instagram.com/automatedhome/
  • Mavis
    Automated Home Ninja
    • Oct 2014
    • 322

    #2
    Wow! I guess I am buying myself a Raspberry Pi for Christmas. And it just so happens I have some time off work over Christmas. I have talked for a while about learning programming such as Python and whilst I bought a book, I haven't actually opened it yet. But as I have got some of the kit anyway and I will get an outcome to aim for what is there to lose.

    Comment

    • SiliconPixel
      Automated Home Sr Member
      • May 2007
      • 52

      #3
      Hi All,

      If you find any issues, omissions or mistakes in my guide, please let me know - it's the first time I've created a guide like this!

      There's also the SmartThings forum where I got most of the info from here:

      Hello. I am new to the community. I am trying to get this working (Homebridge) and no luck. I’m trying to install in Ubuntu 15.4 but there must be something I’m missing. Does anyone have this working on Ubuntu? If so, can you please spell out the steps needed to make it happen.


      Paul.

      Comment

      • SiliconPixel
        Automated Home Sr Member
        • May 2007
        • 52

        #4
        go for it! It's fun

        Comment

        • Mavis
          Automated Home Ninja
          • Oct 2014
          • 322

          #5
          Originally posted by SiliconPixel View Post
          go for it! It's fun


          Am I best off getting the Pi Starter kit or can the components be bought cheaper separately?

          Comment

          • SiliconPixel
            Automated Home Sr Member
            • May 2007
            • 52

            #6
            Originally posted by Mavis View Post


            Am I best off getting the Pi Starter kit or can the components be bought cheaper separately?
            I have three Pi's now and have bought kit and separately - for this project I bought the bits separately as it's about £5 ish cheaper that way and I don't need yet another HDMI cable etc. Just Board, case, memory card and PSU. This is what I bought:






            £45.55 total.

            But if you want an HDMI cable etc, it might be worth getting the kit.

            This one has WiFi and heat sinks too - quite good value I think:

            Last edited by SiliconPixel; 14 December 2015, 11:18 AM.

            Comment

            • Mavis
              Automated Home Ninja
              • Oct 2014
              • 322

              #7
              Right, here we go - this will be my blog on getting a simplified setup as a noobie.

              I bought my Pi from the above link but bought the Ultimate Starter Kit (just in case I need any of the extras in the future.)

              Connected my Pi up with an Ethernet cable and a mini USB keyboard that I already had for an Android box. No problems putting the Pi in its case, (contrary to the reviews on Amazon.) as I watched the video that was referenced to on the packaging. Connected the Pi to the TV via my Yamaha amp with the HDMI cable rather than getting an old monitor down from the loft.

              First problem - Pi started ok and loaded with the OS screen but then implied that I had to add OS system TO the SD card and not FROM the SD card. Checked the card on my PC and it looked OK (files looked pretty much as they should compared to the www.raspberry pi.org website.

              Solution - bought a new SD card and followed the instructions on the above website to format it properly and reload the files onto it.

              Switched Pi back on with new SD card in place and it now gave me the option to install the OS from the SD card.

              Once installed I clicked ok and it then rebooted (with a black background) and then automatically loaded the desktop.

              Next I wanted to set up the wifi. I unplugged the Ethernet cable and plugged in the wifi dongle but when I went into the menu there was no option to setup wifi. There was a network symbol on the address bar but it did not give me any options so I rebooted but still no menu option (even when I looked in the 'hidden items'). I was now able, however, to click on the network symbol on the address bar and it gave me the option to select my wifi and input the password.

              So that is the first stage done.

              i don't know if it is a good or a bad thing but once I am interested in something then I get as much info as I can - usually to the detriment of actually starting things - currently I have the Raspberry Pi for Dummies, and 2 other beginners magazines as well as searching the t'internet. As you can see from above, I still came across some problems that were different to the guides. However I think that I will try and work it out first and if I am really stuck then ask as it will have given my time to explore my options.

              Will have a bit of a play with the Pi tonight and then onto stage two hopefully tomorrow.

              Comment

              • Otto-Mate
                Founder
                • Jan 2004
                • 882

                #8
                Thanks for the update Mavis. Keep us up to date with your adventure

                M.
                Editor AutomatedHome.co.uk


                www.facebook.com/AutomatedHomeUK
                www.twitter.com/ottomate
                www.instagram.com/automatedhome/

                Comment

                • Mavis
                  Automated Home Ninja
                  • Oct 2014
                  • 322

                  #9
                  Part 2
                  Set a static IP address for my Pi (24 items listed on my router but I am sure that there are even more that aren't connected!!)

                  Set up VNC Remote Access - I have installed TightVNCServer but I might install something else as it is not allowing me to paste code into it.


                  Installed Node.js
                  I didn’t appear to have npm installed so googled and eventually found this piece of code –

                  $ sudo apt-get update
                  $ sudo apt-get upgrade
                  $ sudo apt-get install nodejs npm

                  (I dangerously put it in first without knowing what it did – I now know (I think) that it just makes sure everything is updated)

                  Installed Homebridge
                  HomeKit support for the impatient. Contribute to homebridge/homebridge development by creating an account on GitHub.


                  I got a load of errors when trying to install Homebridge so went back to these instructions (above link) and followed them through and installed Avahi

                  sudo apt-get install libavahi-compat-libdnssd-dev


                  I now have to amend the Smartthings file which I am struggling with so will leave things and then come back to it.

                  Observations
                  I really do not know if I am getting things installed correctly as I am unsure how to check.
                  I am not afraid to google things and/or put random bits of code in as, at the very worst I can, presumably, wipe the SD card clean and start from scratch.

                  I do need to brush up on coding protocol as, if I am trying to type in some code, (as opposed to copy and paste) I am unsure if the code just carries on when it goes onto a new line or if there should be a space (spaces are not indicated with an underscore).
                  Also I am not sure if there is anything that I should be replacing with my personal code (eg username, file location, etc, etc)

                  Comment

                  • Mavis
                    Automated Home Ninja
                    • Oct 2014
                    • 322

                    #10
                    Well I am now stuck.

                    I have been through all the steps now and think that everything is installed now. I have also installed puTTY which appears easier than TightVNCServer.

                    Step 6 Install the new JSON API SmartApp in SmartThings - copying the config code was easy if done on an iphone. When you open it in the app there is the option to send the code by email so I emailed it myself and then just pasted into puTTY.

                    This is where I think that I have the problem (I am hoping). I think that I have Homebridge installed (and it's plugins) as I get a homebridge prompt but i have been unable to do the following. I can get into the 'nano' screen and I have Smartthings.js as a heading but there is no code in (I am presuming there should be?).

                    3. Install Homebridge on the Pi


                    Now we need to make some changes to the smartthings.js file for the UK/EU servers:

                    cd /usr/local/lib/node_modules/homebridge-legacy-plugins/platforms

                    nano SmartThings.js

                    Find the following URL in the file:



                    and replace it with:



                    In my version of the file, there was only one instance of this. Ctrl-O and Enter to save the file, then Ctrl-X. This setup isn’t quite complete yet, you’ll need to complete the following before Homebridge will run.

                    Comment

                    • Mavis
                      Automated Home Ninja
                      • Oct 2014
                      • 322

                      #11
                      Yey I have done it!

                      That was some marathon project. Mainly because I didn't have a scooby do. I asked for help on the SmartThings forum but in the end I worked it out for myself.

                      The problem was the config.json file - I had only created the file with the text and access key from the SmartThings app. What I did was open the config-sample.json file (which is an example to show what format the config.json file should be.) and use this code which has the homebridge username and key as a template to then paste in the code from the SmartThings app. Once I did this then homebridge ran properly and it generated the code to put into the Eve App.

                      I did have a problem as I have 2 sonos in the living room both called the same so I just deselected one and reran homebridge. It then worked ok. As the 2 sonos were grouped, when I select the one to play through Siri both do work in stereo.

                      I am having issues in that Eve sometimes shows things as being unavailable even though my Pi is on and homebridge is running. I have restarted the Pi and my phone but it still does it. However in the few hours I have been playing with Siri, it does appear to work once I have worked out the best phrases to use. Sometimes Siri says he is thinking about things but it still works without him saying it has.

                      I also installed idevices a few weeks back (after seeing the article about it on here) but hadn't used it as I didn't have any compatible devices but that now works.

                      I need to spend some more time seeing how I can use it and what else I can add to it - for instance I am now wondering if I can add my lightwaverf stuff to it. If so then it would be cool.

                      So now I think I will reward myself with a very large glass of wine.

                      Comment

                      • thewisevaloo
                        Automated Home Lurker
                        • Mar 2016
                        • 1

                        #12
                        Almost!

                        Hey! Thanks so much for this walkthrough. I'm super excited to get this working, but I ran into an issue. At step 6, where you're supposed to click select Config in the Smart Things app, I got this message "{"error":true,"type":"AccessDenied","message":"Th is request is not authorized by the specified access token"}"

                        Any ideas?

                        Thanks!

                        Comment

                        Working...
                        X