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

xiaomi_miio - RoboRock S7+ throws "STATE not supported" error #60505

Closed
philippwaller opened this issue Nov 28, 2021 · 10 comments · Fixed by #60513
Closed

xiaomi_miio - RoboRock S7+ throws "STATE not supported" error #60505

philippwaller opened this issue Nov 28, 2021 · 10 comments · Fixed by #60513

Comments

@philippwaller
Copy link

philippwaller commented Nov 28, 2021

The problem

I get the following error message when using the RoboRock S7+ with xiaomi_miio integration:

Logger: homeassistant.components.xiaomi_miio.vacuum
Source: components/xiaomi_miio/vacuum.py:417
Integration: Xiaomi Miio (documentation, issues)
First occurred: 17:23:19 (1 occurrences)
Last logged: 17:23:19

STATE not supported: Definition missing for state 22, state_code: 22

The error occurs when the robot drives back to the dock.

The error occurs when emptying the bin via the Auto-Empty Dock.

What version of Home Assistant Core has the issue?

core-2021.11.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.xiaomi_miio.vacuum
Source: components/xiaomi_miio/vacuum.py:417
Integration: Xiaomi Miio (documentation, issues)
First occurred: 17:23:19 (1 occurrences)
Last logged: 17:23:19

STATE not supported: Definition missing for state 22, state_code: 22

Additional information

No response

@probot-home-assistant
Copy link

Hey there @rytilahti, @syssi, @starkillerOG, @bieniu, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


xiaomi_miio documentation
xiaomi_miio source
(message by IssueLinks)

@rytilahti rytilahti added the waiting-for-upstream We're waiting for a change upstream label Nov 28, 2021
@rytilahti
Copy link
Member

Created rytilahti/python-miio#1189

@stoneobscurity
Copy link

stoneobscurity commented Nov 28, 2021

state 22 is "emptying bin"

the current integration has no idea what that is, since this is first roborock with a emptying dock.

@rytilahti
Copy link
Member

Yes, the linked PR should fix this for homeassistant (and the upstream issue fixes this upstream). There are still likely more unknown modes (19-21 at least) that are unknown. If you have a s7 device, it would be great if you could try to find out if one of those modes maps to when the bin is performing some actions (e.g., emptying it).

@philippwaller
Copy link
Author

philippwaller commented Nov 28, 2021

I will do a couple of tests this week and let you know. Thanks for your efforts!

@stoneobscurity

This comment has been minimized.

@rytilahti
Copy link
Member

rytilahti commented Nov 29, 2021

state 22 is "emptying bin"

Are you sure? The issue at hand says that it's about returning to the dock, not about emptying the bin though..

edit: on the offtopic repeat segments requests, I cannot really help there, sorry! My gen1 does not support segments, so someone else needs to figure this out and contribute the code to make that happen.

@philippwaller
Copy link
Author

After a couple of tests, I can confirm the statement from @stoneobscurity. State 22 is "emptying bin".
Unfortunately, I have not been able to determine what states 19 - 21 mean.

There seems to be s7+ specific error message in the official app, but since they don't throw any expetion in the HA integration, I can't tell you the error codes without further debugging.

Maybe it would be helpful if you include an exception/warning for unknown error codes like you did with the status codes.

@syssi
Copy link
Member

syssi commented Dec 4, 2021

# signed_10053_1004367_27_ANDROID_bundle_abbe685342c6e9abddf7d3e9280b8295.zip
# main.bundle:L1430
[...]
  var RobotStateCodeMap = {
    0: {
      name: localizationStrings.localization_strings_Common_Constants_0,
      value: RobotState.UNKNOWN
    },
    1: {
      name: localizationStrings.localization_strings_Common_Constants_1,
      value: RobotState.INITIAL
    },
    2: {
      name: localizationStrings.localization_strings_Common_Constants_2,
      value: RobotState.SLEEPING
    },
    3: {
      name: localizationStrings.localization_strings_Common_Constants_3,
      value: RobotState.WAITING
    },
    7: {
      name: localizationStrings.localization_strings_Common_Constants_4,
      value: RobotState.REMOTE
    },
    5: {
      name: localizationStrings.localization_strings_Common_Constants_1,
      value: RobotState.CLEAN
    },
    6: {
      name: localizationStrings.localization_strings_Common_Constants_6,
      value: RobotState.BACK_TO_DOCK
    },
    8: {
      name: localizationStrings.localization_strings_Common_Constants_8,
      value: RobotState.CHARGING
    },
    9: {
      name: localizationStrings.localization_strings_Common_Constants_10,
      value: RobotState.CHARGE_ERROR
    },
    10: {
      name: localizationStrings.localization_strings_Common_Constants_11,
      value: RobotState.PAUSE
    },
    11: {
      name: localizationStrings.localization_strings_Common_Constants_12,
      value: RobotState.SPOT_CLEAN
    },
    12: {
      name: localizationStrings.localization_strings_Common_Constants_13,
      value: RobotState.MALFUNCTIONING
    },
    14: {
      name: localizationStrings.localization_strings_Common_Constants_15,
      value: RobotState.UPDATING
    },
    15: {
      name: localizationStrings.localization_strings_Common_Constants_6,
      value: RobotState.RUB_TO_DOCK
    },
    16: {
      name: localizationStrings.rubys_main_subtitle_goto_target,
      value: RobotState.GOTO_TARGET
    },
    17: {
      name: localizationStrings.rubys_main_button_text_zone,
      value: RobotState.ZONED_CLEAN
    },
    18: {
      name: localizationStrings.rubys_main_segment_clean_alert,
      value: RobotState.SEGMENT_CLEAN
    },
    22: {
      name: localizationStrings.robot_status_collecting_dust,
      value: RobotState.COLLECTING_DUST
    },
    23: {
      name: localizationStrings.robot_status_washing_duster,
      value: RobotState.WASHING_DUSTER
    },
    100: {
      name: localizationStrings.localization_strings_Common_Constants_17,
      value: RobotState.FULL_CHARGE
    },
    101: {
      name: localizationStrings.localization_strings_Common_Constants_18,
      value: RobotState.OFF_LINE
    },
    102: {
      name: localizationStrings.localization_strings_Common_Constants_20,
      value: RobotState.UNKNOW
    },
    103: {
      name: localizationStrings.robot_status_locked_when_saving_map,
      value: RobotState.LOCKED
    },
    6301: {
      name: localizationStrings.robot_status_mopping,
      value: RobotState.MOPPING
    },
    6302: {
      name: localizationStrings.robot_status_clean_mop_cleaning,
      value: RobotState.CLEAN_MOP_CLEANING
    },
    6303: {
      name: localizationStrings.robot_status_clean_mop_mopping,
      value: RobotState.CLEAN_MOP_MOPPING
    },
    6304: {
      name: localizationStrings.robot_status_segment_mopping,
      value: RobotState.SEGMENT_MOPPING
    },
    6305: {
      name: localizationStrings.robot_status_segment_clean_mop_cleaning,
      value: RobotState.SEGMENT_CLEAN_MOP_CLEANING
    },
    6306: {
      name: localizationStrings.robot_status_segment_clean_mop_mopping,
      value: RobotState.SEGMENT_CLEAN_MOP_MOPPING
    },
    6307: {
      name: localizationStrings.robot_status_zone_mopping,
      value: RobotState.ZONED_MOPPING
    },
    6308: {
      name: localizationStrings.robot_status_zone_clean_mop_cleaning,
      value: RobotState.ZONED_CLEAN_MOP_CLEANING
    },
    6309: {
      name: localizationStrings.robot_status_zone_clean_mop_mopping,
      value: RobotState.ZONED_CLEAN_MOP_MOPPING
    },
    6310: {
      name: localizationStrings.robot_status_back_dock_washing_duster,
      value: RobotState.BACK_TO_DOCK_WASHING_DUSTER
    }
  };
[...]

English localizationStrings:

  "localization_strings_Common_Constants_0": "Getting Info",
  "localization_strings_Common_Constants_1": "Cleaning",
  "localization_strings_Common_Constants_2": "Sleeping",
  "localization_strings_Common_Constants_3": "Ready",
  "localization_strings_Common_Constants_4": "Remote Control",
  "localization_strings_Common_Constants_1": "Cleaning",
  "localization_strings_Common_Constants_6": "Returning to Dock",
  "localization_strings_Common_Constants_8": "Charging",
  "localization_strings_Common_Constants_10": "Charging Error",
  "localization_strings_Common_Constants_11": "Pause",
  "localization_strings_Common_Constants_12": "Spot Clean",
  "localization_strings_Common_Constants_13": "Error",
  "localization_strings_Common_Constants_15": "Updating",
  "localization_strings_Common_Constants_6": "Returning to Dock",
  "rubys_main_subtitle_goto_target": "Going to the target point",
  "rubys_main_button_text_zone": "Zone cleaning",
  "rubys_main_segment_clean_alert": "Room Cleaning",
  "robot_status_collecting_dust": "Emptying",
  "localization_strings_Common_Constants_17": "Fully Charged",
  "localization_strings_Common_Constants_18": "Offline",
  "robot_status_locked_when_saving_map": "Saving Map",

@rytilahti
Copy link
Member

I updated the linked PR to use STATE_DOCKED for the code.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants