So I received my Xiaomi Gateway yesturday and connected it to MiApp, addedd thermometer and wall switch. Then Enabled LAN communication, and started to configure it in HA. And I’m stuck now. Watever I do I always end with:
2017-11-17 09:22:42 INFO (SyncWorker_2) [homeassistant.components.xiaomi_aqara] Discovering Xiaomi Gateways (Try 10)
2017-11-17 09:22:47 INFO (SyncWorker_2) [PyXiaomiGateway] Gateway discovery finished in 5 seconds
2017-11-17 09:22:47 ERROR (SyncWorker_2) [homeassistant.components.xiaomi_aqara] No gateway discovered
2017-11-17 09:22:47 INFO (MainThread) [homeassistant.setup] Setup of domain xiaomi_aqara took 50.2 seconds.
2017-11-17 09:22:47 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Component failed to initialize.
2017-11-17 09:22:47 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=persistent_notification, service=create, service_data=title=Invalid config, message=The following components and platforms could not b
e set up:
- [xiaomi-aqara](https://home-assistant.io/components/xiaomi_aqara/)
Please check your config., notification_id=invalid_config, service_call_id=140187416971672-4>
2017-11-17 09:22:47 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=persistent_notification.invalid_config, old_state=None, new_state=<state persistent_notification.invalid_config=notifying; title=I
nvalid config, message=The following components and platforms could not be set up:
- [xiaomi-aqara](https://home-assistant.io/components/xiaomi_aqara/)
Please check your config. @ 2017-11-17T09:22:47.585736+01:00>>
I tried to set all combination with mac: and without, with host: I get additional error:
2017-11-17 09:20:20 ERROR (MainThread) [homeassistant.setup] Error during setup of component xiaomi_aqara
Traceback (most recent call last):
File "/usr/pkg/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/pkg/lib/python3.6/asyncio/futures.py", line 332, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/pkg/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
future.result()
File "/usr/pkg/lib/python3.6/asyncio/futures.py", line 245, in result
raise self._exception
File "/usr/pkg/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/pkg/lib/python3.6/site-packages/homeassistant/components/xiaomi_aqara.py", line 122, in setup
xiaomi.listen()
File "/root/.homeassistant/deps/lib/python3.6/site-packages/PyXiaomiGateway/__init__.py", line 133, in listen
self._mcastsocket = self._create_mcast_socket()
File "/root/.homeassistant/deps/lib/python3.6/site-packages/PyXiaomiGateway/__init__.py", line 126, in _create_mcast_socket
sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
OSError: [Errno 22] Invalid argument
My configuration is for now:
xiaomi_aqara:
discovery_retry: 10
gateways:
- key: de1j0j5224keprbk
mac: 34:ce:00:8d:46:b3
my LAN card is supporting multicast:
re1: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX>re1: flags=8b43<MULTICAST> mtu 1500
My HA is installed on NetBSD box with pf firewall when I explicity allow multicast, but I don’t even filter anything on inside interface:
# Allow multicast
pass proto udp from any to 224.0.0.0/4 keep state
pass proto udp from 224.0.0.0/4 to any keep state
Xiaomi Gateway has udp/9898 port open (checked from HA host)
dom# nmap -sU -p 9898 10.1.78.213
Starting Nmap 7.60 ( https://nmap.org ) at 2017-11-17 09:28 CET
Nmap scan report for 10.1.78.213
Host is up (0.059s latency).
PORT STATE SERVICE
9898/udp open monkeycom
MAC Address: 34:CE:00:8D:46:B3 (Xiaomi Electronics,co.)
Nmap done: 1 IP address (1 host up) scanned in 0.62 seconds
My HA is 57.3 updated yesturday. I checked and reenabled LAN communication and recreated key couple of times. Even hardresetted whole device. FW of Gateway is 1.4.1_150.0143
So now I’m clueless of what wlese I can check.
Any help would be most appreciated