Here’s everything you need to get Siri controlling your Samsung SmartThings, Philips color 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 excellent seasonal smart home video.
“Hey Siri, make it Christmas!” Or how to get Siri to control HomeKit and non-HomeKit devices by using Samsung SmartThings and a Raspberry Pi to set a Christmas lighting scene on a range of bulbs and decorations and kick off the ideal playlist (UK certain instructions).
I’ve been automating my home for a lot more than 15 years now with systems such as CBus lighting, wall mounted control panels, a comfort alarm system, HomeVision hardware HA controller, whole-house audio, electric curtains and roofing lights etc. The list was long. Oh, and around 8km of Cat5e cabling!
We recently made a decision to step and down-size a little but the result of that was that I had to say goodbye to a lot of of my charming automation kit. A result of so lots of years of research, installation and programming and chatting to the great people on the Automated Home forums and mailing list. We’re now in a rented house, waiting for our new house to be built.
I just couldn’t resist the lure of home Automation yet again as the default house lights were just sooo 1990’s and boring. undoubtedly I’m pretty restricted to what I can install in a rented property, so I invested in some wireless Philips color lamps, both the colour plug in type, some newer Iris wall washing colour lamps and a rather great color beyond desk lamp. I’ve had the original Philips color Iris lamps for some years now but the newer versions link up together and with other lamps in the color system by means of a hub, all controllable by means of the color iOS app. pretty cool eh?
Well, just recently, Philips updated the color hub to v2 and with this came Apple HomeKit support and the ability to control the lamps by means of spoken commands to Siri. Wow, that was fun and actually surprisingly useful, finding that we’d now control a lot of of the color lights this way as it was just so much quicker than unlocking the iPhone, opening the app and stabbing at various buttons.
Then came the Samsung SmartThings system with its pledge of easy integration and control of a number of very creative wireless sensors and devices. naturally the SmartThings hub could also link to the color system and some other bits ‘n’ bobs I already had like a Logitech harmony remote and a Sonos Play:1 speaker. I soon was wishing for Siri control of these new devices as regrettably the SmartThings system isn’t natively HomeKit compatible. It turns out though that it is undoubtedly possible by means of some very creative community projects and code.
The following guide was set up to help others achieve HomeKit nirvana with a modest amount of kit and a few apps. I need to anxiety that it’s mostly based on other people’s work and guides spread across lots of sites and pages but brought together into one hopefully beneficial guide. huge credit scores to all those people in the various projects and forums for the fantastic amount of work put in to enable others (for free) to achieve something special. Please do consider donating where there’s an option. I’ve also in-depth the modifications needed to run this within the UK (and possibly Europe).
This does require a affordable amount of effort and some knowledge of Windows, Linux and iOS but must be achievable for a lot of average to advanced users.
#
Preview
Product
Rating
Price
1
Samsung GP-WOU019BBDWG SmartThings smart plug 2019, Compatible with Amazon Alexa and Google Home,…
972 Reviews
£19.50
get on Amazon
2SmartThings Aeotec Zigbee motion Sensor – automatic control of light integrated temperature sensor,…
34 Reviews
£34.99
get on Amazon
3
SmartThings Aeotec Zigbee Multipurpose Sensor – Window-Door Sensor for Burglary Alarm Security…
16 Reviews
£29.99
get on Amazon
Hardware
Required:
SmartThings hub (I have the SmartThings starter kit plus an extra plug socket)
Raspberry Pi (I’m using the RasPi 2 model B Desktop) with SD Card, PSU and network cord – or just get a Raspberry Pi Starter Kit, (plus a mouse, keyboard, monitor and HDMI cord for initial setup).
iPhone running Siri
You could run this on another Linux device instead, but you may have to modify the instructions slightly.
Optional:
Philips color Hub v2 (square rather than the old round one)
Philips color bulbs or lamps such as the White and Colour bulbs, color Lux bulbs, color Iris, color beyond lamp etc.
Other SmartThings Sensors and devices such as the power outlet.
Other ZigBee or Z-Wave devices. For example I have several TKB home plug-in sockets that work very well with SmartThings as does the Aeon Labs Multisensor 6.
One large, pink tinsel Christmas tree with lights to automate and make your friends jealous!
Software
Raspbian OS
HomeBridge
1. install NOOBS & Raspbian on your Raspberry Pi
Install your Pi by following these instructions:
When done, make sure you can log in to a terminal session on the RasPi, either by running terminal in the RasPi GUI or by using a terminal app on Windows/Mac such as the exceptional PuTTY.
You can log in and issue all of the commands shown here under the default ‘pi’ account on the RasPi. If connecting remotely by means of PuTTY, the default username is ‘pi’ and password ‘raspberry’ although in my install, the password wasn’t recognised so I had to change it from the terminal app in the RasPi GUI using:
passwd
Then enter the new password twice as instructed. a lot more info here:
2. install Node.js on the Raspberry Pi
There are now much later versions of Node.js than the instructions here:
So this is what I did. Via a terminal window such as Putty on Windows:
This is for the Raspberry Pi 2 model B – check the previous URL if you have an older version as the package is different.
wget
tar -xvf node-v5.2.0-linux-armv7l.tar.gz
cd node-v5.2.0-linux-armv7l
sudo cp -R * /usr/local/
To check Node.js is appropriately install and you have the ideal version, run the command:
node –v
You might also want to check that NPM is the current version as on my RasPi it was quite old and I ran into some problems trying to install HomeBridge. This will install/upgrade to the current version:
sudo npm install npm -g
3. install Homebridge on the Pi
sudo npm install -g homebridge
sudo npm install -g homebridge-legacy-plugins
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.
4. install the SmartThings app on your iPhone
You must already have the SmartThings app on your phone. If not, install and set it up now by following the instructions that came with the SmartThings kit (or hub)
5. Login to the SmartThings IDE and create a JSON API SmartApp
The SmartThings IDE (Integrated development Environment) supplies a set of tools to manage a SmartThings account and hubs, devices etc. It’s actually quite beneficial for a number of reasons but we’ll be using it here to install a custom-made JSON API SmartApp that’s a crucial part of the process in getting Siri to control our non-HomeKit devices.
Login using your SmartThings account that you created as part of the SmartThings kit/hub install.
Goto the ‘My SmartApps’ tab
Click ‘+ new SmartApp’ button top right
Click ‘From Code’
In another browser window, go here:
click the ‘Raw’ button
Select all the code (Ctrl-A) and copy it (Ctrl-C)
Go back to the SmartThings IDE window and paste the code you just copied into the code window.
Find all instances of
and replace them with
There must be three instances on lines 59, 63 and 87 – this is right at time of writing (11/12/15). Of course this code may change in the future. If you have a us account, you don’t need to do this as the server URL will be right for you.
Click ‘Create’
Click ‘App Settings’
Click ‘OAuth’
Click ‘Enable OAuth in smart App’ leave all settings as defaults
Click ‘Update’
The SmartThings IDE seems to lose the menu buttons at this point, so you may need to click the ‘My SmartApps’ tab again, click the ‘ jnewland : JSON API’ entry to get back to a point where you can now:
Click ‘Publish’ and ‘For Me’
6. install the new JSON API SmartApp in SmartThings
Load the SmartThings app on your iPhone.
Go to the ‘Marketplace’ by tapping the icon in the bottom ideal (blue, green and yellow icon that looks a bit like a star).
Tap ‘My Apps’
Tap ‘JSON API’
You can now select any of the switches and Philips color lamps that you want to control by means of Homebridge/HomeKit/Siri (note that Philips color v2 hub now supports HomeKit natively so you may not want to select color devices here as they may already be in the HomeKit database and controllable). You can come back to this screen in the future and change your selections, so you may just want to try a single device for testing. If you do later change these devices, you may need to stop and restart the Homebridge server for the new or changed devices to be discovered and entered into the HomeKit database.
Tap ‘Config’
The next screen must then display the configuration that we need to use in the Homebridge server. It must look something like this (I’ve replaced the actual keys with xxx):
{
“description”: “JSON API”,
“platforms”: [
{
“platform”: “SmartThings”,
“name”: “SmartThings”,
“app_id”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,
“access_token”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”
}
]
}
Copy this or send it by means of email, PushBullet or whatever other method you might have for sending text from an iphone to your desktop machine. I use the PushBullet app and Firefox plugin which works quite well. Unfortunately, this step is a little cumbersome as SmartThings don’t have an app for anything but a mobile device (not even an iPad version I believe).
Tap ‘Done’ and ‘Done’ again to exit the SmartApp. SmartThings must display a banner saying that “JSON API is now installed and automating”
7. setup a config.json file for Homebridge
We’ll now use the configuration text from the previous step and create a config.json file for the Homebridge server.
Back in your terminal window connected to your Raspberry Pi:
cd /home/pi/.homebridge
nano config.json
Now paste in the configuration text. If you’re using PuTTY, you can copy the configuration text and ideal click on the PuTTY window to paste it in.
Ctrl-O to write the file. Make sure the filename is ‘config.json’ and press enter. Ctrl-X to exit the nano editor.
Check the file now exists:
ls
You must see ‘config.json’ listed.
Now we can start the Homebridge server:
Homebridge
If all is successful, you must see something like this output (the alerting messages don’t seem to affect operation of the server):
pi@raspHA:~/.homebridge $ homebridge
*** alerting *** The program ‘node’ uses the Apple Bonjour compatibility layer of Avahi.
*** alerting *** Please fix your application to use the native API of Avahi!
*** alerting *** For a lot more information see <>
*** alerting *** The program ‘node’ called ‘DNSSe