Closed welpher closed 5 years ago
The gateway publishes multicast messages to 224.0.0.50:9898. This library publishes UDP messages to the gateway IP. The destination port can vary and is part of the discovery response.
https://github.com/Danielhiversen/PyXiaomiGateway/blob/master/xiaomi_gateway/__init__.py#L20-L21 https://github.com/Danielhiversen/PyXiaomiGateway/blob/master/xiaomi_gateway/__init__.py#L105-L107
The discovery port is 4321 (multicast, too). Home Assistant is using tcp port 8123 for the web interface.
I added 9898 and 4321 port (both udp and tcp) to firewalld allowed port , but failed to initialized too
What about
iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT
iptables -A FORWARD -m pkttype --pkt-type multicast -j ACCEPT
iptables -A OUTPUT -m pkttype --pkt-type multicast -j ACCEPT
# or
iptables -A INPUT -s 224.0.0.0/4 -j ACCEPT
iptables -A FORWARD -s 224.0.0.0/4 -d 224.0.0.0/4 -j ACCEPT
iptables -A OUTPUT -d 224.0.0.0/4 -j ACCEPT
I add firewall-cmd rules like this, Both not working for me.
I cannot help here without further details. It's a firewall issue and could be solved by a traffic capture (active vs. inactive firewall).
Finnaly, I give up docker in Centos 7 with firewalld active run HA, I cannot find out why not working in this ENV. But It's working when inactive firewall.
RT,but I turn off the firewall everything is looking good. ENV: Centos 7 host , HA in docker, firewalld public zone
Is there another port using by PyXiaomiGateway except tcp port 8123 ?