DeebotUniverse / Deebot-4-Home-Assistant

Home Assistant integration for deebot vacuums
https://deebot.readthedocs.io/integrations/home-assistant/
GNU General Public License v3.0
180 stars 39 forks source link

Add calibration points #321

Open PiotrMachowski opened 1 year ago

PiotrMachowski commented 1 year ago

Is there an existing issue for this?

Is your feature request related to a problem?

I'm working on adding support for this integration to my Vacuum Map card, it would be great if calibration points were added to your integration as well.

Suggested solution

Add calibration points as an attribute of camera entity or as a separate entity.

About calibration points

Api example request

No response

Alternatives you've considered

No response

Additional information

No response

edenhaus commented 1 year ago

Are there any requirements on the point itself? The position on the map? Can I take the for example the four corner?

The drawing of the map is done in here

PiotrMachowski commented 1 year ago

They have to be non-linear. The best results should be achieved with 3 corners of a rectangle, map corners are fine (they don't even have to be within the map boundaries).

edenhaus commented 1 year ago

@PiotrMachowski Do you really need the calibration points or is a fixed formula also fine? In deebot case the formula would be:

pixel_value = (bot_map_value / 50) + 400 See https://github.com/DeebotUniverse/client.py/blob/66c6bd694c770fdc4bb2bb7bfdcb13cc4e53fa81/deebot_client/map.py#L79

I can also provide you with the points (calculated by the above formula)

PiotrMachowski commented 1 year ago

I think I'd prefer calibration points over formula - this will allow to avoid vacuum specific code in the card. Buuuut thanks to the formula users will be able to create template sensors by themselves and use them instead of attributes of a camera entity.

Both approaches are fine for me, calibration points would require less actions made by users, but probably just my card would use them.

sero-git commented 11 months ago

Hello @PiotrMachowski and @edenhaus,

many thanks to both of you for two great cards for vacuums in general and evovacs specifically.

I would like to kindly ask you if there is any update to the "calibration point" topic? while I do like the "predefined selection" option (which works with the coordinates provided by the"deebot_cleaning_job" event , although not beeing displayed correctly within the "vacuum map card" card) it would be amazing to use the "on demand rectangle drawing" feature.

or maybe @PiotrMachowski could give more details on how to use the above mentioned formula within a template sensor to achieve this?

I am using a deebot N8 pro with deebot4homeassistant (already using the image instead of camera map entity).

thank you!