Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor
Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor copied to clipboard
Rockrobo v1 random map rotation
Description
Is there any solution for random map 180 rotation at rockrobo v1 at every cleaning start? I know what it's MiHome problem, not extractor.
Solution
Maybe it's possible to analyse image during extraction to auto rotate it? Some kind of test check "vacuum should start cleaning from the base situated in upper left corner" or something like this? Or maybe someone already tried to do script/automatisation patch for this issue?
Alternatives
No response
Context
No response
Can you provide some examples of maps in different rotations? Is it the same as just rotating the whole image or does items on the map move as well?
I almost sure what I saw topic about this issue at your v1 map repo, but with no solution.
This is the map image from your v1 project. It's cleared, but it present normal room direction. Vacuum station is in the upper left room.
Sometimes vacuum at cleaning start rotates map at 90 degrees. Today it rotated map at 180.
What's why I stopped using previous version. Map has changed randomly and coordinates have moved vacuum into wrong position.
As I understand it's some kind of Xiaomi defence algorithm to excludes more expensive models features from the cheapest one))
Yes, there's no solution at this moment.
Can you provide raw images from Map Extractor instead? Ideally from config without map trimming
got the same problem, the most times the roborock scans, the rotation is wrong.
I pulled two images with different orientation today. It took three attempts (first and second was with the same orientation).
Can you change config of map extractor to following:
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
- image
and check out if this template correctly recognizes location of docking station?
{% set docking = state_attr('camera.xiaomi_cloud_map_extractor', 'calibration_points')[0].map %}
{% set image = state_attr('camera.xiaomi_cloud_map_extractor', 'image').dimensions %}
{% set center = {'x': image.width * image.scale / 2, 'y': image.height * image.scale / 2, } %}
{{ ('upper' if docking.y <= center.y else 'lower') + '_' + ('left' if docking.x <= center.x else 'right') }}
Yep. Your template recognized corner perfectly. If I understand your idea we need to wait until map changes it orientation and check it once again, right?
If I understand your idea we need to wait until map changes it orientation and check it once again, right?
Exactly. Also please check if CPU/RAM usage stayed at the same level
The reversed map also recognized perfectly. CPU/RAM show more or less stable consumption (I have old Rasp3 HA server) .
One more detail. I'm not sure does vacuum rotate only the map or whole coordinates field. Even if we rotate the map in HA to normal direction, coordinates we transmit to API will be reversed, am I right?
@PiotrMachowski the code works for me, too. any news on this?
Could you please give an advice, how to enable room cleaning? I mapped rooms, but when i press start button (play button near x1 in a right side) - vacuum do nothing. Rooms a selectable, but after pressing start - it becomes unchecked and no response from vacuum. Xiaomi ver.1 P.S. I am ttrying to add an screenshot here, but "something went wrong"
@LexaBukreev v1 vacuum doesn't support room cleaning