How to install Homebridge and configure for Home Assistant



This video is a tutorial on how to install Homebridge and configure for Home Assistant.

Here is a link to get you started…..

As always, start off by making sure your system is up to date…

sudo apt-get update
sudo apt-get upgrade

Once that is done, lets install some pre-reqs…..

sudo apt-get install npm nodejs nodejs-legacy
sudo apt-get install libnss-mdns:i386
sudo npm install node-gyp
sudo apt-get install build-essential libavahi-compat-libdnssd-dev

Now we can install Homebridge….

sudo npm install -g –unsafe-perm homebridge

Now with homebridge installed lets run it and make sure its working properly….

homebridge

Once we know its working, lets install the home assistant plugin for homebridge…..

sudo npm install -g homebridge-homeassistant

Now we can configure the config.json file for homebridge….

cd ~/.homebridge
sudo vi config.json

{
“bridge”:{
“name”: “Homebridge”,
“username”: “CC:22:3D:E3:CE:30”,
“port”: 51826,
“pin”: “031-45-154”
},

“platforms”:[
{
"platform”: "HomeAssistant”,
"name”: "HomeAssistant”,
"host”: ”
"password”: "PASSWPRD”,
"supported_types”: ["input_boolean”, "light”, "lock”, "media_player”, "scene”, "sensor”, "switch”],
“logging”: true
}
]
}

Now lets make homebridge start as a service in systemctl…..

sudo vi /etc/systemd/system/homebridge@hass.service

[Unit]
Description=Node.js[Unit]it Server
After=syslog.target network-online.target

[Service]
Type=simple
[Service]r> ExecStart=/usr/local/bin/homebridge
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-u[Install]t

sudo systemctl –system daemon-reload
sudo systemctl enable homebridge@hass.service
sudo systemctl start homebridge@hass.service
sudo systemctl status homebridge@hass.service

Now you should be able to open up your home app on your phone or ipad and add the new homebridge…..

You are done, everything should be good to go now.

If you like the video, please subscribe to my channel, if you have any questions, hit me up in the comments below. Also, please let me know if there are any tutorials you guys are looking for.

HAPPY HOLiDAYS!!!!!!

Hip Hop Christmas by Twin Musicom is licensed under a Creative Commons Attribution license (
Artist:

21 Replies to “How to install Homebridge and configure for Home Assistant”

  1. Bob Walberg

    I have installed Home Assistant and nowadays its Hassio! Too bad when return to SSH (terminal) It won't accept install commands like sudo and sudo npm install -g –unsafe-perm homebridge.

  2. Borys M-B

    Hi, just installed Homebridge easy ways as an add-on for Hass.io it's up and running but the problem is when i leave the parameter "default_visibility": "hidden", Homebridge is showing in the Home App, but don't list any devices ( i see that in log file )
    [2018-5-5 16:53:43] Loaded plugin: homebridge-homeassistant
    [2018-5-5 16:53:44] Registering platform 'homebridge-homeassistant.HomeAssistant'
    [2018-5-5 16:53:44] —
    [2018-5-5 16:53:44] Loaded config.json with 0 accessories and 1 platforms.
    [2018-5-5 16:53:44] —
    [2018-5-5 16:53:44] Loading 1 platforms…
    [2018-5-5 16:53:44] [HomeAssistant] Initializing HomeAssistant platform…
    [2018-5-5 16:53:44] [HomeAssistant] Fetching HomeAssistant devices.
    [2018-5-5 16:53:44] Loading 0 accessories…
    [2018-5-5 16:53:44] [HomeAssistant] Received event: ping
    Setup Payload:

    when I change "default_visibility": "hidden" to "default_visibility": "visible" it becomes unavailable in Home App but in log file my devices are listed
    [2018-5-5 17:06:37] [HomeAssistant] Initializing platform accessory 'Sensors'…
    [2018-5-5 17:06:37] [HomeAssistant] Initializing platform accessory 'Pi Temperature'…
    [2018-5-5 17:06:37] [HomeAssistant] Initializing platform accessory 'Screen Audio'…
    [2018-5-5 17:06:37] [HomeAssistant] Initializing platform accessory 'Amplifire'…

    what can I do with it ?
    thanks

  3. Richard van Herwaarden

    Since HomeAssistant is beginning to support Homebridge, is there also somewere a little manual on how to remove this integration and start using the integrated version?
    (No offence, I really like it that it works, but I like it more to have it working from 1 application instead of 2 😉

  4. Andrew w

    Hey! Cool video, I have a couple of questions, please excuse my ignorance… what is the benefit of running homeassistant instead of simply having homebridge? I currently run homebridge on a pi3 to add my sonoff devices to my homekit app, but, for example, my hue accessories are paired directly to my home ipad… so I’m not really sure how my life would be better if i ran HA on my system. I know it’s a pretty complicated question to answer because everything is subjective, but you have experience with coding (i don’t, i copy/paste stuff) and probably set up your system like this for very good reasons and I’d love to learn more about why.
    My other wuestion is technical, does your HA run on a different machine? Here you integrate HA in homebridge but you already have HA up and running i think?
    I know my questions might be extremely naive and I apologize, but I’ve just started learning how to use this stuff 🙂

  5. Richard van Herwaarden

    It works if I start homebridge manually
    When I try to start it as a service it comes with an error.

     homebridge@hass.service – Node.js Homekit Server
       Loaded: loaded (/etc/systemd/system/homebridge@hass.service; enabled; vendor preset: enabled)
       Active: activating (auto-restart) (Result: exit-code) since Tue 2018-02-13 12:39:40 CET; 4s ago
      Process: 3228 ExecStart=/usr/local/bin/homebridge (code=exited, status=217/USER)
     Main PID: 3228 (code=exited, status=217/USER)

    Feb 13 12:39:40 Home_Assistant systemd[1]: homebridge@hass.service: Unit entered failed state.
    Feb 13 12:39:40 Home_Assistant systemd[1]: homebridge@hass.service: Failed with result 'exit-code'.

    Anybody some advice?

  6. Narked Diver

    Happy New Year to you 🙂

    How are you handling presence detection with your IOS devices? I’m using the HA app on my iPhone and it’s very hit and miss when it comes to correctly identifying when I come home (much more miss than hit)

  7. Karolis Kontrimas

    Hi, in the step that you need to check status with command sudo systemctl status homebridge@hass.service i get:

    homebridge@hass.service – Node.js Homekit Server
    Loaded: loaded (/etc/systemd/system/homebridge@hass.service; enabled; vendor
    Active: activating (auto-restart) (Result: exit-code) since Fri 2017-12-29 11
    Process: 4267 ExecStart=/usr/local/bin/homebridge (code=exited, status=217/USE
    Main PID: 4267 (code=exited, status=217/USER)

    Dec 29 11:23:39 hassbian systemd[1]: homebridge@hass.service: Unit entered faile
    Dec 29 11:23:39 hassbian systemd[1]: homebridge@hass.service: Failed with result
    lines 1-8/8 (END)…skipping…
    homebridge@hass.service – Node.js Homekit Server
    Loaded: loaded (/etc/systemd/system/homebridge@hass.service; enabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Fri 2017-12-29 11:23:39 UTC; 5s ago
    Process: 4267 ExecStart=/usr/local/bin/homebridge (code=exited, status=217/USER)
    Main PID: 4267 (code=exited, status=217/USER)

    Dec 29 11:23:39 hassbian systemd[1]: homebridge@hass.service: Unit entered failed state.
    Dec 29 11:23:39 hassbian systemd[1]: homebridge@hass.service: Failed with result 'exit-code'.

  8. krazygreekguy

    Hi, I don’t know anything about coding, but I’d like to try and get homebridge running on my Mac. Did you do this in terminal on a Mac? I was hoping to try and add my Blink security camera to HomeKit

Leave a Reply

Your email address will not be published. Required fields are marked *