Xiaomi Config problem after upgrade

Finally I updated from 0.49 to the latest HA (0.57.3) and everything is fine except my Xiaomi Gateway integration :frowning: HA lists xiaomi-aqara under Invalid Config.

I know that I had to change the sid to mac. But when I do that I can see an error in the log file that asks for my secret xiaomi_sid (and yes I also changed it in configuration.yaml).

When I add this line to the secrets, HA at least starts and I can see another error

2017-11-15 17:33:30 ERROR (Thread-4) [homeassistant.util.package] Unable to install package PyXiaomiGateway==0.6.0: Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-fp1255t3/cryptography/
2017-11-15 17:33:30 ERROR (MainThread) [homeassistant.setup] Not initializing xiaomi_aqara because could not install dependency PyXiaomiGateway==0.6.0
2017-11-15 17:33:30 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi_aqara: Could not install all requirements.

I searched the community and found something to uninstall pycryptodome and install pycrypto - but it is already installed :frowning:

Please help!

my working config:

xiaomi_aqara:
# define interface for broadcast discovery
  interface:  !secret xiaomi_gw_int   
  discovery_retry: 5
  gateways: 
   - key: !secret xiaomi_key

I don’t have the interface line. Everything else looks similar!

Try doing what is described here: https://github.com/home-assistant/home-assistant/issues/10338

Due to this issue, documentation will be enhanced with the following:

  • If the required library “PyXiaomiGateway” cannot be installed you will need to install some missing system dependencies python3-dev, libssl-dev, libffi-dev manually (eg. sudo apt-get install python3-dev libssl-dev libffi-dev).

I can’t seem to install the cryptography portion…

pi@hassbian:~ $ sudo pip3 install cryptography                                  Downloading/unpacking cryptography
  Downloading cryptography-2.1.3.tar.gz (441kB): 441kB downloaded
  Running setup.py (path:/tmp/pip-build-s4hchdtg/cryptography/setup.py) egg_info for package cryptography
    error in cryptography setup command: Invalid environment marker: python_version < '3'
    Complete output from command python setup.py egg_info:
    error in cryptography setup command: Invalid environment marker: python_version < '3'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-s4hchdtg/cryptography
Storing debug log for failure in /root/.pip/pip.log

This is on a Hassbian install… of course - the PyXiaomi portion fails too:

Downloading/unpacking PyXiaomiGateway==0.6.0
  Downloading PyXiaomiGateway-0.6.0.tar.gz
  Running setup.py (path:/tmp/pip-build-b8q3sus9/PyXiaomiGateway/setup.py) egg_info for package PyXiaomiGateway

Downloading/unpacking cryptography==2.1.1 (from PyXiaomiGateway==0.6.0)
  Downloading cryptography-2.1.1.tar.gz (441kB): 441kB downloaded
  Running setup.py (path:/tmp/pip-build-b8q3sus9/cryptography/setup.py) egg_info for package cryptography
    error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'
    Complete output from command python setup.py egg_info:
    error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-b8q3sus9/cryptography
Storing debug log for failure in /root/.pip/pip.log

Any pointers? It really does hurt being a linux newb.

Brendan

@brendanheyu See troubleshooting part of the documentation

To install cryptography, I think you need to be in the virtual environment, usually that is the setup in hassbian.

sudo -i -u homeassistant bash
source /srv/homeassistant/bin/activate
pip3 install cryptography

Let us know how it goes.

Finally is able to do the troubleshooting and it is working again.

@Danielhiversen you are right (or the trouble shooting doc :wink: ), you should create the Gateway key with Android and not with iOS. Everything is working again, fter I used BlueStack on my Mac and created a new key.

Thanks everyone for the help and the patience.

Daniel