After a whole night of not connecting, I somehow finally got my gateway to connect. I’ve followed the steps and got the LAN communication protocol password and turned it on. Added it to the configuration.yaml like so
Given the other errors you’re having I’d say your problem isn’t the gateway configuration. Do they still occur if you comment (# at start of line) out the xiaomi stuff?
Is the gateway on the same switch/router as your server?
You can try just with
xiaomi:
But I wouldn’t hold my breath that would fix it. I’m very much an amateur so my ability to help is limited. If it’s still giving those other errors probably best to make a new post, if you can’t find the answer in existing ones, in the Configuration forum as that way those who are more experienced with problems like that can help you.
Remember Home Assistant is very much in development so having issues getting it working ok is sort of normal. It took me about a week and three times I had to wipe the sd and start again to get my server working, though I did learn so much along the way.
Once you’ve solved those other problems hopefully the xiaomi stuff will work.
Hi @rave and @Danielhiversen.
What are your maturity criteria to add the beta xiaomi component to HA main?
I’ve been watching the emergence of the ikea TRÅDFRI component go from nothing to included in main in 2 weeks and (imo) it’s at nowhere near the level of maturity and received the amount of community testing as this huge effort!
I agree, and I think it should have been added to the main HA repo a long time ago.
But it is up to @rave to decide when he wants to do so.
Rave has written some arguments for not adding it to the main repo earlier. Even if we disagree with his decision, we have to respect it.
I would first test with a single light, not a whole group. Also maybe it’s the float, try it with int. But indeed a bit more specifics why and what does not work would be nice…
I also agree we should be moving to the main repo. The component is working pretty solid. API is stable. New things are added, but so far nothing has been broken. Only known issue is that door/window and motion sensors flip to “open”/“movement” state on power loss, but this can be solved by removing/making optional functionality.
I have found the reason I was getting the “Invalid Key” messages.
In order for the key to work, the HA server needs to receive a Token from the gateway. This Token is only sent over IP multicast, not as a direct unicast to your HA server. If your HA server does not receive these multicast packets, it will not have all the data it needs to properly calculate the key that the gateway expects, and it will attempt with an invalid key.
For whatever reason my ESXi-hosted virtual machine running the HA installation is not receiving the multicast packets even though it is supposed to be on the same subnet and switch.
I installed Domoticz on a windows laptop that I could connect directly to the same WLAN SSID that the gateway is connected to, and it can control the gateway light just fine. I’d imagine HA would do the same, but I couldn’t bother trying to get it installed on Windows.
Now I just need to figure out why these multicast packets don’t reach the VM.
I’m replying to Ordep so (s)he’ll also see this. I can now confirm what I wrote above about why the key was invalid.
I have my HA network segregated to VLAN 60 so I can keep it away from the secure networks.
I have a vSwitch in my ESXi 5.5 host that has a Trunk port group with VLAN ID 4096 (All) and another with VLAN ID 60 which is for home automation use. I had my firewall connected to the Trunk port group and my HA machine connected to VLAN 60 port group. As long as it was there, it would not receive any multicast packets. When I put the HA machine into the trunk port group and configure a VLAN 60 in it, suddenly it can receive the multicasts and no more Invalid Key messages! I can control the GW fully now.
Lesson learned: On your HASS host, run “tcpdump net 224.0.0.0/4” and see if you can spot multicast packets from your gateway. If not, your HASS can’t receive the token from the gateway and that’s why your key comes across as invalid.
17-04-14 21:49:12 ERROR (MainThread) [homeassistant.core] Invalid service data for light.turn_on: expected int for dictionary value @ data[‘brightness’]. Got ‘12.95’
@rave I also agree that this is ready for being included in the main HA repo. You can have a personal fork of HA so that you can quickly work on the component and submit PR’s to HA…
I have a Gateway and several sensors which worked flawlessly until recent firmware update. Now I cannot connect the gateway via the Mi Home App after reset via router. Only way I can connect is via a mobile phone tether. Is it possible to use HA if I am unable to connect gateway using Mi Home App? Newbie.