Vacuum Interactive Map Card

I tried the config like below but it seems that when I click the room icon, no service is being called. I have checked events in HA also to see if the script is called but nothing.

  - name: Rooms
    icon: mdi:floor-plan
    selection_type: ROOM
    max_selections: 1
    repeats_type: NONE
    max_repeats: 2
    service_call_schema:
      service: script.1573880520984
      service_data:
        rooms: '[[selection]]'
        repeats: '[[repeats]]'
        predefined: 'false'
        entity_id: '[[entity_id]]'
    predefined_selections:
      - id: cbr
        label:
          text: Bedroom
          x: 10
          'y': -5
        icon:
          name: mdi:bed
          x: 10
          'y': 1

what could be the reason?

Service should be called after clicking play button. You can make it run immediately after clicking the icon by using this config:

  - name: Rooms
    icon: mdi:floor-plan
    selection_type: ROOM
    max_selections: 1
    repeats_type: NONE
    max_repeats: 2
    run_immediately: true
    service_call_schema:
      service: script.1573880520984
      service_data:
        rooms: '[[selection]]'
        repeats: '[[repeats]]'
        predefined: 'false'
        entity_id: '[[entity_id]]'
    predefined_selections:
      - id: cbr
        label:
          text: Bedroom
          x: 10
          'y': -5
        icon:
          name: mdi:bed
          x: 10
          'y': 1
1 Like

This worked perfectly. Also one more thing how can I rotate the map in this card?

Probably by rotating the camera image.

1 Like

Is there an option like crop for each camera source to rotate the map?

Check the link above

The link is for the map extration integration in which I know rotation can be done, but I want to rotate the image with map card. This is because on of my maps is portrait mode and other is landscape. So I have to rotate portrait to landscape in map card in lovelace. If i use rotate in integration, it will rotate both maps.

Place your map card inside picture-elements card as an element and specify a rotation:

          - type: custom:xiaomi-vacuum-map-card
            style:
              top: 50.3%
              left: 56.4%
              transform: translate(-50%,-50%) scale(1.9,1.9) rotate(90deg)
            .....

But probably you will face other issues)))

This will probably rotate the buttons to operate the vacuum which is present at the bottom of the card which is not desired.

Then create TWO camera entities - with 2 different rotations))) and then use a needed one))
Actually, probably you should think of revising the whole approach.

Ok, that is something I would look into, thanks

This will double requests from vacuum I afraid.

Will it be bad for the vacuum?

Cannot say, never tested it in such conditions.

This is an amazing card.

But can someone solve the problem that we can’t control the robot mop? We can’t choose if it only mops or only vacuums and which powers… It’s a shame HA doesn’t give us full control on the robot…

I think “mop ON/OFF” should be provided by some xiaomi_miio service.

No such option currently, let alone mop power…

Is it not possible to use rooms defined in the app?

it’s perfectly possible: example

Hi, I’ve installed new version of map plugin through HACS. Now it’s working completely fine when I open HA through chrome on my PC.

When i open it through HA App for android on my phone or fully Kiosk Browser on my tablet it says “Custom element doesn’t exist: xiaomi-vacuum-map-card”

Has anyone had similar problem?