rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.71k stars 555 forks source link

Unsupported model, cant use xiaomi bulbs #1735

Closed Hobiano closed 1 year ago

Hobiano commented 1 year ago

Describe the bug Logger: miio.device Source: /usr/local/lib/python3.10/site-packages/miio/device.py:159 Found an unsupported model 'yeelink.light.color3' for class 'PhilipsBulb'.

Device information: Xiaomi RGBW Light Bulbs

Thanks

rytilahti commented 1 year ago

You can try to use miiocli yeelight to activate the developer mode. If that works, the bulb should be controllable using homeassistant's yeelight integration.

Hobiano commented 1 year ago

You can try to use miiocli yeelight to activate the developer mode. If that works, the bulb should be controllable using homeassistant's yeelight integration.

thanks for replay i see your talking about before https://community.home-assistant.io/t/integrate-mi-smart-led-bulb-easy-steps/312174 But I am not well versed with codes and Python, and I was hoping to fix the problem in a simpler way than that 😢 i got devices tokens from token_extractor.py after that i got error using tose codes

pip3 install pycrypto
pip3 install python-miio
Running setup.py install for netifaces did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      C:\Users\ihabm\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\config\setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running install
      C:\Users\ihabm\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      building 'netifaces' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> netifaces

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

i will try to download Microsoft C++ Build Tools as shown at error screen but already i have python3 and Microsoft visual studio installed Thanks for your help & i hope to fix this with gui integration 😄

rytilahti commented 1 year ago

Take a look at https://python-miio.readthedocs.io/en/latest/#installation for the git installation instructions. You need to install poetry before running those commands (you can also use pip to install it), but it should just work after that.

edit: actually, the simplest installation would be just calling pip install git+https://github.com/rytilahti/python-miio.git.

Hobiano commented 1 year ago

Take a look at https://python-miio.readthedocs.io/en/latest/#installation for the git installation instructions. You need to install poetry before running those commands (you can also use pip to install it), but it should just work after that.

edit: actually, the simplest installation would be just calling pip install git+https://github.com/rytilahti/python-miio.git.

Thank you this works i used this code miiocli yeelight --ip IP_OF_DEVICE --token TOKEN_OF_DEVICE set_developer_mode 1 setting developer mode to True after that the home assistant detects my bulbs with Yeelight integration like magic :D i used Xiaomi Miot Auto to add my bulbs, now i think i will use this method to use my bulbs Thanks rytilahti

rytilahti commented 1 year ago

Great to hear you got it working! :tada: I think using the yeelight integration on homeassistant is the preferred way for the bulbs that support it as it's based on eventing (i.e., the device pushes updates if its state changes) instead of polling for the state changes.