maxinminax / node-mihome

Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more
MIT License
121 stars 35 forks source link

Fix EU Issues #37

Open scaccoman opened 3 years ago

scaccoman commented 3 years ago

Hi @maxinminax, I'm located in the EU and I've recently purchased a few Xiaomi smart home devices. While testing the NPM package, I found a couple of issues that I believe are the result of my Mi Account region settings (DE):

  1. The Miio Device constructor doesn't allow to specify a country different than the default CN, this causes Mi Cloud calls to be performed to the Chinese API URL (which returns nothing).
  2. Although further testing would be required to be 100% sure, I believe that the region settings influence the properties that can be retrieved for a given device. While testing with my viomi.vacuum.v7, multiple properties (defined in the device class) weren't available, I believe it's better to have a soft check for the length of the properties rather than throwing an invisible error.

Please let me know if there's anything I should change and/or improve, I'd be happy to contribute to the project on a regular basis.

Pittini commented 3 years ago

Hi @scaccoman , i'm also located in EU/DE and using node-mihome together with iobroker in this skript. For me, there is no problem with de or cn cloud, it works fine. So maybe, your problem is located elsewhere.