HomeKit Help Getting Started With Homebridge

Discussion in 'HomeKit, HomePod, CarPlay, Home & Auto Technology' started by Vado, Apr 20, 2018.

  1. Vado macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #1
    I'm looking for some help (more like a good easy guide! - I'm new to linux) for setting up and configuring HomeBridge on a Raspberry Pi 3 along with Nest hardware.

    I have several HomeKit devices already but want bring my Nest Thermostat and 2x Nest Protects into the Home app.

    Is it also possible once the Pi is configured to make Homebridge automatically run on boot?

    Thanks in advance :)
     
  2. Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #3
  3. rworne macrumors 6502

    Joined:
    Jul 23, 2002
    #4
    Not really. There are quite a few of us here with working setups and can answer questions.

    Basically the minimum you need for a hideable, low power, and cheap solution is:
    Raspberry Pi Zero W
    A case for the Pi Zero
    AC to microUSB adapter
    microSD card
    optional, but recommended: mini-HDMI to HDMI cable, microUSB hub

    Everything here should cost less than $30 or so.

    Put on a bog-standard Raspian install on it. Turn on SSH.
    Then install HomeBridge and get it to connect to your Homekit setup as a bridge.

    Some online instructions have you set up a user account for homebridge. That is what you want to do, so if the Ri restarts for any reason, you do not need to restart homebridge by hand.

    What comes next depends on what you want to connect to it.

    When you get it working, pop out the microSD card and back it up. You'll thank me later.

    One nice thing to add right away is homebridge-config-ui-x. I wish I had heard about this one earlier.

    Nest products are a real pain to get running - lots of experimentation. Once you get it talking, it works great.
     
  4. Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #5
    Thanks for the advice.

    I've already ordered a Raspberry Pi 3 starter kit on Amazon (Pi 3, Case, Power Cable and SD Card).

    Thanks for the quick points is there a particular set of instructions you'd recommend then? The only devices I'm looking at connecting to Homebridge are my Nest products.
     
  5. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #6
    Here is a PM I sent a forum member recently on this topic. Might help you out.

     
  6. rworne macrumors 6502

    Joined:
    Jul 23, 2002
    #7
    I followed these instructions. It works for any PI model.
    https://brandonb.ca/raspberry-pi-zero-w-headless-setup-on-macos - general setup
    https://brandonb.ca/getting-started-with-homebridge-on-a-raspberry-pi-zero-w-with-homekit - homebridge setup

    The second link is missing once crucial piece of information - its mentioned a homebridge user, but never explained how to set it up. Info for that is here:

    https://gist.github.com/johannrichard/0ad0de1feb6adb9eb61a/

    Getting Nest working requires getting a Nest dev account:

    https://www.npmjs.com/package/homebridge-nest

    The trick is - getting it to work with the new API.
    Once you get to the steps 12-15, it's very important to be careful. The token that they mention is quite long, and you will need to widen the terminal screen when reading the log to get all of it. If you leave it at the normal 80x25 size, it will truncate the token and have you wondering why it won't work.

    In the end, it works great:
     

    Attached Files:

  7. Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #8
    Thank you both for the info. I'm going to get my Raspberry Pi over the next few days, will hopefully get some time to set it up....no doubt I'll be back for help when I inevitably mess it up the setup and HomeBridge config!:D
     
  8. rworne macrumors 6502

    Joined:
    Jul 23, 2002
    #9
    No problem.

    If you set it up based upon the links I posted, I have config files I can post. If you search this forum with my username, you'll see some of them I posted earlier.
     
  9. Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #10
    I've got my Homebridge up and running on my Raspberry Pi 3 along with my Nest devices :D

    Can some give me simple instructions on how to get Homebridge to automatically start on boot/reboot of the Pi?
     
  10. BillGates1969 macrumors 6502

    BillGates1969

    Joined:
    Sep 11, 2008
    Location:
    Bournemouth
    #11
    I used this guide:

    https://timleland.com/setup-homebridge-to-start-on-bootup/

    Point 2 is the most important - check where it runs from first

    Hope this helps :)
     
  11. Vado, May 2, 2018
    Last edited: May 2, 2018

    Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #12
    Thanks for posting this. I'm a complete newbie when it comes to this.....i'm not 100% confident with these instructions.

    Also anyone able to give me an idea of the best way to backup my working Homebridge setup and configuration (Already got the config.json backup)
     
  12. BillGates1969, May 2, 2018
    Last edited: May 2, 2018

    BillGates1969 macrumors 6502

    BillGates1969

    Joined:
    Sep 11, 2008
    Location:
    Bournemouth
    #13
    I've reinstalled HomeBridge a couple of times (One SD card failure and second time I put a fresh install of the Raspbian Stretch OS) and all I do is keep a copy of the config.json and every plugin I install I write the name to a text file and save that.

    If you need to re-install, just install HomeBridge as normal and then install all the plugins one by one. Drop in your config.json and you are good to go.

    You can also remove your SD card and back it up as a disk image to your Mac.

    I work normally entirely on the command line, but another poster on here (sorry forgotten your name :( Edit - thank you @Weaselboy ), showed a plugin that is installed as normal and gives a nice GUI on a web front end to configure. I use that all the time now.

    https://github.com/oznu/homebridge-config-ui-x

    You can also backup the config.json through there rather than needing to do it via command line. If you haven't already, install a samba server on the Pi so you can share folders and use your Mac/PC gui to navigate to it:

    https://www.raspberrypi.org/magpi/samba-file-server/

    I use this guide to do it. I share my homebridge directory.


    EDIT: I feel your pain on the confidence to do stuff in Linux. For the last 15 years or so I have been a Infrastructure Specialist, mainly using Windows and Citrix, but over the last year or so I have embraced the command line and now get involved with Linux projects at work :) It is easier than it looks :)
     
  13. Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #14
    Thanks for that. Will look into that GUI frontend.

    Regarding the guide you posted for getting HomeBridge to auto start. I have a few questions.....

    Is it just acas of copying and pasting the whole 'gist' file as written in Step 1 and 2 in the files you are creating with Nano?

    Is there a way I can check how my HomeBridge has been installed prior to starting, to avoid any issues like in Step 2?
     
  14. BillGates1969, May 2, 2018
    Last edited: May 2, 2018

    BillGates1969 macrumors 6502

    BillGates1969

    Joined:
    Sep 11, 2008
    Location:
    Bournemouth
    #15
    Yes that is all you do. Copy it and paste into a nano window.

    Look at the path in step 2 to see if it exists, just do a:

    cd /usr/local/bin/ and see if HomeBridge directory exists. If not remove the local bit to see if that exists.

    From memory mine was as he gist.
     
  15. Vado, May 3, 2018
    Last edited: May 3, 2018

    Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #16
    Ok I followed the instructions but when I check the status of service at the end, I get this result. Anyone able to help?:

    [pi@raspberrypi:~ $ systemctl status homebridge

    ● homebridge.service - Node.js HomeKit Server

    Loaded: loaded (/etc/systemd/system/homebridge.service; enabled; vendor preset: enabled)

    Active: activating (auto-restart) (Result: exit-code) since Thu 2018-05-03 17:49:23 BST; 8s ago

    Process: 592 ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS (code=exited, status=203/EXEC)

    Main PID: 592 (code=exited, status=203/EXEC)


    May 03 17:49:23 raspberrypi systemd[1]: homebridge.service: Unit entered failed state.

    May 03 17:49:23 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
     
  16. Vado, May 4, 2018
    Last edited: May 4, 2018

    Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #17
    Solved it myself! Turned out my Homebridge install wasn't right location in Step 2. I had to remove 'local' from the line
    ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS in the gist and BINGO! The service started first time after following Steps 8-10 :D

    When I was creating my own Nest api on the Nest developers site. I added support for the Nest Cam, if I wanted to add a few to my setup how would that with Homebridge, I'm guessing it would be display only in the Home app with any recording being done through the Nest app?

    If I did add a Nest Cam would it just be a case of restarting Homebridge for it to fetch the Nest Cam on my account?
     
  17. scouser75 macrumors 6502a

    Joined:
    Oct 7, 2008
    #18
  18. Vado thread starter macrumors member

    Vado

    Joined:
    Dec 30, 2016
    Location:
    Livingston, United Kingdom
    #19
  19. scouser75 macrumors 6502a

    Joined:
    Oct 7, 2008
    #20
    Brilliant. Will order tonight.

    Also, I done a quick bit of research on how to get my Ring Doorbell 2 to work on Homekit using Terminal but didn't find anything. Does anyone on here know if it's possible? I don't have access to a PC so Terminal is my only option.
     
  20. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #21
  21. scouser75 macrumors 6502a

    Joined:
    Oct 7, 2008
    #22
    Thanks Weaselboy. I'm absolutely new to all this, so please forgive the questions, but do I use Macs Terminal app to carry all this out?
     
  22. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #23
    There is a post here where I copied in some instructions I wrote up earlier.
     
  23. scouser75 macrumors 6502a

    Joined:
    Oct 7, 2008
    #24
  24. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #25
    That cheaper one does not include the Raspberry Pi itself, it looks like just all the accessories you would need to set it up if you already had the Pi.
     

Share This Page