rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
667 stars 73 forks source link

Missing 'state' when doing Segmented Cleanup #163

Closed LordMike closed 4 years ago

LordMike commented 4 years ago

Describe the bug When the Segmented Cleanup is issued, the MQTT State topic does not receive a new state value. Other forms of cleanup, moving, returning home etc, all produce state values.

How to Reproduce

  1. Subscribe to the state topic
  2. Issue a segmented cleanup command (via. Valetudo UI, pick a named room and clean it)
  3. Observe that the state topic receives the following: {"battery_level":98,"fan_speed":"min"}

Expected behavior With other forms of actions, f.ex. returning home or a full cleanup (or even a zoned cleanup), the state is present:

  1. Subscribe to the state topic
  2. Issue a command (via. Valetudo UI), such as return home or (full) cleanup
  3. Observe that the state topic receives the following: {"state":"cleaning","battery_level":100,"fan_speed":"min"}

Screenshots N/A

Vacuum Model: Roborock S5 (Gen2)

Valetudo Version: Valetudo RE 0.9.1

User-Agent N/A

Additional context

LordMike commented 4 years ago

This could sound like a missing mapping for whatever segmented cleanup is reported as, here - but I can't figure out if there's a log of what states were reported or how to get the current state... maybe miio has a CLI on the vacuum itself.

Unfotunately it's packed with pkg - so I can't just edit the file, right?

LordMike commented 4 years ago

I've found that python-miio can tell me that the robot is "Segment cleaning", so they must have mapped this.

image

In their codebase, that text only appears once - here.

So in theory, if HA_STATE_MAPPINGS is updated to include 18 = cleaning it should work.

LordMike commented 4 years ago

Fixed in 0.9.2.