Guide: Install HomeBridge on Firewalla

Follow

Comments

21 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 

    1
    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

Please sign in to leave a comment.