Tutorial: add Homebridge to Hass.io using Portainer

Thought I would share how to add homebridge to hassio, as it took me a while to figure out. This is adapted from:
https://github.com/oznu/docker-homebridge/wiki/Homebridge-on-Raspberry-Pi
This assumes you have Portainer hassio addon installed.
Homebridge serves a purpose for me, getting camera feeds into apple homekit.
Here’s a few screenshots to hopefully help others:
Start by “add container”, fill in the info circled in red:


Then on the same screen under “Advanced container settings” select the “Network” tab and add the following circled in red:

Next go to the “Volumes” tab and add the following:

Then go to the “Env” tab and add the circled info below, the uncircled will be populated automatically after the container is started, so don’t add those manually.
NOTE: As of February 2020, ffmpeg is now included in this docker image, in most cases it should no longer be added as a package below.

Next go to the “Restart policy” tab and select “Always”

Finally, click the “Deploy the container” button and homebridge should launch. You can configure by web, the address is your local hassio IP address:port 8080

7 Likes

awesome!!! Works perfect on my NUC I3 only thing that I have changed from your tutorial was the the docker image to “ oznu/homebridge:latest”

Thanks for that!!!

Happy it works for you too!
Thanks for pointing out that hass.io on a raspberry pi will use “oznu/homebridge:raspberry-pi” and other platforms will use “oznu/homebridge:latest” in the “image” field.

Hi,

I’m using Hassio and I am successfully able to get the Homebridge and camera add on running – trying to use for Doorbird. The lock and IR work perfectly.

However, I can’t get the camera stream to work because FFMPEG isn’t installed or working natively on the system. I followed all of your instructions, assuming that the package installed it.

What am I doing wrong?

I know nothing about Homebridge, so trying to figure this out. Thank you!

in the “packages” field, should be a comma after ffmpeg, not a period.

Ah, thank you! That helped somewhat – now I’m getting this.

First of all, thank you @Hackashaq666 for sharing the instructions. I managed to set it up on my raspi and can see devices listed and reacted to in homebridge logs.

However I’m having troubles adding the accessory to Apple Home, it fails with a message Accessory already added. To add this accessory to your home, you'll need to reset it first.

I have also tried to add Homebridge accessory to HA as it was discovered as a HomeKit Accessory - it says: "An unhandled error occured while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently."

After clearing persist and accesories directories (as mentioned on https://github.com/nfarina/homebridge/wiki/Basic-Troubleshooting) and trying to add it again I get a different message: "Couldn't add Accessory. Home counldn't connect to this accessory".

What am I doing wrong?

I would try removing homebridge from the Apple Home app (under Hubs & Bridges) and re-adding it. Also, make sure the hub identifier, looks like a MAC address, and the port in your homebridge config.json are unique, and not the same as homeassistant homekit bridge if you are using that feature. If this fails to help, I would look for help from homebridge folks on github and give them information about the specific accessory/plugin you are trying to add to Apple Homekit and any logs or error codes you encounter.

Are you able to access via hassio shares (config) to access the hombridge (config file, persistent and accessory dir)?

I’m not able to map /homebridge to ./config/ or ./config/homebridge on host (hassio).

answer:
Bind:
config in hassio is:
/mnt/data/supervisor/homeassistant(/homebridge) /homebridge

for me it says:

2020/01/30 07:58:18 [WARN] [docker,snapshot] [message: unable to snapshot engine information] [endpoint: primary] [err: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39]
2020/01/30 07:58:18 [WARN] [docker,snapshot] [message: unable to snapshot containers] [endpoint: primary] [err: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39]
2020/01/30 07:58:18 [WARN] [docker,snapshot] [message: unable to snapshot images] [endpoint: primary] [err: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39]
2020/01/30 07:58:18 [WARN] [docker,snapshot] [message: unable to snapshot volumes] [endpoint: primary] [err: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39]
2020/01/30 07:58:18 [WARN] [docker,snapshot] [message: unable to snapshot networks] [endpoint: primary] [err: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39]
2020/01/30 07:58:18 [WARN] [docker,snapshot] [message: unable to snapshot engine version] [endpoint: primary] [err: Error response from daemon: client version 1.40 is too new. Maximum supported API version is 1.39]

hello @thecem can you share how you did that? i’m new to all this…thanks.

Go to “Supervisor” in HA -> Install “Portainer”.
In Portainer-AddOn-Config “Disable Protection Mode”.
In Portainer WEB UI go to Stacks -> Add Stacks -> name stack: HomebridgeXYZ.
Cpy following into the docker-cpompose field:

version: '2'
services:
  homebridge:
    image: oznu/homebridge:latest
    restart: always
    network_mode: host
    environment:
      - PGID=0
      - PUID=0
      - HOMEBRIDGE_CONFIG_UI=1
      - HOMEBRIDGE_CONFIG_UI_PORT=8581
    volumes:
      - /mnt/data/supervisor/homeassistant/homebridge:/homebridge

-> Deploy the Stack

6 Likes

Hi, I’ve followed your guide to the T and keep getting the above error that @weaverprojects had except it says homebridge:raspberry-pi. Only difference I notice between my Portainer UI us it say dock.io before you input the image name:

image

Please help as all of this is completely new to me! Thanks.

Maybe you can try @thecem 's method posted above using the docker compose file.

Also the docker.io appears in my screen too, likely an updated portainer since my first post.

Thank you. Worked perfectly

Thanks for this tutorial. I’ve now sucessfully migrated my Raspberry Installation of homebridge to a homeassistant portainer setup. Would anyone know how to enable https access for the homebridge docker container? I have my home assistant running under https (using the addons letsencrypt and nginx ssl proxy) and would like to also access homebridge as a path under my homeassistant url. e.g. https://homeassistant/homebridge. Similar to how the homeassistant addons work.

@simon.lock: Did you try it with https://github.com/oznu/homebridge-config-ui-x#enabling-ssl ?

If yes what’s was the result?