Home Homebridge: The Missing Link for non-HomeKit Accessories

Discussion in 'HomeKit, HomePod, CarPlay, Home & Auto Technology' started by 32828870, Sep 16, 2016.

  1. 32828870 Suspended

    Joined:
    Jun 23, 2016
    Location:
    New York and Berlin
    #1
    "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 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":

    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:

    If the same error occurs as before, add --unsafe-perm to the command:

    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!
     
  2. GreyOS macrumors 68030

    GreyOS

    Joined:
    Apr 12, 2012
    #2
    nice one writing up a guide.

    i have LIFX bulbs and tried this a couple of months ago on my macbook air. not a permanent solution as it's not always on, but served as interesting proof of concept.

    as an aside, i found homekit lacking somewhat. lifx very easily let's you set various white tones, whereas homekit makes it quite hard to do that.
     
  3. 32828870 thread starter Suspended

    Joined:
    Jun 23, 2016
    Location:
    New York and Berlin
    #3
    It's improved greatly as more people, from novices to advanced users, have been playing with it and creating some great ideas outside and inside of HomeKit as this breaks the "chains" without risking security. I had been trying to run homebridge on my Mac mini for the past few months until just recently (had enough time, more progress, and iOS 10's "Home" app was the missing piece).

    I posted a thread (walkthrough) on how to configure HomeKit devices using the "Home" app here. Check it out as initial setup isn't so much complicated but requires certain steps at certain stages be done with all devices logged out and wiped clean as setup is done on one iOS 10 device. Once done, other devices are added by either using the same iCloud account and making certain "Home" is on in iCloud Settings or inviting others (each invited individual can use devices, "Guest", or also edit settings, "Admin").
     
  4. GreyOS macrumors 68030

    GreyOS

    Joined:
    Apr 12, 2012
    #4
    to be clear i was testing it with ios 10's Home app (in beta). as well as a couple of third party apps that had tried to fill the hole that Apple's Home now fills. none of them allowed a simple white tone selection. might look into it again.

    anyway, don't mean to distract from your guides, really nice you've done them
     
  5. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #5
    Thanks so much for this write up. It's just what I was looking for actually. I just dove into the world of HomeKit this weekend with the addition of some iDevices switches (with some Phillips Hue bulbs back ordered and on the way). Now that I'm using it I'm really seeing the value in having everything displayed in one app. So, I've been interested in setting it up so that I can see my Nest accessories (three Gen 2 Protects and a Nest cam) in the Home app too if possible. Again, it'd just be really nice if everything were visible at once.

    However I also don't want to alter the functionality of my current devices too much, so I was wondering if someone could answer a fairly silly question of mine - if I set them up with Homebridge, would it mean that they're no longer visible in the Nest app, or that they wouldn't work if my always-on Mac mini (which I intend to use for Homebridge) was off for some reason? Sorry if I'm asking a redundant question - I'm fairly new to all this but am definitely very interested in learning more about how all this works.
     
  6. jeremysmith214 macrumors newbie

    Joined:
    Sep 7, 2015
    #6
    As far as the nest, from my previous interactions the nest app was still intact and working with no issues. Not certain about the cameras.
     
  7. SouthernTeuchter macrumors newbie

    SouthernTeuchter

    Joined:
    Nov 14, 2016
    #7
    Basically Homekit just adds another way of accessing everything on your device - you don't lose any access via other apps, OEM or otherwise. The nice thing about Homekit is that it aggregates everything and makes it simpler to use - ideal for most family members.
     
  8. MexicoMatt macrumors newbie

    Joined:
    May 9, 2017
    Location:
    Cancun, Mexico.
    #8
    Hi, firstly thanks for your guide!
    I am kinda stuck though, not sure if it is a complete newbie question, but here is my issue. I want to be able to control my Air Con (mini-splits) using HomeKit/Siri. I have an IR blaster (Cuby Smart) designed to do this (and working fine through its own app). I have installed HomeBridge (on my iMac, constantly on) and it is connected to my Home app etc. I have the http commands to send to the Cuby API, but i do not follow how to get from that to a HomeBridge PlugIn. I can see that Sensibo and Tado (AC IR blasters) have PlugIns, not sure if they can be "tweaked" to work.
    Again sorry if this is a complete stupid question, i do feel like there is a simple answer, but I am not seeing / understanding it.

    Cheers. MM.
     
  9. boston04and07 macrumors 65816

    boston04and07

    Joined:
    May 13, 2008
    #9
    Has anyone ever gotten Homebridge to work with Nest smoke detectors and cameras (not thermostats?) I've been trying to figure this out and am kind of stumped. Most of what I've found so far focuses on the thermostats and not the other Nest products. If anyone has I'd love to know what you did to get it to work.
     
  10. waring192 macrumors member

    Joined:
    May 16, 2012
    #10
    Hello,

    Im looking into getting a Nest thermostat, well Im buying one.

    I know the Nest isn't HomeKit compatible and you have to use the Nest app straight out of the box but you can install HomeBridge on a Raspberry Pi or (in my case) have it running on a Mac server which I already have for VPN, Printer server, TimeMachine etc.

    I have seen videos of people controlling the Nest via Siri but I as I don't use Siri at all I was wondering if you can use the iPhone/iPad Home app natively to control nest and not just use Siri?

    Many thanks.
     
  11. mariusignorello macrumors 6502a

    Joined:
    Jun 9, 2013
    #11
    Yes, install the Homebridge plugin that corresponds with Nest and you should be ok.
     

Share This Page