marcoraddatz / homebridge-docker

Dockerized Homebridge. No plugins pre-defined, hassle-free setup. Read instructions!
Apache License 2.0
127 stars 47 forks source link

Homebridge not showing up in Home App #44

Closed nicklayb closed 6 years ago

nicklayb commented 6 years ago

Hi guys, I really need help... I'm trying to deploy your docker image on my server which is a CentOS 7 host with docker running a Portainer web ui to deploy containers. Everything seems to go well on the container side. But I can't the the homebridge in my phone's Home App.

What I tried :

Here is my config.json:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:20",
        "port": 51826,
        "pin": "031-45-140"
    },

    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",

    "accessories": [
        {
                "accessory": "mqtt-switch-tasmota",
                "name": "Lamp",
                "url": "mqtt://192.168.2.19",
                "username": "",
                "password": "",
                "topics": {
                        "statusGet": "stat/sonoff/POWER",
                        "statusSet": "cmnd/sonoff/POWER"
                }
        }
    ],

    "platforms": [
    ]
}

My install.sh file :

#!/bin/bash

# npm install -g homebridge-camera-ffmpeg
npm install -g homebridge-mqtt-switch-tasmota

What the container outputs :

/root/.homebridge/.env not found.
Default env variables will be used.
/root/.homebridge/package.json not found.
Installing plugins from /root/.homebridge/install.sh.
+ homebridge-mqtt-switch-tasmota@0.9.5
updated 1 package in 3.692s
[2018-2-1 03:18:16] Loaded plugin: homebridge-mqtt-switch-tasmota
[2018-2-1 03:18:16] Registering accessory 'homebridge-mqtt-switch-tasmota.mqtt-switch-tasmota'
[2018-2-1 03:18:16] ---
[2018-2-1 03:18:16] Loaded config.json with 1 accessories and 0 platforms.
[2018-2-1 03:18:16] ---
[2018-2-1 03:18:16] Loading 0 platforms...
[2018-2-1 03:18:16] Loading 1 accessories...
[2018-2-1 03:18:16] [Lamp] Initializing mqtt-switch-tasmota accessory...
[2018-2-1 03:18:16] [Lamp] Nazwa do RESULT  POWER
Setup Payload:
X-HM://0023ISYWK0CLL
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
[QR Code]
Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 031-45-140 │     
    └────────────┘     

[2018-2-1 03:18:16] Homebridge is running on port 51826.

Ports :

51826/tcp  0.0.0.0:51826
5353/tcp  0.0.0.0:5353
5353/udp  0.0.0.0:5353

At first when I started the container with the UDP protocol, it conflicted with the host ou is having a avahi-daemon for mDNS but I tried without the UDP port and killed the avah-daemon on the host also.

I don't what other information that could help you. I once ran a Homebridge server on a Virtual Machine and it once worked. But I killed it to dockerize it (I changed both username and PIN from the vm). I'm not able to see the hap._tcp in Discovery DNS-SD Browser

Thank you for your help.

yubiao commented 6 years ago

Have you tried changing the port number ("port": 51826,) along with deleting the persist folder?

tlwt commented 6 years ago

Same for me until I put the .env file with the DS_HOSTNAME set into the /volume1/docker

Looking at your logs, you should give that a try.

JeromeD92 commented 6 years ago

Hello,

I've the same problem with my installation under Synology 1517+.

I add a.env file only containing 1 line: the name of my Synology (DS_HOSTNAME)

I event change the port number and try to change my network bond to have only one cable and not a LACP as I used to have.

Nothing for me resolve since 4 days (and nights)

As @nicklayb the log show me thats my Fibaro HC2 gives information, even when a switch position change but nothing from Homebridge to my iPhone.

Any ideas ?

nicklayb commented 6 years ago

As I see in the documentation, le DS_HOSTNAME is for Synology users, which I am not.

I can try to set it but there is no clear information on what it's supposed to be and how it is used.

marcoraddatz commented 6 years ago

You can also use it for non-Synology devices. It forces Avahi to use the hostname you set instead of (re-) creating a default one. UDP ports shouldn't be needed.

nicklayb commented 6 years ago

My server's hostname is vbox.nb so here is how I set my .env

DS_HOSTNAME=vbox.nb
HOMEBRIDGE_ENV=production
HOMEBRIDGE_TIMEZONE=America/NewYork
HOMEBRIDGE_VERSION=latest

Now I get the following exception :

/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56
  dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name,
         ^

Error: dns service error: unknown
    at new Advertisement (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56:10)
    at Object.create [as createAdvertisement] (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:64:10)
    at Advertiser.startAdvertising (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Advertiser.js:47:30)
    at Bridge.Accessory._onListening (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:661:20)
    at HAPServer.emit (events.js:159:13)
    at HAPServer._onListening (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:190:8)
    at EventedHTTPServer.emit (events.js:159:13)
    at EventedHTTPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:65:10)
    at Server.emit (events.js:159:13)
    at emitListeningNT (net.js:1394:10)

You say we should set it to exactly match Synology DSM Control Panel" -> "Info Centre" -> "Server name". But I don't use a Synology and never used one so I don't know what this value is supposed to be equal to

EDIT I removed the UDP port, nothing changes

marcoraddatz commented 6 years ago

@nicklayb What if you remove the dot and replace it with vbox-nb? https://serverfault.com/questions/229331/can-i-have-dots-in-a-hostname

JeromeD92 commented 6 years ago

For me I create a .ENV file and then I obtain this error capture d ecran 2018-02-07 a 21 23 06 Any ideas ?

marcoraddatz commented 6 years ago

@JeromeD92 This seems to be a plugins and/or configuration error. We don't use port 80.

JeromeD92 commented 6 years ago

Hello Marco,

Many thanks for your help.

So I've just added "-p 5353:5353" and relauched this morning, i can't test because I'm abroad.

I 've all my configuration as you asked

If you have any clue and you want me to check or test do not hesitate.

Also Many thanks for your help.

Jérôme DUFRAISSE

Le 8 février 2018 à 09:39, Marco Raddatz notifications@github.com a écrit :

@JeromeD92 This seems to be a plugins and/or configuration error. We don't use port 80.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread. docker run -d --name HomeBridge --restart=always --net=host -p 51826:51826 -p 5353:5353 -v /volume1/docker/homebridge:/root/.homebridge marcoraddatz/homebridge:latest

nicklayb commented 6 years ago

Finally I fixed it with another image https://github.com/oznu/docker-homebridge. But I'm sure it's not related to the image.

I was running a Plex container also running with --net=host on my docker host. It was causing conflicts with the avahi of the homebridge image. I just recreated my plex by only forward port 32400 and now everything is fine.

Thank you for your time!

marcoraddatz commented 6 years ago

Glad to hear that!