Skip to content

miiocli viomivacuum status not working for STYJ02YM (viomi.vacuum.v8, fw: 3.5.3_0017) #1003

@bkupidura

Description

@bkupidura

Describe the bug
miiocli viomivacuum status is broken for STYJ02YM with firmware 3.5.3_0017.
Looks like vacuum is returning less properties than expected.

List of available properties can be found https://github.com/nqkdev/home-assistant-vacuum-styj02ym/blob/master/vacuum.py#L122, i see that nqkdev is not using all available - but this can be start point for further investigation.

Version information (please complete the following information):

  • OS: Home-Assistant container, tag 2021.4.0
  • python-miio: 0.5.5

Device information:
Model: viomi.vacuum.v8
Hardware version: Linux
Firmware version: 3.5.3_0017

To Reproduce
Steps to reproduce the behavior:

  1. Run miiocli viomivacuum status

Expected behavior
Status command working

Console output

# miiocli --debug viomivacuum --ip 10.0.150.27 --token <TOKEN> status
INFO:miio.cli:Debug mode active

DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x13\x9f\x9c\xc8`n\xb1\x15' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = b'\x13\x9f\x9c\xc8' (total 4)
            ts = 2021-04-08 07:30:29
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 139f9cc8 with ts: 2021-04-08 07:30:29, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:10.0.150.27:54321 >>: {'id': 1, 'method': 'get_prop', 'params': ['battary_life', 'box_type', 'cur_mapid', 'err_state', 'has_map', 'has_newmap', 'hw_info', 'is_charge', 'is_mop', 'is_work', 'light_state', 'm
ap_num', 'mode', 'mop_route', 'mop_type', 'remember_map', 'repeat_state', 'run_state', 's_area', 's_time', 'suction_grade', 'v_state', 'water_grade']}
DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 10
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x13\x9f\x9c\xc8`n\xb1\x1a' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = b'\x13\x9f\x9c\xc8' (total 4)
            ts = 2021-04-08 07:30:34
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 139f9cc8 with ts: 2021-04-08 07:30:34, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:10.0.150.27:54321 >>: {'id': 102, 'method': 'get_prop', 'params': ['battary_life', 'box_type', 'cur_mapid', 'err_state', 'has_map', 'has_newmap', 'hw_info', 'is_charge', 'is_mop', 'is_work', 'light_state', 'map_num', 'mode', 'mop_route', 'mop_type', 'remember_map', 'repeat_state', 'run_state', 's_area', 's_time', 'suction_grade', 'v_state', 'water_grade']}
DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 9
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x13\x9f\x9c\xc8`n\xb1\x1f' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = b'\x13\x9f\x9c\xc8' (total 4)
            ts = 2021-04-08 07:30:39
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 139f9cc8 with ts: 2021-04-08 07:30:39, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:10.0.150.27:54321 >>: {'id': 203, 'method': 'get_prop', 'params': ['battary_life', 'box_type', 'cur_mapid', 'err_state', 'has_map', 'has_newmap', 'hw_info', 'is_charge', 'is_mop', 'is_work', 'light_state', 'map_num', 'mode', 'mop_route', 'mop_type', 'remember_map', 'repeat_state', 'run_state', 's_area', 's_time', 'suction_grade', 'v_state', 'water_grade']}
DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 8
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container:
    data = Container:
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container:
        data = b'!1\x00 \x00\x00\x00\x00\x13\x9f\x9c\xc8`n\xb1%' (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = b'\x13\x9f\x9c\xc8' (total 4)
            ts = 2021-04-08 07:30:45
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 139f9cc8 with ts: 2021-04-08 07:30:45, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:10.0.150.27:54321 >>: {'id': 304, 'method': 'get_prop', 'params': ['battary_life', 'box_type', 'cur_mapid', 'err_state', 'has_map', 'has_newmap', 'hw_info', 'is_charge', 'is_mop', 'is_work', 'light_state', 'map_num', 'mode', 'mop_route', 'mop_type', 'remember_map', 'repeat_state', 'run_state', 's_area', 's_time', 'suction_grade', 'v_state', 'water_grade']}
DEBUG:miio.miioprotocol:10.0.150.27:54321 (ts: 2021-04-08 07:30:45, id: 304) << {'result': [66, 1, 2103, 1, 0, '1.0.3', 0, 0, 1, 74, 0, 0, 1, 0, 5, 37.17, 42, 0, 10, 12], 'id': 304}
DEBUG:miio.device:Count (23) of requested properties does not match the count (20) of received values.
Traceback (most recent call last):
  File "/usr/local/bin/miiocli", line 8, in <module>
    sys.exit(create_cli())
  File "/usr/local/lib/python3.8/site-packages/miio/cli.py", line 45, in create_cli
    return cli(auto_envvar_prefix="MIIO")
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 285, in wrap
    result_msg = result_msg_fmt.format(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/viomivacuum.py", line 336, in fanspeed
    return ViomiVacuumSpeed(self.data["suction_grade"])
  File "/usr/local/lib/python3.8/enum.py", line 339, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.8/enum.py", line 662, in __new__
    raise ve_exc
ValueError: None is not a valid ViomiVacuumSpeed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions