PiotrMachowski / lovelace-xiaomi-vacuum-map-card

This card provides a user-friendly way to fully control map-based vacuums in Home Assistant. Supported brands include Xiaomi (Roborock/Viomi/Dreame/Roidmi/Valetudo/Valetudo RE), Neato, Wyze, Roomba, Ecovacs (and probably more).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to call service xiaomi_miot/call_action. required key not provided @ data['aiid']

Derksie opened this issue · 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 start a predefined zone I get this error message:
Failed to call service xiaomi_miot/call_action. required key not provided @ data['aiid']

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://github.com/al-one/hass-xiaomi-miot

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

Firefox

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
entity: vacuum.viomi_v23_bdea_robot_cleaner
vacuum_platform: al-one/hass-xiaomi-miot
map_modes:
  - template: vacuum_clean_zone_predefined
    predefined_selections:
      - zones:
          - - -2732
            - -538
            - -490
            - 542
        label:
          text: Bedroom
          x: -1600
          'y': 20
          offset_y: 35
        icon:
          name: mdi:bed
          x: -1600
          'y': 20
calibration_source:
  camera: true



Or when creating zone on the spot:

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.xiaomi_cloud_map_extractor
entity: vacuum.viomi_v23_bdea_robot_cleaner
vacuum_platform: al-one/hass-xiaomi-miot
map_modes:
  - template: vacuum_clean_zone
calibration_source:
  camera: true

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

No response

Additional information

No response

I found something on this page that i have to add a service like this:

service: xiaomi_miot.call_action
data:
  entity_id: vacuum.dreame_p2259_entity_id
  siid: 4 # vacuum-extend
  aiid: 1 # start-clean
  params:
    - 18 # piid: 1 - work-mode
    - '{"selects":[[7,1,0,2,1]]}' # piid: 10 - clean-extend-data
  throw: true # throw result to HA notifications

Where can i find the siid and aiid and the params that i need?

This is not a problem with this card, this is a missing configuration. Configuration required for this integration to work highly depends on vacuum model. Is your vacuum model viomi.vacuum.v13?

according to home.miot-spec.com the model I have is viomi.vacuum.v23

I have found an example config on this page: #406

However I can't seem to make it work. Now i get a warning instead of an error:
Referenced entities input_number.vacuum_zone_id are missing or not currently available

This entity doesn't exist in my home assistant, but it seems like it is a placeholder. I have no idea how to add this entity.

Current code:
Card

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.xiaomi_cloud_map_extractor
entity: vacuum.viomi_v23_bdea_robot_cleaner
vacuum_platform: al-one/hass-xiaomi-miot
map_modes:
  - template: vacuum_clean_zone_predefined
    name: Zones
    service_call_schema:
      service: input_number.set_value
      service_data:
        value: '[[zone_id]]'
        entity_id: input_number.vacuum_zone_id
    predefined_selections:
      - zones:
          - - 0
            - 0
            - 0
            - 0
        icon:
          name: mdi:rug
          x: -2475
          'y': -1025
        variables:
          zone_id: 1
calibration_source:
  camera: true
two_finger_pan: false

automations.yaml

- id: '1695231798271'
  alias: 'Vacuum: Trigger zone'
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: input_number.vacuum_zone_id
    above: 0
  condition: []
  action:
  - service: script.vacuum_clean_zone
    data: {}
  mode: single

scripts.yaml

vacuum_clean_zone:
  alias: 'Vacuum: Clean Zone'
  sequence:
  - choose:
    - conditions:
      - condition: template
        value_template: '{{ states(''input_number.vacuum_zone_id'') | float == 1 }}'
      sequence:
      - service: xiaomi_miot.set_miot_property
        data:
          entity_id: vacuum.viomi_v23_bdea_robot_cleaner
          siid: 6
          piid: 2
          value: -2.732,-0.538,-0.490,0.542
  - service: input_number.set_value
    data:
      value: 0
    target:
      entity_id: input_number.vacuum_zone_id
  - service: xiaomi_miot.call_action
    data:
      siid: 6
      aiid: 5
      entity_id: vacuum.viomi_v23_bdea_robot_cleaner
  mode: single