openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.57k forks source link

[miio] Support multimap on newer Xiaomi Roborock models #13365

Open pavkamlc opened 1 year ago

pavkamlc commented 1 year ago

Expected Behavior

On Roborock S6 Pure all working, instead of _CleaningMap

Current Behavior

_CleaningMap has value UNDEF In log I see:

2022-09-09 12:43:57.987 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for device 132FD6BE type: GET_MULTI_MAP_LIST, result: [{"max_multi_map":4,"max_bak_map":0,"multi_map_count":2,"map_info":[{"mapFlag":0,"add_time":1662654746,"length":3,"name":"1NP","bak_maps":[]},{"mapFlag":1,"add_time":1661415223,"length":3,"name":"2NP","bak_maps":[]}]}], fullresponse: {"result":[{"max_multi_map":4,"max_bak_map":0,"multi_map_count":2,"map_info":[{"mapFlag":0,"add_time":1662654746,"length":3,"name":"1NP","bak_maps":[]},{"mapFlag":1,"add_time":1661415223,"length":3,"name":"2NP","bak_maps":[]}]}],"id":13209} 2022-09-09 12:43:58.141 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Received JSON message {"code":-6,"message":"invalid device","result":null} 2022-09-09 12:43:58.141 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Could not get result: {"code":-6,"message":"invalid device","result":null} 2022-09-09 12:43:58.141 [DEBUG] [g.miio.internal.cloud.CloudConnector] - Cannot download map data: Returned map URL is empty

Item RoborockS6Pure_MultiMapList return this: [{"max_multi_map":4,"max_bak_map":0,"multi_map_count":2,"map_info":[{"mapFlag":0,"add_time":1662654746,"length":3,"name":"1NP","bak_maps":[]},{"mapFlag":1,"add_time":1661415223,"length":3,"name":"2NP","bak_maps":[]}]}]

Possible Solution

Steps to Reproduce (for Bugs)

Context

Your Environment

marcelrv commented 1 year ago

Indeed that looks rather different from the responses the binding expect to see. I assume xiaomi introduced some new method with this device, or changed part of the request parameters (as it has the {"code":-6,"message":"invalid device","result":null}

If I find some time I'll try if I can discover what has changed .

marcelrv commented 1 year ago

Would be a great enhancement. Suggest to add to bountysource to hopefully have someone contribute this, as from my side it will be challenging (time & no access to a similar device) to add this functionality.