Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor icon indicating copy to clipboard operation
Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor copied to clipboard

Mullti-Floor Support

Open majorsl opened this issue 4 years ago • 19 comments

It looks like the new firmware released a few days ago for the S4 and maybe S5 now include multi-floor support, which means probably multi maps?

I have not upgraded to verify this because your integration is too valuable to me to break it. 👍

Will you add support eventually? Thank you for what you do for us.

majorsl avatar Jan 09 '21 16:01 majorsl

Well, I don't have multiple floors plus I use S55 on an old version of a software, so it's not so simple for me to implement/test it

PiotrMachowski avatar Jan 09 '21 23:01 PiotrMachowski

Hi, I'm also interested in having two floors. If you want I am available to test implementations on this function. Thanks

tonivag avatar Jan 25 '21 22:01 tonivag

I'll just add that I did upgrade the firmware on my S5 and this project still works. I didn't make use of the multi-floor feature yet.

majorsl avatar Jan 25 '21 22:01 majorsl

I would be willing to work with you on this. In Addition i found the following information on OpenHAB on how they detected differnet floor maps:

https://community.openhab.org/t/xiaomi-roborock-room-clean-multi-level-map/108850 https://community.openhab.org/t/cleaning-specific-room-and-zones-with-multi-level-map-roborock/115329

iceman73 avatar Apr 15 '21 17:04 iceman73

I'm interested in multi-floor support too using a S6 Max V - any progress so far? I'd be willing to help, if you tell me where to start ...

ahochsteger avatar Jun 05 '21 10:06 ahochsteger

@ahochsteger You can try to investigate OpenHAB code, my integration is mostly based on it

PiotrMachowski avatar Jun 05 '21 10:06 PiotrMachowski

i have 2 robots so ideally would like 2 cards, 1 for each robot which has it's own apikey, ip address, name etc

ins4neuk avatar Aug 24 '21 14:08 ins4neuk

@ins4neuk You can already do it

PiotrMachowski avatar Aug 24 '21 14:08 PiotrMachowski

oh. i add the picture card but can only add 1 in is there something obvious i'm missing??!?!

ins4neuk avatar Aug 24 '21 14:08 ins4neuk

@ins4neuk I'm not sure what your problem is. You just have to create 2 cameras and add them to 2 different cards:

camera:
  - platform: xiaomi_cloud_map_extractor
    name: vacuum_1
    host: !secret xiaomi_vacuum_host_1
    token: !secret xiaomi_vacuum_token_1
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
  - platform: xiaomi_cloud_map_extractor
    name: vacuum_2
    host: !secret xiaomi_vacuum_host_2
    token: !secret xiaomi_vacuum_token_2
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password

PiotrMachowski avatar Aug 24 '21 15:08 PiotrMachowski

Count me in for testing multi-floor. I am also interested.

malinduta avatar Sep 11 '21 18:09 malinduta

@ins4neuk I'm not sure what your problem is. You just have to create 2 cameras and add them to 2 different cards:

camera:
  - platform: xiaomi_cloud_map_extractor
    name: vacuum_1
    host: !secret xiaomi_vacuum_host_1
    token: !secret xiaomi_vacuum_token_1
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
  - platform: xiaomi_cloud_map_extractor
    name: vacuum_2
    host: !secret xiaomi_vacuum_host_2
    token: !secret xiaomi_vacuum_token_2
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password

The sample code I saw didn't have the name part in.. that's what was throwing me.

ins4neuk avatar Sep 11 '21 20:09 ins4neuk

@malinduta multi-floor support doesn't seem to be appearing anytime soon...

PiotrMachowski avatar Sep 11 '21 22:09 PiotrMachowski

It looks like multi floor is working fine for me. Whichever floor the robot is on, that map shows in the camera card I have for the cloud map extractor. I'm able to change which floor it is on in home assistant with

  action: call-service
  service: vacuum.send_command
  service_data:
    command: load_multi_map
    params: 1
  target:
    entity_id: vacuum.roborock_s5_max

changing params as necessary. What I am struggling with is a way to find which floor I am on. I would love if the floor could be returned as an attribute. I think we can get the floor from the command get_multi_maps_list but I haven't been successful yet. I got that command from here https://github.com/marcelrv/XiaomiRobotVacuumProtocol

dnikles avatar Nov 10 '21 23:11 dnikles

i'd love to see multi-floor support as well!

smenzer avatar Mar 11 '22 04:03 smenzer

Thanks @dnikles, that works for me too.

I've added these two icons to my Card:


append_icons: true
icons:
  - icon: mdi:home-floor-0
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        command: load_multi_map
        params: 0
        entity_id: vacuum.roborock_vacuum_s5e
  - icon: mdi:home-floor-1
    tap_action:
      action: call-service
      service: vacuum.send_command
      service_data:
        command: load_multi_map
        params: 1
        entity_id: vacuum.roborock_vacuum_s5e

image

Remaining issues to tackle:

  • [ ] The rooms and areas are however not updated. These are configured in the card which doesn't support multiple levels.
  • [ ] I would prefer a single button that cycle through levels, like the fan button
  • [ ] Determine number of levels (e.g. get_multi_maps_list)
  • [ ] It takes until the next camera refresh to show the new map

qistoph avatar Mar 21 '22 11:03 qistoph

@qistoph

  • [ ] The rooms and areas are however not updated. These are configured in the card which doesn't support multiple levels.

It's possible to do it, check out this issue: https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/issues/248

  • [ ] I would prefer a single button that cycle through levels, like the fan button

It's also possible if you are able to retrieve current floor number (using conditions in icons)

  • [ ] It takes until the next camera refresh to show the new map

You can achieve it using an automation

PiotrMachowski avatar Mar 21 '22 11:03 PiotrMachowski

It's possible to do it, check out this issue: PiotrMachowski/lovelace-xiaomi-vacuum-map-card#248

well I haven't been following along enough recently. I am pulling this off by having 2 different map cards and conditionally showing them using conditional cards.

dnikles avatar Mar 21 '22 12:03 dnikles

Is there any way to control the "default/active" template selected when the card is displayed ?

I would like to show the template matching the current map.

Xyaren avatar Jan 04 '23 18:01 Xyaren