PiotrMachowski / Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor

This custom integration provides a way to present a live view of a map for Xiaomi (Roborock/Viomi/Roidmi/Dreame) vacuums without a need for rooting.
MIT License
1.14k stars 122 forks source link

Roborock App Integration #100

Open jamescaudle opened 3 years ago

jamescaudle commented 3 years ago

Many thanks for making this integration.

I am wondering if it is possible to pull the maps from the Roborock server rather than the Xiaomi server. Recently the HASS-Roborock integration has allowed Hass users to utilise the Roborock app and the Home Assistant Vacuum-Card simultaneously. However, I note since switching to the Roborock app I am unable to access the map feature.

Is this a feature that can be added?

cathelest commented 3 years ago

I have a roborock s6 and use it via the xiaomi app, is there a need or benifit to using roborock (isnt it just a rebadged xiaomi app).

PiotrMachowski commented 3 years ago

@jamescaudle it's not possible to do it in this integration, as Roborock uses a completely different API (Tuya, as far as I know)

@cathelest see this discussion

Xyaren commented 1 year ago

This might change! https://gist.github.com/rovo89/dff47ed19fca0dfdda77503e66c2b7c7

https://github.com/humbertogontijo/homeassistant-roborock

I fiddled around with the js gist and was able to load the map. I was then able to use https://community.openhab.org/t/xiaomi-vacuum-map-viewer-to-find-coordinates-for-zone-cleaning/103500 to open the file. I had to skip the unzipping used in the script though and save the map with .gz extension.

Promising results!

@PiotrMachowski What is your opinion ? Is it worth giving this Method a try ?

PiotrMachowski commented 1 year ago

@Xyaren if you were able to retrieve gz file from Roborock cloud then it should be possible to incorporate this into Map Extractor, but it would require some additional changes to be made. Let's reopen this request

Xyaren commented 1 year ago

It might be required to consider this a new platform, as this seems to be quite a different approach.

PiotrMachowski commented 1 year ago

I have to take a look at the code and consider all pros/cons. The only difference will be in retrieving raw map file from the cloud - the rest (raw map parsing and drawing) should be the same.

I have a similar dilemma with Valetudo ;)

Xyaren commented 1 year ago

Oh right, I got confused with lovelace-xiaomi-vacuum-map-card.

Xyaren commented 1 year ago

@humbertogontijo just added a fix to the integration for map payloads fetching. I understand that this is a very early stage of development, but I was successful calling get_map_v1 via the "send_command" service:

service: vacuum.send_command
data:
  command: get_map_v1
target:
  entity_id: vacuum.fussel

Which results in the following log statements:

2022-12-11 16:38:53.541 DEBUG (SyncWorker_4) [custom_components.roborock.api] Requesting method get_map_v1 with None
2022-12-11 16:38:53.951 DEBUG (SyncWorker_4) [custom_components.roborock.api] Response from get_map_v1: b'rr\x14\x00,\x18\x06\x00\x01\x00\x00\x00k\x06\x00\x00\x01\x00\x00\x00\x02\x00\x1c\x00\xa1\xf4\x02\.......

(Log is cut short for sanity...) Very promising though.

I'm not very familiar with Homeassistant, but maybe there is a way of using the homeassistant-roborock entity for fetching the map data.

mindgam3s commented 1 year ago

this would be really awesome as I switched to the roborock app myself for a new robot model and sadly realized that the HACS integration doesnt work with the roborock API and you can't connect the vacuum to both systems :(

+1

mschulze46 commented 11 months ago

Have the same problem with my Roborock S7. Switched to Roborock app and the map extraction doesn't work anymore. So pulling the map from Roborock API would be really awesome!!!

+1