Guide: Install HomeBridge on Firewalla

Follow

Comments

81 comments

  • Avatar
    Michael Bierman

    Bonus! If you want to track the CPU temperatures of firewalla in Homekit do this:

    1. install homebriege
    2. add the following to the Accessory part of Homebridge config.json
    3. {
      "accessory": "LinuxTemperature",
      "name": "Core 0 Temperature",
      "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp2_input",
      "divisor": 1000
      },
      {
      "accessory": "LinuxTemperature",
      "name": "Core 1 Temperature",
      "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp3_input",
      "divisor": 1000
      },
      {
      "accessory": "LinuxTemperature",
      "name": "core 2 Temperature",
      "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp4_input",
      "divisor": 1000
      },
      {
      "accessory": "LinuxTemperature",
      "name": "Core 3 Temperature",
      "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp5_input",
      "divisor": 1000
      }
    4. install homebridge-Linux-temperature

     

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    What is the trick to get the port to attach to the container?  I have 2 other containers running but when I compose this one, it won't attach to a port.

     

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Have you tried https://github.com/oznu/docker-homebridge/wiki/Running-Homebridge-on-Firewalla-Gold ?

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    Yes I just cross referenced the two docs, it's ignoring the parameter to change my port.  It looks like the port change setting is also ignored in your yaml.  In your pictures it looks like you're going back to 80.  Have you tried this on a Firewalla with other containers running on 80?

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    I'll see if I can drop into bash in the container and see what's going on with the config.json.

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    Odd, when I drop into the container and cat out the config.json, the port change works but it's not resolving in the web address.  So I decided to use ubuntu as the container image so I could run lsof to see if the port was listening in.  Turns out it's listening but getting reset somewhere (see the connection refusal from the walla).

     

    Then I tried looking up IP tables to see if I could find the culprit, but that's over my head.

    @Firewalla
    @Michael Bierman

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Did you set the

    "mdns": { "interface": "FIREWALLA_LAN_IP_ADDRESS" },


    This is critical. 

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    The instructions seem to indicate you use the web UI to do this but I cannot get to the web UI.

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    You can use the webui if it is running or just edit the config.json via terminal.

    Note, I have only tested this with the Alpine docker image. I can't guarantee it works the same on other architectures. 

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    I've tried both images.  For whatever reason I can't access 8080 or any other port I try to change.  Does your setup have all 3 containers running (pi-hole, cloudflared, homebridge?).

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Try this.

    1. Stop all docker containers.
    2. ssh into firewalla and edit the config.json for homebridge. The `interface` should be the IP address of your Firewalla on your LAN. Often that is `192.168.0.1` but this will vary depending on how you configured it.
    3. Change the `username`. It does not have to be the MAC address of your firewalla.
    4. Edit the `PIN` just be in the format `xxx-xx-xxx` but can be any digits you choose.
    5. Delete “persist” and “accessories“ dirs in the `/home/pi/.firewalla/run/docker/homebridge/homebridge` directory

    % cd /home/pi/.firewalla/run/docker/homebridge/homebridge

    % rm persist accessories
    1. restart homebridge docker. 
    2. If Firewalla is your DNS server, you can try `http://fire.walla:8581/`. If that doesn’t work,, use the same ip that you ssh’d to.

    The default homebridge user is **`admin`** with password **`admin`**.

     

    If Homebridge works, start the other containers and test them. If there is a problem is is likely because of conflicting ports.

    Let me know heat happens. If it doesn’t work, post your config.json here. 

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Sample

    {
    "mdns": {
    "interface": "192.168.0.1"
    },
    "bridge": {
    "name": "Homebridge Firewalla",
    "username": "5V:20:6G:1A:1B:9C",
    "port": 52175,
    "pin": "093-48-135"
    },
    "accessories": [
    {
    "accessory": "LinuxTemperature",
    "name": "Firewalla Core 0 Temp",
    "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp2_input",
    "divisor": 1000
    },
    {
    "accessory": "LinuxTemperature",
    "name": "Firewalla Core 1 Temp",
    "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp3_input",
    "divisor": 1000
    },
    {
    "accessory": "LinuxTemperature",
    "name": "Firewalla Core 2 Temp",
    "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp4_input",
    "divisor": 1000
    },
    {
    "accessory": "LinuxTemperature",
    "name": "Firewalla Core 3 Temp",
    "sensor_path": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon1/temp5_input",
    "divisor": 1000
    },

    "timeout":
    {
    "accessory": "PowerlossIFTTTNotifier",
    "name": "PowerlossIFTTTNotifier",
    "IFTTTkey": "",
    "IFTTTservice": "-u!",
    "IFTTTvalue2": "https://avatars2.githubusercontent.com/u/21322342?s=200&v=4",
    "IFTTTvalue3": "http://fire.walla:8581/"
    }
    ],
    "platforms": [
    {
    "name": "Config",
    "port": 8581,
    "auth": "form",
    "theme": "orange",
    "tempUnits": "f",
    "lang": "auto",
    "sudo": false,
    "sessionTimeout": 28800,
    "log": {
    "method": "native",
    "path": "/homebridge/homebridge.log"
    },
    "platform": "config"
    }
    ]
    }
    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    Okay - we are jamming.  It's hard to say what fixed it, but I did have to clean up some space and remove some docker images.  Thanks for your help!

    1
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Excellent! Enjoy.

    0
    Comment actions Permalink
  • Avatar
    Firewalla

    If you can, please use /data for docker and docker images.  We have seen people storing a lot of stuff in ~/. so please be careful 

    2
    Comment actions Permalink
  • Avatar
    Michael Bierman

    +1. I see no downside to using docker and potential issues if you don't! 

    I would just add that you should use docker prune as you upgrade to get rid of any residual garbage that gets left behind when updating your containers. 

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    @Firewalla I agree but I followed the directions according to the docs.  Note that /var/lib/docker is actually mounted on a mmc block partition that is 1.6GB.  The /data dir looks to be mounted to the same block device but the partition is 3.6G.  I believe this was by factory default during docker installation.  Does the documentation need to be modified to move the docker install?  Side note - I could/should mount an external drive.

     

    0
    Comment actions Permalink
  • Avatar
    Danny Natale

    @Michael and I agree re: prunning!  I cleaned up some of the images this way.

     

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    I have updated the Github tutorial. with the new /data/homebridge path and new screenshots, etc. 

    @Firewalla any reply to @Danny Natale's question? 

     

     

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Note, the mDNS a instructions here have changed in Homebridge 1.3.0. See new instructions.

    0
    Comment actions Permalink
  • Avatar
    Brian Newbold

    HomeBridge on Portainer Install Instructions:
    https://github.com/oznu/docker-homebridge/wiki/Homebridge-on-Portainer
    NOTES: Be sure to change TZ below to your local timezone, and don't forget this will fire up on 8581 according to the setup below. 

    Here's the quick link on your local network assuming your firewalla is at the default address:
    http://firewalla.lan:8581

    Here's my Stack (yaml) script:

    version: '2'

    services:
    homebridge:
    image: oznu/homebridge:ubuntu
    container_name: homebridge
    restart: always
    network_mode: host
    environment:
    - PGID=1000
    - PUID=1000
    - HOMEBRIDGE_CONFIG_UI=1
    - HOMEBRIDGE_CONFIG_UI_PORT=8581
    - TZ=Los_Angeles/America
    volumes:
    - '/data/homebridge:/homebridge'

    0
    Comment actions Permalink
  • Avatar
    Sergio Lopez

    I'm running into an error on step 3. I've verified my yaml file is correct. This is what I'm getting:

    ERROR: The Compose file './docker-compose.yaml' is invalid because:
    services.homebridge.volumes contains an invalid type, it should be an array
    services.homebridge.environment contains an invalid type, it should be an object, or an array

    Any ideas what to do next?

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Hi Sergio,

    Does your yaml file look like this? 

     volumes:
                            - '/data/homebridge:/homebridge'

    Also, have you validated your yaml file? use something like https://yamlvalidator.com

    0
    Comment actions Permalink
  • Avatar
    Sergio Lopez

    Hi Michael,

    I ran my yaml file through that link and it returned no errors.  My file looks like what you posted, but the indentation is less (see picture, the indentation doesn't show up in the code when I paste it here)

    This is the error I continue to have:

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    Sergio,

    My understanding is this error usually has to do with either mistakes in spacing, tabs, or quotations. I don't see anything wrong with your quotes so I think it may be spaces or tabs.

    Check to make sure the copy in Firewalla has no tabs. Replace tabs any with spaces. Make sure that the same number of spaces for each tab equivalent. So if one tab is 4 spaces two tabs is 8 spaces. Each "tab" has to be a minimum of two spaces.

    If you want to copy directly from the example, you can use ":set paste" first, then copy from above and paste into vi. Then save and try again.

    0
    Comment actions Permalink
  • Avatar
    Sergio Lopez

    Hi Michael,

    Thanks - I will try ":set paste" - I checked the code and didn't find any tabs. I actually typed the code and the spacing was done automatically by vi.

    0
    Comment actions Permalink
  • Avatar
    Sergio Lopez

    Michael,

    Thank you! ":set paste" and copying the code worked! I ran the diff command and saw some "23c23" in the old file (not visible, but I guess is there somewhere?) - Anyway, Thank you again!

    1
    Comment actions Permalink
  • Avatar
    cybermaster69

    How i can delete the homebridge installation and rest of config i've done to install homebridge? 

    Thanks, Andrea

    0
    Comment actions Permalink
  • Avatar
    Michael Bierman

    @cybermaster69 there's an uninstall at github.com/mbierman/homebridge-installer

    1
    Comment actions Permalink
  • Avatar
    cybermaster69

    thanks, i would like to know if is possible to install home assistant and if there is a guide available. thanks

    1
    Comment actions Permalink

Please sign in to leave a comment.