Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viomi.vacuum.v18 stopped working with checksum error #115

Closed
blakadder opened this issue Jun 27, 2021 · 13 comments
Closed

viomi.vacuum.v18 stopped working with checksum error #115

blakadder opened this issue Jun 27, 2021 · 13 comments
Labels
bug Something isn't working device: vacuum fixed bug fixed

Comments

@blakadder
Copy link
Contributor

The vacuum was working yesterday just fine with 2 discovered entities (vacuum and battery) but today I get this error:

Got MiioException while fetching the state for Viomi S9 Robot Cleaner: Got checksum error which indicates use of an invalid token. Please check your token!

Token was correct extracted with the Miot Auto component or xiaomi_token_extractor.exe

I tried reconnecting to wifi and refresh the token but the error is the same with the new token. I tried v0.3.4, v0.3.5 and latest

@al-one
Copy link
Owner

al-one commented Jun 27, 2021

It is recommended to use the Mi account to integrate the vacuum, this method will automatically update the token from Mi Cloud.
Customize attribute miot_local: true can read the state and control the vacuum in LAN (If it supported).

@blakadder
Copy link
Contributor Author

I just found it really strange that it initially worked via LAN only then suddenly stopped

@blakadder
Copy link
Contributor Author

After setting miot_local: true the entity turned unavailable with the same error in logs:

Got MiioException while fetching the state for Viomi S9 Robot Cleaner: Got checksum error which indicates use of an invalid token. Please check your token!

@al-one
Copy link
Owner

al-one commented Jun 27, 2021

miiocli device --ip <ip> --token <token> info

Try this shell command to check the device information, if it fails, please try to reset and re-bind to MiHome APP.

@blakadder
Copy link
Contributor Author

blakadder commented Jun 30, 2021

the command gives this error

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 63, 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/device.py", line 88, in hardware_version
    if self.data["hw_ver"] is not None:
KeyError: 'hw_ver'

factory reset of the device helped. it is again discovered in HA, will see if it will remain that way.

@al-one
Copy link
Owner

al-one commented Jul 7, 2021

Is the device still available now ?

@blakadder
Copy link
Contributor Author

No, the same error reappears after a while and the device is unavailable. Cloud integration seems to be only sure way to integrate for now.

@al-one
Copy link
Owner

al-one commented Jul 7, 2021

python-miio has fixed this issue rytilahti/python-miio#1083, but has not released a new version.

@blakadder
Copy link
Contributor Author

yes i saw that this morning, will have to pull the github version and try it out

@blakadder
Copy link
Contributor Author

Upgraded to python-miio 0.57. miotdevice command is currently broken. Using fanmiot instead I managed to locally poll all piid's under ssid 2, 3 and 4 with get_property_by as well as execute actions.

This is the error with latest miot auto 0.3.12 and latest HA dev version

ERROR (MainThread) [custom_components.xiaomi_miot] Got MiioException while fetching the state for locals9 Robot Cleaner: Neither the class nor the parameter defines the mapping, mapping: {'vacuum.status': {'siid': 2, 'piid': 1}, 'vacuum.fault': {'siid': 2, 'piid': 2}, 'vacuum.wdr_mode': {'siid': 2, 'piid': 11}, 'vacuum.door_state': {'siid': 2, 'piid': 12}, 'vacuum.contact_state': {'siid': 2, 'piid': 13}, 'vacuum-2.contact_state': {'siid': 2, 'piid': 16}, 'vacuum.mute': {'siid': 2, 'piid': 17}, 'vacuum.sweep_type': {'siid': 2, 'piid': 4}, 'vacuum.mode': {'siid': 2, 'piid': 19}, 'voice.target_voice': {'siid': 8, 'piid': 3}, 'voice.cur_voice': {'siid': 8, 'piid': 4}, 'voice.download_status': {'siid': 8, 'piid': 5}, 'voice.download_progress': {'siid': 8, 'piid': 6}, 'voice.voice_url': {'siid': 8, 'piid': 7}, 'voice.voice_mdfive': {'siid': 8, 'piid': 8}, 'map.map_type': {'siid': 7, 'piid': 1}, 'map.map_id': {'siid': 7, 'piid': 2}, 'map.map_name': {'siid': 7, 'piid': 4}, 'map.lang': {'siid': 7, 'piid': 5}, 'map.arrange_room_ids': {'siid': 7, 'piid': 6}, 'map.target_room_id': {'siid': 7, 'piid': 7}, 'map.split_points': {'siid': 7, 'piid': 8}, 'map.room_name': {'siid': 7, 'piid': 9}, 'map.cur_cleaning_path': {'siid': 7, 'piid': 10}, 'map.map_list': {'siid': 7, 'piid': 11}, 'map.oper_result': {'siid': 7, 'piid': 13}, 'map.auto_area_id': {'siid': 7, 'piid': 14}, 'point_zone.target_point': {'siid': 6, 'piid': 1}, 'point_zone.zone_points': {'siid': 6, 'piid': 2}, 'point_zone.restrict_points': {'siid': 6, 'piid': 3}, 'order.order_id': {'siid': 5, 'piid': 1}, 'order.enable': {'siid': 5, 'piid': 2}, 'order.day': {'siid': 5, 'piid': 3}, 'order.hour': {'siid': 5, 'piid': 4}, 'order.minute': {'siid': 5, 'piid': 5}, 'order.repeat': {'siid': 5, 'piid': 6}, 'order.clean_way': {'siid': 5, 'piid': 8}, 'order.suction': {'siid': 5, 'piid': 9}, 'order.water': {'siid': 5, 'piid': 10}, 'order.twice_clean': {'siid': 5, 'piid': 11}, 'order.mapid': {'siid': 5, 'piid': 12}, 'order.room_count': {'siid': 5, 'piid': 13}, 'order.room_data': {'siid': 5, 'piid': 14}, 'order.dnd_enable': {'siid': 5, 'piid': 15}, 'order.dnd_start_hour': {'siid': 5, 'piid': 16}, 'order.dnd_start_minute': {'siid': 5, 'piid': 17}, 'order.dnd_end_hour': {'siid': 5, 'piid': 18}, 'order.dnd_end_minute': {'siid': 5, 'piid': 19}, 'order.dnd_timezone': {'siid': 5, 'piid': 20}, 'order.timestamp': {'siid': 5, 'piid': 21}, 'order.orderdata': {'siid': 5, 'piid': 22}, 'viomi_vacuum.repeat_state': {'siid': 4, 'piid': 1}, 'viomi_vacuum.remember_state': {'siid': 4, 'piid': 3}, 'viomi_vacuum.mop_route': {'siid': 4, 'piid': 6}, 'viomi_vacuum.side_brush_life': {'siid': 4, 'piid': 8}, 'viomi_vacuum.side_brush_hours': {'siid': 4, 'piid': 9}, 'viomi_vacuum.main_brush_life': {'siid': 4, 'piid': 10}, 'viomi_vacuum.main_brush_hours': {'siid': 4, 'piid': 11}, 'viomi_vacuum.hypa_life': {'siid': 4, 'piid': 12}, 'viomi_vacuum.hypa_hours': {'siid': 4, 'piid': 13}, 'viomi_vacuum.mop_life': {'siid': 4, 'piid': 14}, 'viomi_vacuum.mop_hours': {'siid': 4, 'piid': 15}, 'viomi_vacuum.direction': {'siid': 4, 'piid': 16}, 'viomi_vacuum.suction_grade': {'siid': 4, 'piid': 17}, 'viomi_vacuum.water_grade': {'siid': 4, 'piid': 18}, 'viomi_vacuum.map_num': {'siid': 4, 'piid': 23}, 'viomi_vacuum.time_zone': {'siid': 4, 'piid': 24}, 'viomi_vacuum.clean_start_time': {'siid': 4, 'piid': 25}, 'viomi_vacuum.clean_use_time': {'siid': 4, 'piid': 26}, 'viomi_vacuum.clean_area': {'siid': 4, 'piid': 27}, 'viomi_vacuum.clean_map_url': {'siid': 4, 'piid': 28}, 'viomi_vacuum.clean_mode': {'siid': 4, 'piid': 29}, 'viomi_vacuum.clean_way': {'siid': 4, 'piid': 30}, 'viomi_vacuum.cur_lang': {'siid': 4, 'piid': 31}, 'viomi_vacuum.cur_map_id': {'siid': 4, 'piid': 32}, 'viomi_vacuum.cur_map_url': {'siid': 4, 'piid': 33}, 'viomi_vacuum.last_update_time': {'siid': 4, 'piid': 34}, 'viomi_vacuum.consumable_index': {'siid': 4, 'piid': 35}, 'viomi_vacuum.clean_room_mode': {'siid': 4, 'piid': 36}, 'viomi_vacuum.clean_room_oper': {'siid': 4, 'piid': 37}, 'viomi_vacuum.clean_room_ids': {'siid': 4, 'piid': 38}, 'viomi_vacuum.has_map': {'siid': 4, 'piid': 39}, 'viomi_vacuum.has_newmap': {'siid': 4, 'piid': 40}, 'viomi_vacuum.dust_collection': {'siid': 4, 'piid': 41}, 'battery.battery_level': {'siid': 3, 'piid': 1}}, max_properties: 10
ERROR (MainThread) [homeassistant.components.vacuum] xiaomi_miot: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 634, in async_device_update
    await task
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1052, in async_update
    await self.hass.async_add_executor_job(partial(self.update_miio_props, pls))
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/xiaomi_miot/__init__.py", line 1060, in update_miio_props
    if not self.miot_device:
  File "/config/custom_components/xiaomi_miot/__init__.py", line 827, in miot_device
    device = MiotDevice(ip=host, token=token)
  File "/usr/local/lib/python3.9/site-packages/miio/miot_device.py", line 50, in __init__
    raise DeviceException(
miio.exceptions.DeviceException: Neither the class nor the parameter defines the mapping

@al-one al-one added the bug Something isn't working label Aug 16, 2021
al-one added a commit that referenced this issue Aug 16, 2021
@al-one
Copy link
Owner

al-one commented Aug 16, 2021

Please try latest commit: 3904812 again.

@al-one
Copy link
Owner

al-one commented Aug 17, 2021

Is this bug solved ?

@blakadder
Copy link
Contributor Author

That bug seems resolved. Vacuum gets discovered with many status attributes populated.

@al-one al-one added the fixed bug fixed label Aug 22, 2021
@al-one al-one closed this as completed Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working device: vacuum fixed bug fixed
Projects
None yet
Development

No branches or pull requests

2 participants