Closed ja-finn closed 3 years ago
I wonder if the plugin is listening on the wrong interface. It attempts to find the correct interface by pinging the Hubitat hub and listening on whatever interface that message went out on, which works on a standard HA distribution on a Pi and with the docker container I develop on. Maybe it should just listen on 0.0.0.0.
That could actually be it, the container has multiple interfaces
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
190: eth1@if191: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue state UP link/ether 02:42:0a:00:05:20 brd ff:ff:ff:ff:ff:ff
inet 10.0.5.32/24 brd 10.0.5.255 scope global eth1
valid_lft forever preferred_lft forever
192: eth2@if193: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP link/ether 02:42:ac:12:00:03 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.3/16 brd 172.18.255.255 scope global eth2
valid_lft forever preferred_lft forever
194: eth0@if195: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1450 qdisc noqueue state UP link/ether 02:42:0a:ff:00:1b brd ff:ff:ff:ff:ff:ff
inet 10.255.0.27/16 brd 10.255.255.255 scope global eth0
valid_lft forever preferred_lft forever
Any reason why it can't just listen on 0.0.0.0 like the HA interface does? Is it so it can supply the IP to Hubitat plugin?
I'll try to launch it again this evening and just connect it to a single network, see if that solves it.
I weren't actually able figure out how to launch it with a single interface in swarm mode. I've tried removing the exposed port from the config and then running docker service update --publish-add published=38110,target=38110,mode=host homeassistant_app
after it is launched. This works and the status updates as it should.
I guess this means you are correct, that the traffic is routed to a different interface than what the integration is bound to.
Edit: for completeness if anyone else runs into the same issue, it works by publishing your port in host mode in your stack file. Note that it needs to be v3.2+ for this to work
...
ports:
- '8123:8123'
- mode: host
target: 38110
published: 38110
protocol: tcp
...
I'm closing this as I'm happy with the workaround. I didn't find any similar issues with anyone running HA in swarm mode so I'm guessing it's an edge case.
Thank you very much for pointing me in the right direction:)
I like the idea of listening on 0.0.0.0; I don't see any reason off the top of my head why that wouldn't work. I opened an issue in hubitatmaker (the library that's actually doing the listening) to look into that.
Hi
I'm struggling to get the POST events from Hubitat to make it back to the plug-in. The plug in communicates with Hubitat and updates the POST address/port correctly. Switches turns off when controlled by HomeAssistant and the status is updated in Hubitat but not in HA.
I'm running HA in docker swarm mode.
Netstat inside the container shows the port listening
Probing the ports are successful for HA web interface but not for the plug-in
I assume that it should have responded to this?
Log from Hubitat
Log from HA
Versions Home Assistant: 2021.5.0 Hubitat integration: 0.6.6 Hubitat: 2.2.7.121