Hello Fooxy.
Thank you for you efforts. Component work fine. I’ve already installed it. There is small issue with temp sensor naming. It appears as device name. I’ve changed code in same way as for humidity sensor. So it appears now as device_name_temperature.
Fantastic work guys, just one thing I’ve run in to. A lot of wireless APs don’t forward multicast packets onto wifi clients. After enabling developer mode, it looked like the gateway wasn’t sending the UDP packets when I was using Wireshark on my laptop. When I connected the ethernet cable they appeared.
Hopefully this helps someone. Keep up the good work.
If you can set your router to forward multicast packets to wifi clients then that would probably work but I couldn’t in mine (Netgear R7000) with stock firmware. I’m sure dd-wrt has something though.
Otherwise yes you’ll need to have HASS hard wired.
Can anyone give me a quick description of how to utilize Jon’s code ? I have Fooxy’s plugin working, but can’t figure out how to use Jon’s. If i read correctly, it’s not a finished plugin yet, but keen just to see the output coming from the gateway.
Do the updates just appear? mine is currently on 1.2.xx and is taking a while to update. I assume i just have to keep checking for updates until i get to the right version?
I had issues updating too. I found that if i initiate the update, wait for the gateway to start flashing yellow, then press the home button on my phone, it would allow it to complete the update. just wait until the gateway stops flashing, and it should be updated.
I fired up your script first time, and it worked, across wireless too. I edited the MQTT server and changed the topic to start with a / (ie: /xiaomi/switch/158d0001256870/status click)
then used the following automations to toggle some lights:
I can buy the Xiaomi hub and accessories and it integrates well with HA.
For example using the Xiaomi switch to trigger a Hue light. And is all relatively easy to program
not yet… i have grabbed @jon1012’s script, and have it running as a service on my linux box. It in turn publishes to MQTT, which i have a server running, then HA subscribes to those topics and reacts depending on what i expect it to do.
so at the moment - no it is not ‘easy’ not particularly hard if you are not a newbe… there is not a lot of information readily available on the net about the Xiaomi stuff. Shouldn’t be too long until it is all integrated i would think