"Homebridge": The Missing Link for non-HomeKit Accessory Use
Lastly, if you're intermediate to advanced in tech or want to play around with light programming, 'Homebridge" is a project that has been in development for a while. "Homebridge" allows non-HomeKit accessories to work with iOS "HomeKit".
Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.
Since Siri supports devices added through HomeKit, this means that with Homebridge you can ask Siri to control devices that don't have any support for HomeKit at all.
"Homebridge" is based on "git"/"GitHub" and can be installed on a Windows, Linux, Raspberry Pi, OS X, etc system. If using a Mac, make sure it's a Mac that is always on and give it a static IP address (can be done in Apple's "Airport" app if using an Apple router or using the configuration settings depending on your wireless router). It's important as "Homebridge" will be "talking" to other systems, if your router designates differing IP's on your home network it will interfere with its functionality.
The "Homebridge" link is helpful yet confusing as OS X doesn't have the required backend installed. "MacPorts" has been a well known and used alternative yet some prefer "Homebrew". If you are unfamiliar with either and don't have the time or desire to learn a bit, this isn't for you. If you are interested, I highly recommend giving it a try.
I have a 2012 "Mac mini" I use for a Home Theatre system connected to four Synology servers for media (~1000 lossless movies) connected via my McIntosh system and LG OLED (and yes, it does carry lossless audio in TrueHD, ATMOS, etc with a bit of research and work, but that's another story). I've installed "Homebridge" on that "Mac mini" using "Homebrew" and followed these instructions in addition to the "Homebridge" site as the other guide was more in-depth while being very easy to follow.
NOTE: Disregard the section on buying an app as this guide was done just before iOS 10 released its "Home" app, thus no need to buy an app as it is already built into iOS.
The trick is deciding which backend to use: "MacPorts" or "Homebrew". I opted for "Homebrew" which required some quick research as the commands in the instructions are different. Once everything is installed and setup using "Homebrew", etc., here are some pointers:
1. Install Xcode. Download Xcode 8 from the Mac App Store for free, then open it and install terminal commands, etc.
2. Using "Terminal", if the homebridge command returns with the following error:
"root" does not have permission to access dev dir.... add the following to the installation command:
--unsafe-perm
Thus, install "Homebridge" via "Terminal" using the following command (copy and paste if you like):
sudo npm install -g --unsafe-perm homebridge
3. This is one error I could not resolve as I didn't have enough time:
clang: libstdc++ is deprecated, move to libc++ with a minimum deployment target of OS X 10.9
What this means is that OS X has moved from libstdc++ to libc++ a long time ago yet doesn't seem to indicate such. Simple solution is to point OS X to the new libc++ library
Using Homebridge:
1. Open "Terminal"
2. Type "homebridge" (without quotes, never use quotes in terminal unless specifically required which is why I didn't include any above) then enter
3. Homebridge will check for any inconsistencies such as those listed above and will recommend fixes
4. Homebridge will run and display a "HomeKit" code, name (Homebridge), running on port xxxxx, node xxxx, etc (those can be changed)
5. Open "Home" on an iOS device and select the "+" sign in the upper right corner
6. Select "Add Accessory"
7. "Homebridge" should appear, if not select "My Accessory Isn't Shown Here" and enter the HomeKit code from "Terminal"
8. Once "Homebridge" is added to "Home", it will show as an accessory.
At this point, "Homebridge" is working and running on your Mac as a lightweight NodeJS server that emulates "HomeKit" yet accessories need to be installed and configured.
Quit terminal and shut down homebridge (running homebridge again is as simple as entering homebridge in "Terminal"). Adding non-HomeKit accessories are done by downloading the "Plugin" (NodeJS module) for your device and installing it. Once you have your device plugin, which should look like "homebridge-nameofaccessory. Loading the plugin requires modifying a file named config.json that should be located in your hidden .homebridge folder in your /User/ folder (you'll need to unhide files and folders by typing the following in "Terminal":
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
Hidden folders and files will show in Finder, the icons will seem "dim".
A config-sample.json file can be downloaded here . Change the name to config.json and do not use a text editor or any other editing app other than Atom text editor. Download, open the DMG and drag the app to your Applications folder. Open "Atom" and use it to edit the config.json file in order to add accessories and platforms (plugins, etc) for your devices.
Plugins can be found here. Search for the plugin for your device, read the brief information from the developer. Plugins are installed the same way as "Homebridge" - as a global NPM module. Example:
In "Terminal", enter the following command followed by the name of your accessory plugin:
sudo npm install -g homebridge-accessoryname
If the same error occurs as before, add --unsafe-perm to the command:
sudo npm install -g --unsafe-perm homebridge-accessoryname
This is when basic coding is required as plugins are activated by modifying a file that homebridge loads, the config.json file.
Each plugin has different configuration settings that need to be added to the config.json file using "Atom". Instructions for each accessory plugin should be on the page for the npm accessory (some are as simple as copying and pasting the code then modifying it by adding credentials or other information to properly access and load the plugin and device). If you're a novice or haven't had much experience with basic editing, you can either wait for a HomeKit version of the device(s) or take some time with a little patience and give it a try. The instructions on the "Homebridge" site and the information for each plugin should help piece it together.
After modifying the config.json file, open "Terminal" and type homebridge. If all works, it will load with no errors. "Terminal" needs to be running in order for the homebridge to work. Open "Home" on an iOS 10 device and you should see "homebridge" as an accessory. The accessory should indicate it is running. If "No Response" is displayed then you may have homebridge running twice which happens. Open "Activity Monitor" and make sure "All Processes" are selected, then force quit any running instances of "homebridge" as sometimes if not properly terminated it will run homebridge twice.
Press and hold on the "homebridge" accessory then click on "Details" at the bottom. The usual settings will display - name, location, Include in Favorites. Select "Accessories". This will list the SmartHome devices installed and running via homebridge. From there you can see what is running, use the "Home" app to control the device in addition to "Siri", etc. It will act exactly like a HomeKit device.
Hope this helps!