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).
MIT License
1.47k stars 252 forks source link

Problem with Camera_Calibration #85

Closed Nicols07 closed 3 years ago

Nicols07 commented 3 years ago

I have a problem when Camera_Calibration is at True !

Xiaomi Cloud Map Extractor send good values :

calibration_points:
  - vacuum:
      x: 25500
      'y': 25500
    map:
      x: 372
      'y': 322
  - vacuum:
      x: 26500
      'y': 25500
    map:
      x: 412
      'y': 322
  - vacuum:
      x: 26500
      'y': 26500
    map:
      x: 412
      'y': 282
charger:
  x: 25605
  'y': 25221
image:
  size: 201627
  offset_y: 323
  offset_x: 324
  height: 349
  scale: 2
  rotation: 0
  width: 391

But i don't know why it's impossible to configure a manual map with this parameters.... i must force the same parameters in calibration_points !

image

image

PiotrMachowski commented 3 years ago

It seems you used wrong entity id in map_camera in first config

Nicols07 commented 3 years ago

Sorry for that, I did it quickly for the screenshot ...

The problem was that the name of the camera must be in lowercase for the calibration to work while the map was displayed correctly ... Not ok with : camera_calibration: camera.GastonMAP Ok with : camera_calibration: camera.gastonmap

Maybe you could modify this ?

Regards.

PiotrMachowski commented 3 years ago

I would prefer to not mess around with entity id, I just use them to communicate with HA API

Nicols07 commented 3 years ago

If you can replicate the same problem on you HA, maybe you can use a JavaScript String toLowerCase() Method on camera_calibration variable to convert lowercase letters.