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

IMILAB V1 #326

Open arsenal3008 opened 2 years ago

arsenal3008 commented 2 years ago

Checklist

What vacuum model do you want to be supported?

IMILAB V1

What is its name?

chuangmi.vacuum.hmi707

Available APIs

Errors shown in the HA logs (if applicable)

No response

Other info

No response

PiotrMachowski commented 2 years ago

You have to send me raw map file to make anything possible. Add following lines to config of Map Extractor:

store_map_raw: true
store_map_path: /config

After restart there should be a raw map file created in /config directory

arsenal3008 commented 2 years ago

2 this is?

PiotrMachowski commented 2 years ago

Yup. You should get a map file with extension .unknown

arsenal3008 commented 2 years ago

there is nothing

arsenal3008 commented 2 years ago

3

PiotrMachowski commented 2 years ago

In this case there should be something in logs

arsenal3008 commented 2 years ago

what log to give you? home-assistant.log home-assistant.log.1

PiotrMachowski commented 2 years ago

First one (home-assistant.log)

arsenal3008 commented 2 years ago

home-assistant.log

arsenal3008 commented 2 years ago

home-assistant.log.1.log

PiotrMachowski commented 2 years ago

Try this config:

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']
    attributes:
      - calibration_points
    store_map_raw: true
    store_map_path: /config
    force_api: roidmi

and check if a file appeared

PiotrMachowski commented 2 years ago

Also I think that you might have provided an invalid token. Can you confirm it is the same as one retrieved by Tokens Extractor? If it is the same you can try config from comment above

arsenal3008 commented 2 years ago

everything turned out you were right the token is not the same map_data_chuangmi.vacuum.hmi707.zip

arsenal3008 commented 2 years ago

map_data_chuangmi.vacuum.hmi707.gz file appeared map_data_chuangmi.vacuum.hmi707.gz

arsenal3008 commented 2 years ago

22

arsenal3008 commented 2 years ago

there are more files 333

PiotrMachowski commented 2 years ago

I see that the map image appeared as well. Was it after you used force_api: roidmi in your config?

arsenal3008 commented 2 years ago

yes

PiotrMachowski commented 2 years ago

Ok, I will add it to supported vacuums.

22

This is a problem with your config of map card. What integration do you use to add vacuum to HA?

arsenal3008 commented 2 years ago

token which is in mi home properties or insert which Tokens Extractor?

PiotrMachowski commented 2 years ago

Nooo, not camera. How have you added your vacuum to HA? (not its map)

arsenal3008 commented 2 years ago

Xiaomi MIoT

PiotrMachowski commented 2 years ago

I thought so... This integration is problematic to use with map card, you have to configure it manually by yourself. Discussion: https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/issues/251 Example configs: https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/discussions/406

arsenal3008 commented 2 years ago

which file should be edited?

PiotrMachowski commented 2 years ago

It is in yaml config of Xiaomi Vacuum Map Card. Map Extractor part is done.

arsenal3008 commented 2 years ago

334

PiotrMachowski commented 2 years ago

No, this is a code of the card itself. You have to go to your dashboard, click open edit mode, edit map card and open YAML editor

arsenal3008 commented 2 years ago

324

PiotrMachowski commented 2 years ago

Yup

arsenal3008 commented 2 years ago

I'm afraid to spoil what I need to write?

PiotrMachowski commented 2 years ago

You won't break anything by editing this config. Unfortunately this is the part you need to do by yourself. Your config should look more or less like this:

type: custom:xiaomi-vacuum-map-card
entity: vacuum.xiaomi_vacuum
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
map_modes:
- template: vacuum_clean_segment
  max_selections: 1
  repeats_type: EXTERNAL
  max_repeats: 5
  service_call_schema:
    service: xiaomi_miot.call_action
    service_data:
      entity_id: '[[entity_id]]'
      siid: 2
      aiid: 6
      params:
        - piid: 9
          value: '[[[selection_unwrapped]]]'
      force_params: true
  predefined_selections:
    # HERE YOU HAVE TO PROVIDE ROOMS

Getting rooms: https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card/discussions/317

arsenal3008 commented 2 years ago

entity_id: '[[entity_id]]' ? siid: 2 ? aiid: 6 ? params:

PiotrMachowski commented 2 years ago

nothing (I have updated it, there were mismatched brackets). Documentation: https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card#supported-templates

Please bear in mind that config I have pasted above is just a wild guess, I can't validate if it will work with your vacuum

arsenal3008 commented 2 years ago

sorry, I'm not a programmer and I can't figure it out without the help of the one who wrote the code

PiotrMachowski commented 2 years ago

Ok, you can try to call xiaomi_miot.call_action with appropriate data using dev tools: Open your Home Assistant instance and show your service developer tools with a specific service selected.

You can start with following config:

    service: xiaomi_miot.call_action
    service_data:
      entity_id: vacum.hmi707_cloud_787133
      siid: 2
      aiid: 6
      params:
        - piid: 9
          value: '[1, 11, 14, 16]' # here you can provide IDs of your rooms
      force_params: true

When you succeed you can send service call data here and I will help with card setup.

arsenal3008 commented 2 years ago

Failed to call service xiaomi_miot.call_action. Unable to find service xiaomi_miot.call_action

PiotrMachowski commented 2 years ago

Which integration do you use? https://github.com/al-one/hass-xiaomi-miot or https://github.com/ha0y/xiaomi_miot_raw

arsenal3008 commented 2 years ago

Xiaomi Miot For HomeAssistant https://github.com/al-one/hass-xiaomi-miot

arsenal3008 commented 2 years ago

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

PiotrMachowski commented 2 years ago

Try this one:

    service: xiaomi_miot.call_action
    data:
      entity_id: vacum.hmi707_cloud_787133
      siid: 2
      aiid: 6
      params:
        - piid: 9
          value: '[1, 11, 14, 16]' # here you can provide IDs of your rooms
      force_params: true
arsenal3008 commented 2 years ago

I don't understand the syntax, but somewhere is an error 4335

PiotrMachowski commented 2 years ago
service: xiaomi_miot.call_action
data:
  entity_id: vacum.hmi707_cloud_787133
  siid: 2
  aiid: 6
  params:
    - piid: 9
      value: '[1, 11, 14, 16]'
  force_params: true
arsenal3008 commented 2 years ago

service: xiaomi_miot.call_action data: entity_id: vacuum.hmi707_cloud_787133 siid: 2 aiid: 6 params:

arsenal3008 commented 2 years ago

6522

arsenal3008 commented 2 years ago

46558

arsenal3008 commented 2 years ago

Failed to call service vacuum/send_command

PiotrMachowski commented 2 years ago

Failed to call service vacuum/send_command

It won't work. You have to use xiaomi_miot.call_action

arsenal3008 commented 2 years ago

I don't know where to write this

arsenal3008 commented 2 years ago

Can you advise tomorrow afternoon?

PiotrMachowski commented 2 years ago

6522

You already did it here. You should be able to get some help in https://github.com/al-one/hass-xiaomi-miot repository