@rave. I finally got it all working too. Currently running HA on my HP microserver with Win10 x64 Beer coming your way
Some issues I had (mainly windows based) and hopefully this will help others:
using python 3.5 and NOT 3.6
the error: OSError: [WinError 10049] The requested address is not valid in its context. I had two NIC. I had to change
sock.bind((self.MULTICAST_ADDRESS, self.MULTICAST_PORT)) to
sock.bind((“MyIPAddress”, self.MULTICAST_PORT))
make sure you double quote
pyCyrpto. This is a pain since it won’t compile properly on windows. You need Visual studio build tools for it to work. My main PC had that so I installed using pip3 install and then copied the files across to my HA machine
Friendly names. too me 2 hours to get it working and I feel stupid. The key is not to add it anywhere in configuration.yaml but under home assistant: so it looks like
homeassistant:
name: Home
latitude:
longitude:
elevation:
unit_system: metric
time_zone:
customize:
Make sure its 2 spaces before the word customize. Use Notepad++. Better still, you can include a customize.yaml or even a directory. my code looks like this
homeassistant:
name: Home
latitude:
longitude:
elevation:
unit_system: metric
time_zone:
customize: !include_dir_merge_named customize
I have a directory called customize in the root and then xiaomi.yaml with all the customizations
inside xiaomi.yaml I have
#Door
binary_sensor.door_window_sensor_158d00xxxxab:
friendly_name: D Balcony
binary_sensor.door_window_sensor_158d000xxxx0:
friendly_name: D Bottom Garage
Note the spacing and also you need a space after friendly_name:
@rave, https://github.com/louisZL/lumi-gateway-local-api was updated a few days ago. A few new features include cube controller setup and also changing the light on the gateway inside https://github.com/louisZL/lumi-gateway-local-api/blob/master/网关.md
Hopefully you can work on the new template since currently the Door sensor and PIR are grouped together. Be nice to have the xiaomi app functionality of showing last triggered time. also a listview of historical activation states would be nice too.
@kaze. I have one PIR sensor that was stuck on the ‘on’ state. once I went past it to activate it, it went back to normal
Note with the Door sensor, if you very quickly close and open the sensor ie bring the magnets close and pull it away, it get’s stuck in the ‘closed’ state even though it is actually open. the xiaomi app reports it as closed too.