rytilahti / python-miio

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

Found an unsupported model 'philips.light.sread3' for class 'PhilipsEyecare' #1834

Open nbgvfhg89 opened 1 year ago

nbgvfhg89 commented 1 year ago

Before submitting a new request, use the search to see if there is an existing issue for the device.

If your device is rather new, it is likely supported already by the genericmiot integration. This is currently available only on the git version (until version 0.6.0 is released), so please give it a try before opening a new issue.

Device information:

Use miiocli device --ip <ip address> --token <token> info.

miiocli philipseyecare --ip 192.168.1.190 --token 0cdff3c980981b8d2abe0a2e578bb86f status WARNING:miio.device:Found an unsupported model 'philips.light.sread3' for class 'PhilipsEyecare'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/ ERROR:miio.miioprotocol:Got error when receiving: {'code': -9999, 'message': 'user ack timeout'} ERROR:miio.click_common:Exception: Unable to recover failed command Traceback (most recent call last): File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 215, in send self._handle_error(payload["error"]) File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 275, in _handle_error raise RecoverableError(error) miio.exceptions.RecoverableError: {'code': -9999, 'message': 'user ack timeout'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 215, in send self._handle_error(payload["error"]) File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 275, in _handle_error raise RecoverableError(error) miio.exceptions.RecoverableError: {'code': -9999, 'message': 'user ack timeout'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 215, in send self._handle_error(payload["error"]) File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 275, in _handle_error raise RecoverableError(error) miio.exceptions.RecoverableError: {'code': -9999, 'message': 'user ack timeout'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 215, in send self._handle_error(payload["error"]) File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 275, in _handle_error raise RecoverableError(error) miio.exceptions.RecoverableError: {'code': -9999, 'message': 'user ack timeout'}

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/user/.local/lib/python3.11/site-packages/miio/click_common.py", line 54, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/click_common.py", line 305, in wrap result = kwargs["result"] = func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/click/decorators.py", line 92, in new_func return ctx.invoke(f, obj, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/click_common.py", line 270, in command_callback return miio_command.call(miio_device, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/click_common.py", line 218, in call return method(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/click_common.py", line 185, in _wrap return func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/integrations/philips/light/philips_eyecare.py", line 105, in status values = self.get_properties(properties) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/device.py", line 308, in get_properties values.extend(self.send(property_getter, _props[:max_properties])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/device.py", line 122, in send return self._protocol.send( ^^^^^^^^^^^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 249, in send return self.send( ^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 249, in send return self.send( ^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 249, in send return self.send( ^^^^^^^^^^ File "/home/user/.local/lib/python3.11/site-packages/miio/miioprotocol.py", line 257, in send raise DeviceException("Unable to recover failed command") from ex miio.exceptions.DeviceException: Unable to recover failed command

rytilahti commented 1 year ago

Did you get any outpu for miiocli device --ip <ip address> --token <token> info?

Could you also try miiocli genericmiot --ip <ip address> --token <token> status to see if it works, as it's likely that this uses miot for comms.

TheNetos commented 7 months ago

Hi, it looks like on version 0.6.0.dev0 the problem has gone away.

Output from commands:

❯ miiocli --version
miiocli, version 0.6.0.dev0
❯ miiocli device --ip x.y.z.21 --token e21...6cc info
Running command info
Model: philips.light.sread3
Hardware version: esp8266
Firmware version: 2.0.8_0022
Supported using: GenericMiot
Command: miiocli genericmiot --ip x.y.z.21 --token e21...6cc
Supported by genericmiot: True
❯ miiocli genericmiot --ip x.y.z.21 --token e21...6cc status
Running command status
Service [bold]Light (light)[/bold]
    Switch Status (light:on, access: RW): False (<class 'bool'>, )
    Mode (light:mode, access: RW): Custom (value: 0) (<class 'int'>, choices: Custom (0), Child Mode (1), Adult Reading (2), Mobile Phone Computer (3))
    Brightness (light:brightness, access: RW): 1  (<class 'int'>, min: 1, max: 100, step: 1)
Service [bold]个性化功能 (aditions)[/bold]
     (aditions:dvalue, access: RW): 0 None (<class 'int'>, min: 0, max: 21600, step: 1)
    eyecare-switch (aditions:eyecare-switch, access: RW): False (<class 'bool'>, )
     (aditions:notify-switch, access: RW): False (<class 'bool'>, )
     (aditions:notify-time, access: RW): 0:40:00 (<class 'int'>, min: 1, max: 120, step: 1)
     (aditions:last-dv, access: R): 0 None
    night-en (aditions:night-en, access: RW): True (<class 'bool'>, )
Service [bold]debug (debug)[/bold]
    flash读写 (debug:flash-rw, access: RW): flash[0]=0x0  (<class 'str'>, )
    重启原因读取 (debug:reboot-reason, access: R): "01030101""01010101""03010303""00000000"
    获取编译时间 (debug:build-time, access: R): Oct 15 202014:45:00
❯ miiocli philipseyecare --ip x.y.z.21 --token e21...6cc info
Running command info
Model: philips.light.sread3
Hardware version: esp8266
Firmware version: 2.0.8_0022
Supported using: GenericMiot
Command: miiocli genericmiot --ip x.y.z.21 --token e21...6cc
Supported by genericmiot: True
TheNetos commented 7 months ago

But support for the philips.light.sread3 device seems to be still lacking:

❯ miiocli philipseyecare --ip x.y.z.21 --token e21...6cc sensors
Running command sensors
WARNING:miio.device:'PhilipsEyecare' does not specify any descriptors, please considering creating a PR.
❯ miiocli miotdevice --ip x.y.z.21 --token e21...6cc descriptors
Running command descriptors
WARNING:miio.device:'MiotDevice' does not specify any descriptors, please considering creating a PR.