Home Assistant release with the issue: 0.74.2
Operating environment (Hass.io/Docker/Windows/etc.): docker
home_assistant:
image: homeassistant/home-assistant
hostname: home_assistant
domainname: domain.net
container_name: home_assistant
restart: always
ports:
- 8123
- 1883:1883
- 51827:51827
environment:
- VIRTUAL_HOST=home-assistant.domain.net
- VIRTUAL_PORT=8123
- LETSENCRYPT_HOST=home-assistant.domain.net
- [email protected]
volumes:
- ./homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
depends_on:
- nginx_proxy
privileged: true
networks:
app_net: {}
Component/platform:
homekit:
auto_start: false
automation:
- alias: 'Start HomeKit'
trigger:
- platform: homeassistant
event: start
action:
- delay: 00:03
- service: homekit.start
Description of problem:
When I open the iPhone Home app and I want to add the home assistant it does not find my home assistant. How does the discover works and how to make this work with a docker container?
@johanpalmqvist I got that working by setting the network to host
, is that an option for you?
When set to host
I can't use jwilder/nginx-proxy
to connect.
But why does it not work? I'm not familiar with the discover protocol home homekit.
I do not think homekit setup is related to network_mode: host in this case. I have the same problem (trying to setup homekit using 0.74.2
inside a docker container). So I reverted back to the previous version that I used (0.73.2
) and homekit setup worked inside docker on that release. Note: I use network_mode: host
.
However, I think you have to add network_mode: host
to get homekit to work, because when I remove network_mode: host
from my docker-compose.yaml
file, homekit does cannot connect to any home-assistant accessories.
Note: I have tried to get every integration that I use with home-assistant to work without using network_mode: host
, but homekit is the last integration I cannot get to work without network_mode: host
.
@Gronis thanks for testing, seems like a docker issue related issue then.
I'm not sure how the discovering works and why it needs to be set to host, might be interesting if someone could explain it better.
Then I suggest it needs some clarification in the component documentation to explain this.
I think that the docker container is designed to be used with network_mode: host
. It would be interesting to see if homekit can be used without it though. I'm not sure how the protocol works but it should be doable.
I can report the exact same issue and behavior as @johansmitsnl. My docker-compose file looks similar. I have home assistant v0.76.0.
Anybody get to the bottom of this? I have homekit configured within HA, HA running in Docker with network_mode: host
already, Docker running on Ubuntu on an Intel NUC. Ubuntu firewall is disabled. I've turned up logging and I get no errors. The service goes through the motions pairs and then unpairs. Home app on iOS states _Home couldn't connect to the accessory_
Home Assistant image is 0.77.3
2018-09-29 11:16:25 DEBUG (Thread-17) [pyhap.hap_server] Request POST from address '('10.0.0.24', 54263)' for path '/pair-setup'.
2018-09-29 11:16:25 DEBUG (Thread-17) [pyhap.hap_server] Pairing [1/5]
2018-09-29 11:16:31 DEBUG (Thread-17) [pyhap.hap_server] Request POST from address '('10.0.0.24', 54263)' for path '/pair-setup'.
2018-09-29 11:16:31 DEBUG (Thread-17) [pyhap.hap_server] Pairing [2/5]
2018-09-29 11:16:31 INFO (Thread-17) [pyhap.hap_server] 10.0.0.24 - "POST /pair-setup HTTP/1.1" 200 -
2018-09-29 11:16:31 DEBUG (Thread-17) [pyhap.hap_server] Request POST from address '('10.0.0.24', 54263)' for path '/pair-setup'.
2018-09-29 11:16:31 DEBUG (Thread-17) [pyhap.hap_server] Pairing [3/5]
2018-09-29 11:16:31 DEBUG (Thread-17) [pyhap.hap_server] Pairing [4/5]
2018-09-29 11:16:31 DEBUG (Thread-17) [pyhap.hap_server] Pairing [5/5]
2018-09-29 11:16:31 INFO (Thread-17) [pyhap.accessory_driver] Paired with 91865518-af41-4a96-ab2c-d01b62a308ea.
2018-09-29 11:16:32 INFO (Thread-17) [pyhap.hap_server] 10.0.0.24 - "POST /pair-setup HTTP/1.1" 200 -
2018-09-29 11:16:32 INFO (Thread-15) [pyhap.hap_server] Got connection with ('10.0.0.24', 54264).
2018-09-29 11:16:32 DEBUG (Thread-18) [pyhap.hap_server] Request POST from address '('10.0.0.24', 54264)' for path '/pair-verify'.
2018-09-29 11:16:32 DEBUG (Thread-18) [pyhap.hap_server] Pair verify [1/2].
2018-09-29 11:16:32 INFO (Thread-18) [pyhap.hap_server] 10.0.0.24 - "POST /pair-verify HTTP/1.1" 200 -
2018-09-29 11:16:33 DEBUG (Thread-18) [pyhap.hap_server] Request POST from address '('10.0.0.24', 54264)' for path '/pair-verify'.
2018-09-29 11:16:33 DEBUG (Thread-18) [pyhap.hap_server] Pair verify [2/2]
2018-09-29 11:16:33 DEBUG (Thread-18) [pyhap.hap_server] Pair verify with client '('10.0.0.24', 54264)' completed. Switching to encrypted transport.
2018-09-29 11:16:33 INFO (Thread-18) [pyhap.hap_server] 10.0.0.24 - "POST /pair-verify HTTP/1.1" 200 -
2018-09-29 11:16:33 DEBUG (Thread-18) [pyhap.hap_server] Request GET from address '('10.0.0.24', 54264)' for path '/accessories'.
2018-09-29 11:16:33 INFO (Thread-18) [pyhap.hap_server] 10.0.0.24 - "GET /accessories HTTP/1.1" 200 -
2018-09-29 11:16:34 DEBUG (Thread-18) [pyhap.hap_server] Request POST from address '('10.0.0.24', 54264)' for path '/pairings'.
2018-09-29 11:16:34 DEBUG (Thread-18) [pyhap.hap_server] Removing client pairing.
2018-09-29 11:16:34 INFO (Thread-18) [pyhap.accessory_driver] Unpairing client 91865518-af41-4a96-ab2c-d01b62a308ea.
2018-09-29 11:16:35 INFO (SyncWorker_9) [homeassistant.components.device_tracker.netgear] Scanning
2018-09-29 11:16:35 INFO (SyncWorker_9) [pynetgear] Get attached devices
2018-09-29 11:16:35 INFO (Thread-18) [homeassistant.components.homekit.util] Pincode: 890-58-277
2018-09-29 11:16:35 INFO (Thread-18) [pyhap.hap_server] 10.0.0.24 - "POST /pairings HTTP/1.1" 200 -
When set to
host
I can't usejwilder/nginx-proxy
to connect.
But why does it not work? I'm not familiar with the discover protocol home homekit.
I'm having a similar problem, although I'm using nginx directly. If I run home-assistant via docker-compose with network_mode: host
, I get absolutely no connection to home-assistant. It's running fine (I can inspect it via docker-compose logs
, no errors or signs of problems), but any attempt to connect to the http component fails. When I switch to the ports: - "8123:8123"
variant, it works like a charm, and I can reverse proxy via http://127.0.0.1:8123/
with my nginx.
However, as has been mentioned, doing this kills the Homekit component.
I've tried debugging this, but no luck so far. I have other software that works fine with network_mode: host
, so it doesn't seem to be a problem with my docker/compose setup or versions. Has anyone had a similar experience and more information to share?
I'm having a similar problem, although I'm using nginx directly. If I run home-assistant via docker-compose with
network_mode: host
, I get absolutely no connection to home-assistant. It's running fine (I can inspect it viadocker-compose logs
, no errors or signs of problems), but any attempt to connect to the http component fails. When I switch to theports: - "8123:8123"
variant, it works like a charm, and I can reverse proxy viahttp://127.0.0.1:8123/
with my nginx.
Can you share your docker-compose.yaml
file?
version: '3'
services:
homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant
volumes:
- /home/ha/hass-docker/config:/config
- /etc/localtime:/etc/localtime:ro
devices:
- /dev/ttyACM0:/dev/ttyACM0
restart: always
network_mode: host
Very standard. However, just today I finally got it working. By changing the port from 8123 to something like… 17189. The odd thing is, I have of course already had played around with changing the port to see if there was anything going on with the port already being used, and it never worked. For some reason, today it started working again. And thus I'm also able to use Homekit again. Thanks for getting back to me though!
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:
Hi there, I have just enabled the HomeKit component on my HASS(0.83.2) setup (Docker)
version: '3'
services:
homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant
volumes:
- /home/ben/.hass-config:/config
- /etc/localtime:/etc/localtime:ro
restart: always
network_mode: host
I receive the pin via the frontend and logs state that the bridge has been created. I have the default port forwarded in my firewall and router too.
I have followed all troubleshooting steps to no avail.
Any ideas?
It is not working with Hass.io (0.84.6)
There is no way for me to set network_mode: host right?
With the hassbian install it worked correctly
Anyone got this working without network_mode: host
?
I would love to avoid this, so my HA goes through my reverse proxy (traefik) with SSL, authentication etc...
I don't understand why forwarding the ports on the docker container is not enough (I currently have no idea how HomeKit protocol works).
I though we were missing some crucial ports that HomeKit requires (mDNS)
I've been reading these links and digging:
Apple Docs and this Quora thread
So I added the following ports, but even though, no success 😞
ports:
- 8123:8123
- 1900:1900/udp
- 5350:5350/udp
- 5351:5351/udp
- 5353:5353/udp
Anyone else managed to get this working?
I'm also having this issue running version 0.84.6 via docker-compose with network_mode set to host.
When i run a netstat -l -t
i do not see any reference of the default 51827 port. I do get the the pin number in dashboard so my assumption is that it is enabled but that something is not firing up properly.
root@hass:/opt/docker/hassio# netstat -l -t
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN
tcp 0 0 localhost:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:https 0.0.0.0:* LISTEN
tcp6 0 0 [::]:8110 [::]:* LISTEN
tcp6 0 0 [::]:http-alt [::]:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:7443 [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 [::]:8123 [::]:* LISTEN
tcp6 0 0 [::]:1883 [::]:* LISTEN
tcp6 0 0 [::]:9000 [::]:* LISTEN
my homekit enablement in the configuration.yaml
# Enable HomeKit
homekit:
port: 51827
Update: I did some more troubleshooting and logged into the docker container and ran a netstat -l -t
and i got the following
root@e5258b8fc52f:/usr/src/app# netstat -l -t
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:51827 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8123 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.11:37531 0.0.0.0:* LISTEN
still nothing has changed on the host
docker inspect
gives me the following output
root@hass:/opt/docker/hassio# docker inspect e5258b8fc52f_e5258b8fc52f_home-assistant
[
{
"Id": "e5258b8fc52f0f40ba239de6001bc796d7a881b6a5afac57abac8b269ecbe9a5",
"Created": "2019-01-03T17:39:11.190099291Z",
"Path": "python",
"Args": [
"-m",
"homeassistant",
"--config",
"/config"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 24889,
"ExitCode": 0,
"Error": "",
"StartedAt": "2019-01-12T22:57:57.885776965Z",
"FinishedAt": "2019-01-12T22:57:56.793833508Z"
},
"Image": "sha256:7ff664fa081eb0db3ae6b872b4fd618696a2ae1ac1aef7a510416595c8086f54",
"ResolvConfPath": "/var/lib/docker/containers/e5258b8fc52f0f40ba239de6001bc796d7a881b6a5afac57abac8b269ecbe9a5/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/e5258b8fc52f0f40ba239de6001bc796d7a881b6a5afac57abac8b269ecbe9a5/hostname",
"HostsPath": "/var/lib/docker/containers/e5258b8fc52f0f40ba239de6001bc796d7a881b6a5afac57abac8b269ecbe9a5/hosts",
"LogPath": "/var/lib/docker/containers/e5258b8fc52f0f40ba239de6001bc796d7a881b6a5afac57abac8b269ecbe9a5/e5258b8fc52f0f40ba239de6001bc796d7a881b6a5afac57abac8b269ecbe9a5-json.log",
"Name": "/e5258b8fc52f_e5258b8fc52f_home-assistant",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "docker-default",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/etc/localtime:/etc/localtime:ro",
"/opt/docker/hassio/config:/config:rw"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "hassio_default",
"PortBindings": {
"8123/tcp": [
{
"HostIp": "",
"HostPort": "8123"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/8b59d12a120951f46760d7b324ea4f930adc5f93826855c8511e2dab9d9f35dc-init/diff:/var/lib/docker/overlay2/39bbd613cdc9a4a0433dca3b8810ca2b532db2aed0eb1144c79e6bdcf04187f7/diff:/var/lib/docker/overlay2/7bc133d72cc9e366edd24d281503ad882030af96b0f8389fb8125ad533959fee/diff:/var/lib/docker/overlay2/4edc34babb42cbef9429e5ca62daa50976541cb45771376b201b90a00341a1a4/diff:/var/lib/docker/overlay2/417c9ea8e774c47e2c0f55ccc1d10afd47e652334713713e4104e9818c4d0540/diff:/var/lib/docker/overlay2/a4bd3f195d73990f7a5792524d2fd4af1721b7b3206c3f4f6d362816609fa458/diff:/var/lib/docker/overlay2/50de1e29d655ec5ba46ba3f2860ae1d1c866bd1a4bec496fd8f86b83e9f42cd4/diff:/var/lib/docker/overlay2/64acb1cb913735ecfecdb4bad220c4ec2ff383e8db98234e61daba6cf252c5bc/diff:/var/lib/docker/overlay2/908fbb2cea066347c0882a4a48061342ac783ab0bc5eff81d0d69ea691e4c6d1/diff:/var/lib/docker/overlay2/dbbb787b5d7865b9137c869025151ace043e0ac9b71705e0f49f22c13bcb884b/diff:/var/lib/docker/overlay2/10a3174b33a33ff5b3e0530b3599729df7fd417eb4fbdda329b9ddebe4849ef9/diff:/var/lib/docker/overlay2/8a4874c77031f5be337684d5dbad87f1fa4d7e8ad54aa1e6ead8f47b5a99e760/diff:/var/lib/docker/overlay2/f20ddf4fa2989415d18433c66b6716c3eef1699e41c4165734db4c4ae63cb3d0/diff:/var/lib/docker/overlay2/6639ec281cd9be04acaa936ef38e4338d77ccffae8e4a2e419ebafa022bf062a/diff:/var/lib/docker/overlay2/28e446a8307e840bd01729f6b3b36ffd0934e652bf41224945eb981bbb9f0042/diff:/var/lib/docker/overlay2/42e58c4dd37e1ce67891a72a8d64907f7594aad3f54ebad8cde2257b47115527/diff",
"MergedDir": "/var/lib/docker/overlay2/8b59d12a120951f46760d7b324ea4f930adc5f93826855c8511e2dab9d9f35dc/merged",
"UpperDir": "/var/lib/docker/overlay2/8b59d12a120951f46760d7b324ea4f930adc5f93826855c8511e2dab9d9f35dc/diff",
"WorkDir": "/var/lib/docker/overlay2/8b59d12a120951f46760d7b324ea4f930adc5f93826855c8511e2dab9d9f35dc/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/opt/docker/hassio/config",
"Destination": "/config",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/etc/localtime",
"Destination": "/etc/localtime",
"Mode": "ro",
"RW": false,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "e5258b8fc52f",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"8123/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D",
"PYTHON_VERSION=3.6.7",
"PYTHON_PIP_VERSION=18.1"
],
"Cmd": [
"python",
"-m",
"homeassistant",
"--config",
"/config"
],
"ArgsEscaped": true,
"Image": "homeassistant/home-assistant",
"Volumes": {
"/config": {},
"/etc/localtime": {}
},
"WorkingDir": "/usr/src/app",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "95e8b7024e6e08991d8b995e221e596022c6bc07e336f2ddbf37c841f453f3bf",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "hassio",
"com.docker.compose.service": "homeassistant",
"com.docker.compose.version": "1.17.1",
"maintainer": "Paulus Schoutsen <[email protected]>"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "2bb24af6236fa1a48e47c27bf5d3a9fb18b6ba03b4dbc3bba3f6e917bdf02865",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"8123/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8123"
}
]
},
"SandboxKey": "/var/run/docker/netns/2bb24af6236f",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"hassio_default": {
"IPAMConfig": null,
"Links": [
"hassio_mqtt_1:hassio_mqtt_1",
"hassio_mqtt_1:mqtt",
"hassio_mqtt_1:mqtt_1"
],
"Aliases": [
"e5258b8fc52f",
"homeassistant"
],
"NetworkID": "c04cc2c9a21dca43236b0d4c29fa7ec458614a5b2b4811f1fc49fe4cb65188ef",
"EndpointID": "3816c66abc8f709e5e44d2a5234413dd014d9c446b14a3b80a8e8edd105e64b1",
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:12:00:03",
"DriverOpts": null
}
}
}
}
]
doesnt seem to be passing the homekit port
@XIRGO please pastebin long config files
x
Anyone got this working without
network_mode: host
?
I would love to avoid this, so my HA goes through my reverse proxy (traefik) with SSL, authentication etc...I don't understand why forwarding the ports on the docker container is not enough (I currently have no idea how HomeKit protocol works).
@jvenezia
As a workaround, you can use network_mode: host and then add to your rules.toml the following, which I use to have traefik reverse proxy non docker services. I can confirm it works. I'd prefer not to have to use network_mode, but it will do for now
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[backends]
[backends.backend-homeassistant]
[backends.backend-homeassistant.servers]
[backends.backend-homeassistant.servers.server-homeassistant-ext]
url = "http://172.16.68.62:8123"
weight = 2
[frontends]
[frontends.frontend-homeassistant]
backend = "backend-homeassistant"
passHostHeader = true
InsecureSkipVerify = true
[frontends.frontend-homeassistant.routes]
[frontends.frontend-homeassistant.routes.route-homeassistant-ext]
rule = "Host:homeassistant.example.com"
@XIRGO please pastebin long config files
Ok, so today I upgraded to the latest version and tried it again. Everything is now working!
I upgraded to version 0.85.0
@XIRGO what is the config you use now? Using the network host mode?
@XIRGO what is the config you use now? Using the network host mode?
My docker-compose file is back to what it was originally using network host mode. See below
version: '3'
services:
mqtt:
image: matteocollina/mosca
volumes:
- /opt/docker/mqtt:/db
ports:
- 1883:1883
mqttbridge:
image: stjohnjohnson/smartthings-mqtt-bridge
volumes:
- /opt/docker/mqtt-bridge:/config
ports:
- 8080:8080
links:
- mqtt
homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant:latest
network_mode: host
volumes:
- /opt/docker/hassio/config:/config
- /etc/localtime:/etc/localtime:ro
restart: always
My setup uses an nginx reverse proxy
Okay, I have updated and I am too, running through docker, however the Home app still does not show any accessories :(
Okay, I have updated and I am too, running through docker, however the Home app still does not show any accessories :(
Does HomeAssistant Bridge showing when you try add an accessory?
Can you share your docker-compose.yaml file and your version
The accessory does not show up, I have the code of it on my Home Assistant homepage as a component.
My docker compose is the basic, with network mode host.
The accessory does not show up, I have the code of it on my Home Assistant homepage as a component.
My docker compose is the basic, with network mode host.
Which version are you currently running of Home Assistant?
I have just updated to 0.86.1. No change unfortunately. I tried to set up a new instance of HA with a blank config file then adding homekit to the config, same happened. I have also tried exposing the port via the compose file, did not help. I have the port forwarded in my router and allowed through ufw of the host linux.
same issue here running version 0.87.0b0
Here is my configuration working with network_mode: host.
version: '3'
services:
homeassistant:
container_name: home-assistant
hostname: home_assistant
image: homeassistant/home-assistant
network_mode: host
volumes:
- /home/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
restart: always
And the important part. Add the following firewall rules to your machine running dockers (I'm using Photon OS):
iptables -I INPUT -p tcp --dport 8123 -j ACCEPT
iptables -A INPUT -p udp -m multiport --dports 5353 -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 51827 -j ACCEPT
Port 5353 is important because of the mDNS protocol. 51827 is for the homekit protocol. 8123 is necessary for the frontend GUI.
@albermav do you know if there is a solution for hass.io?
@albermav do you know if there is a solution for hass.io?
I don't know sorry, my tests were done with the HA docker image
Here is my configuration working with network_mode: host.
version: '3' services: homeassistant: container_name: home-assistant hostname: home_assistant image: homeassistant/home-assistant network_mode: host volumes: - /home/homeassistant:/config - /etc/localtime:/etc/localtime:ro restart: always
And the important part. Add the following firewall rules to your machine running dockers (I'm using Photon OS):
iptables -I INPUT -p tcp --dport 8123 -j ACCEPT iptables -A INPUT -p udp -m multiport --dports 5353 -j ACCEPT iptables -A INPUT -p tcp -m multiport --dports 51827 -j ACCEPT
Port 5353 is important because of the mDNS protocol. 51827 is for the homekit protocol. 8123 is necessary for the frontend GUI.
I'll give this a try when I get home. I think I need to whitelist 5353 as the other two are already allowed...
I had some trouble with using this with my firewall on with Hass.io (on centos), adding this ports to the firewall fixed my issue!
I'm not sure if this is the same issue folks are describing, but my setup will randomly disconnect from homekit. One moment everything is detected within the Home app and working fine, and the next moment nothing is detected. I am on home assistant 90.2 on docker with nginx and letsencrypt. Any ideas?
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Was someone able to solve this problem?? I have exactly this problem, thanks
Was someone able to solve this problem?? I have exactly this problem, thanks
I was able to resolve this by upgrading my instance to a later version. I have since completed a few other upgrades and everything is still working
Unfortunately, setting the HA network to host results in nginx reverse proxy to not work. I cannot seem to get the best of both worlds, where nginx reverse proxy works and HomeKit integration works.
Unfortunately, setting the HA network to host results in nginx reverse proxy to not work. I cannot seem to get the best of both worlds, where nginx reverse proxy works and HomeKit integration works.
This is actually how I have it setup. I have HA network set to host and I use an nginx reverse proxy for port 443 to proxy_pass the HA port to 443 (https)
Unfortunately, setting the HA network to host results in nginx reverse proxy to not work. I cannot seem to get the best of both worlds, where nginx reverse proxy works and HomeKit integration works.
This is actually how I have it setup. I have HA network set to host and I use an nginx reverse proxy for port 443 to proxy_pass the HA port to 443 (https)
Are you using nginx in a docker container? For all my searching, it seemed as though nginx in a docker container could not be a reverse proxy for HA if it is set to host. I also am an nginx noob, and really don't know what I am talking about.
Unfortunately, setting the HA network to host results in nginx reverse proxy to not work. I cannot seem to get the best of both worlds, where nginx reverse proxy works and HomeKit integration works.
This is actually how I have it setup. I have HA network set to host and I use an nginx reverse proxy for port 443 to proxy_pass the HA port to 443 (https)
Are you using nginx in a docker container? For all my searching, it seemed as though nginx in a docker container could not be a reverse proxy for HA if it is set to host. I also am an nginx noob, and really don't know what I am talking about.
my nginx is not in a docker container. I have it installed on the barebone system and manage my nginx site-enabled independently
That makes more sense. I think I am getting close, but no dice yet.
Got it working just now. I am running the linuxserver/letsencrypt container including nginx. HomeAssistant is set to net=host. In the homeassistant.subdomain.conf file, I changed the http://$upstream_homeassistant:8123 (two total instances in the conf) to my host IP. I have https via reverse proxy AND homekit working now.
Got it working just now. I am running the linuxserver/letsencrypt container including nginx. HomeAssistant is set to net=host. In the homeassistant.subdomain.conf file, I changed the http://$upstream_homeassistant:8123 (two total instances in the conf) to my host IP. I have https via reverse proxy AND homekit working now.
Great! @robertomano24 can you attach your docker-compose.yml
file here?
I am not sure how to obtain that file since I am running docker on synology (which must be some sort of portainer situation....I am not quite sure).
@robertomano24 is this not the same as setting a different ip_address here?
https://www.home-assistant.io/integrations/homekit/#ip_address
P.S. having the same issue with lets-encrypt nginx-proxy in docker.
Edit:
I had a similar issue while using auto discovery for shelly devices within docker container and there is a fix for this issue here: https://github.com/StyraHem/ShellyForHASS/blob/master/util/proxy.py.
Maybe we could adapt this solution and make it work for HomeKit as well.
Edit 2:
I don't think this will work without network_node:host, therefore I switched to hass.io which already contains plugins for nginx+letsencrypt
I got it working with the documentation that was available: https://www.home-assistant.io/integrations/homekit/#docker-network-isolation
I had to put avahi in reflector mode with the created bridge interface https://www.home-assistant.io/integrations/homekit/#advertise_ip
I got it working with the documentation that was available: https://www.home-assistant.io/integrations/homekit/#docker-network-isolation
I had to put avahi in reflector mode with the created bridge interface https://www.home-assistant.io/integrations/homekit/#advertise_ip
@johansmitsnl Any chance you can share the details of the avahi setup? I've got the docker side running correctly with a bridged network that has ports exposed for 8123, 5353 & 51827. But I can not discover the bridge so I'm assuming it's the avahi setup that is incorrect
And #28619
I had it working but it seems broken now, but not due to communication issues.