Homebridge

mwest35

Junior Member
Original poster
Local time
3:18 PM
Nov 19, 2019
6
2
Hey all,

I just joined this project/community and want to say thanks for all the hard work so far. Install was a breeze!

Now I'm already able to give back by creating a container/app for homebridge (great app if all you want is Siri translator and don't need Home Assistant bloat), but I need a little help to finalize it and I'm also unsure how to push to the repo. Here's the mycontainer code for a file I called homebridge.yml:

Code:
#!/bin/bash
#
# Title:      PGBlitz (Reference Title File)
# Author(s):  MWest
# URL:        https://pgblitz.com - http://github.pgblitz.com
# GNU:        General Public License v3.0
################################################################################
---
- hosts: localhost
  gather_facts: false
  tasks:
    # FACTS #######################################################################
    - name: 'Set Known Facts'
      set_fact:
        pgrole: 'homebridge'
        intport: '8222'
        extport: '8222'
        image: 'oznu/homebridge:latest'

    # CORE (MANDATORY) ############################################################
    - name: 'Including cron job'
      include_tasks: '/opt/coreapps/apps/_core.yml'

    # LABELS ######################################################################
    - name: 'Adding Traefik'
      set_fact:
        pg_labels:
        pg_labels:
          traefik.enable: 'true'
          traefik.port: '{{intport}}'
          traefik.frontend.auth.forward.address: '{{gauth}}'
          traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
         
    - name: 'Setting PG Volumes'
      set_fact:
        pg_volumes:
          - '/opt/appdata/{{pgrole}}:/homebridge'
          - '/etc/localtime:/etc/localtime:ro'

    - name: 'Setting PG ENV'
      set_fact:
        pg_env:
          TZ: 'America/New_York'
          PUID: '1000'
          PGID: '1000'
          HOMEBRIDGE_CONFIG_UI: '1'
          HOMEBRIDGE_CONFIG_UI_PORT: '8222'
         
    # MAIN DEPLOYMENT #############################################################
    - name: 'Deploying {{pgrole}}'
      docker_container:
        name: '{{pgrole}}'
        image: '{{image}}'
        pull: yes
        published_ports:
          - '{{ports.stdout}}{{extport}}:{{intport}}'
        volumes: '{{pg_volumes}}'
        env: '{{pg_env}}'
        restart_policy: always
        networks:
          - name: plexguide
            aliases:
              - '{{pgrole}}'
        state: started
        labels: '{{pg_labels}}'
The only thing is this needs a config.json file placed in /opt/appdata/hombridge/ with these values to see the home screen to start:

Code:
{
    "bridge": {
        "name": "Homebridge-PG",
        "username": "0E:B5:4E:DB:CA:C8",
        "port": 51853,
        "pin": "031-45-154"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8222,
            "auth": "form",
            "theme": "dark-mode",
            "tempUnits": "c",
            "sudo": false,
            "platform": "config"
        }

]
}
After this you can edit config inside the docker container direct.

My only issue is that I'm too new to docker to know how to code the ability to create this file on install, can someone help me out? For now if you want to use, you can manually install the config after first load and reload the container.

Let me know if you have questions and I'll help. Thanks
Post automatically merged:

Quick Update:

This needs some testing if someone could help.

I only built the container earlier, and didn't pair with iOS. I thought everything worked as it was finding plugins on the network just fine but turns out it might not be. Now that I've returned and had time to try to pair, it seems it won't add itself in the home app like it should.

Although, I'm unsure if this is my setup or it's the container itself? This is due to the fact that most run this on wifi, but I'm trying to run on ethernet to get enhanced speeds. It's the main reason I tried to port this over instead of using my raspberry Pi Zero W that I was before.

If you test could you state your results of trying to pair with an iPhone or other iOS device home app or "Eve" app , the system your running and the networking interface type, so that I may debug.

Thanks!
 
Last edited:

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Maintenance Donations

Recommend NewsGroups

      Up To a 58% Discount!

Trending