PiotrMachowski/lovelace-xiaomi-vacuum-map-card

Failed to call service. Service not found.

Derksie opened this issue · 11 comments

Checklist

  • I have updated the card to the latest version available
  • I have cleared the cache of my browser
  • I have checked if the problem is already reported

The problem

When i try to pin & go or zone cleanup i get the message:
Failed to call service xiaomi_miio/vacuum_goto. Service not found.

This message occurs when i selected a point or created a zone and press start.

What version of a card has described problem?

v2.2.2

What was the last working version card?

No response

What vacuum model do you have problems with?

Viomi v3 max

Which integration do you use to control your vacuum (link)?

https://www.home-assistant.io/integrations/xiaomi_miio/

What browser (browsers/apps) does have this problem?

Firefox, also tried edge

What version of Home Assistant do you use?

2023.9.2

What type of installation are you running?

Home Assistant OS

Card's configuration

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
entity: vacuum.viomi_v23_bdea_robot_cleaner
vacuum_platform: default


And this is the config in configuration.yaml:
camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    draw: ['all']
    force_api: roidmi
    attributes:
      - calibration_points

Javascript errors shown in the browser's console (if applicable)

No response

Additional information

No response

This message appears when you use an incorrect vacuum_platform

I have tried every vacuum_platform, none of them work. Does this mean that my vacuum isn't supported by any of the platforms?
Because it does support it in the xiaomi home app.

Which integration do you use to control the vacuum in HA? Because I don't think it is built-in Xiaomi Miio integration

Xiaomi Miot Auto

And when i try to use the vacuum_platform al-one/hass-xiaomi-miot i get this error:
Failed to call service xiaomi_miot/call_action. required key not provided @ data['aiid']

(I am quite new to Home assistant so still learning)

What is your vacuum model?

TwoD commented

I also get this with Pin & Go, or Zone cleanup, for my Roborock S8 Pro Ultra, integrated via https://github.com/humbertogontijo/homeassistant-roborock
Everything else seems to work just fine.
There are no services in HA prefixed "xiaomi_miio.", but the same ones prefixed "roborock." works.
Service call that doesn't work (from the card settings):

{
  "domain": "xiaomi_miio",
  "service": "vacuum_goto",
  "serviceData": {
    "x_coord": 23009,
    "y_coord": 22173,
    "entity_id": "vacuum.roborock_s8_pro_ultra"
  }
}

Service call that does work (from HA dev tools):

service: roborock.vacuum_goto
data:
  x_coord: "22009"
  y_coord: "22173"
target:
  entity_id: vacuum.roborock_s8_pro_ultra

@TwoD this means that you have chosen incorrect vacuum platform

TwoD commented

@PiotrMachowski Thanks, now it works. However, I had to look very carefully in the configuration UI since I didn't even notice the platform option the 10 times or so I've been in there. It's really obscure and I would have assumed "default" meant it autodetects it based on the target entity, otherwise "default" makes no sense at all. With the knowledge I have to specify it manually it's impossible to know what "default" actually means.

@TwoD it is called "default" for legacy reasons - at the beginning this card only supported Xiaomi Miio integration. I might implement autodetection someday though

TwoD commented

Ok, that makes sense.

Autodetection would be great, but I think for now you might improve UX a bit by renaming "default" to "Xiaomi legacy", or something like that, and leave the default value empty. If it must be explicitly set it's harder to miss that the platform must be correct for [some/most] things to work.

Otherwise, I really like this card. Awesome work!