Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support a image besides camera view #754

Open
borgqueenx opened this issue Aug 22, 2024 · 14 comments
Open

Please support a image besides camera view #754

borgqueenx opened this issue Aug 22, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@borgqueenx
Copy link

Description

The official roborock integration makes constant updating images, does not have a camera view anymore. It would be great if instead of a camera, a image can be used for this card.

Solution

Supporting image view for the map.

Alternatives

No response

Context

No response

@borgqueenx borgqueenx added the enhancement New feature or request label Aug 22, 2024
@PiotrMachowski
Copy link
Owner

You can use image entity instead of camera entity by editing yaml configuration

@borgqueenx
Copy link
Author

You can use image entity instead of camera entity by editing yaml configuration

Can you show us how?

@borgqueenx
Copy link
Author

i simply tried to change camera into image in the yaml of the lovelace card, but now it says its missing calibration source.

@PiotrMachowski
Copy link
Owner

Unfortunately at this moment official Roborock integration doesn't support calibration required for the map card

@Diaoul
Copy link

Diaoul commented Sep 6, 2024

Why so? If a still image works I would imagine that one generated automatically would as well 🤔

I would love to do something like that but it does not seem to work:

map_source:
  image: image.roborock_s8_pro_ultra_ground_floor

@PiotrMachowski
Copy link
Owner

PiotrMachowski commented Sep 6, 2024

Why so? If a still image works I would imagine that one generated automatically would as well 🤔

You can try to manually calibrate the map from Roborock integration the same way you can calibrate the static image. It is not trivial though, so I prefer to not include it in the documentation.

The config would be:

map_source:
  camera: image.roborock_s8_pro_ultra_ground_floor

@Diaoul
Copy link

Diaoul commented Sep 6, 2024

Maybe we can ask the Roborock integration guys to make an easily calibrated image. What would it take to make it easier?

@PiotrMachowski
Copy link
Owner

That's not so easy. Also he is aware of this problem and we have already discussed potential solutions:

#691

home-assistant/core#105424

@Legromorph
Copy link

Is there a way to get the coordinates via the roborock custom integration, then switch back to the core integration and put the coordinates back into the card?

@PiotrMachowski
Copy link
Owner

@Legromorph potentially you can install the custom integration, copy "calibration points" from the map entity and use them to calibrate the map. Buuuut I don't know if this will work correctly - these maps might be a little bit different

@Legromorph
Copy link

Surprisingly it worked. I just had to change them a bit but it was the same ratio for all points(both x and y coordinates were shifted with the same ratio). So this is a valid strategy. Now I can enjoy the best from both the integration and the fantastic card :D

@psimona
Copy link

psimona commented Oct 5, 2024

@Legromorph potentially you can install the custom integration, copy "calibration points" from the map entity and use them to calibrate the map. Buuuut I don't know if this will work correctly - these maps might be a little bit different

@Legromorph can you elaborate on how you achieved this? Some bullets and potentially a screenshot. I would be intersted in replicating the setup.

@Legromorph
Copy link

Legromorph commented Oct 5, 2024

I am afraid, that I cannot do it with screenshots for 2 weeks because I am on vacation.
But I can list what I did for now.

  1. I installed the custom integration.
  2. I used the card to create the room coordinates.
  3. I used roborock.get_map if the card does not want to give you the coordinates of the rooms.
  4. I changed to calibration in the card from camera: true to calibration_points:
  5. I changed that the first template is the rooms template. (So I can always see the icons on the map.)
  6. I pasted the calibration points from a different github thread.
    When you paste them, your room icons will change positions. Note that under vacuum, I changed nothing. You only have to change map coordinates. Either I was just lucky or it is normal that the ratio is on all maps the same. If you change the x coordinate by for example -30 then change every other map x coordinate by -30 too.
    On each change you can see your room icons move.
    I had to change every y coordinate by +20 and every x coordinate by -120. (so not much different then the example I copied and pasted from a different user).
    Just be sure to not change the vacuum coordinates.
    Here are my real points, use them for the start.
calibration_coordinates:
    - vacuum:
        x: 25500
        "y": 25500
      map:
        x: 180
        "y": 84
    - vacuum:
        x: 35500
        "y": 25500
      map:
        x: 380
        "y": 84
    - vacuum:
        x: 25500
        "y": 35500
      map:
        x: 180
        "y": -116
  1. As soon as the room icons were on the same position as they were before I changed the calibration method, I copied the whole yaml of the card.
  2. I deinstalled the custom integration.
  3. Restart HA (important).
  4. I installed the core integration.
  5. I pasted the code into the card. (Maybe it will remember everything after the vacuum entity is swapped. But I wanted to be sure, that I dont have to reinstall again.)
  6. I changed to the send_command instead of the homeassistant-roborock. (This I had to do manual because everytime I tried fhe dropdoenmenu of the card it swapped back to homeassistant-roborock). So change the templates to the one liner written in the documentation under templates/send_command.
  7. For me I had to change alot of entitie names. Just name them with the new name from the integration (or other way around).
    And you have to delete for the status the: attribute: status because the core integration is only using the state of the roborock as status and doesnt have any attribute named status. But the rest is the same.
  8. Everything should work fine!
  9. PROFIT!

Please tell me if something is not understandable. I am not that good in english, but I tried my best.

@Mikescotland
Copy link

@Legromorph waiting for some full yaml and maybe screenshot. Did it all, all contours and icons are in place, yet when I do specific room, Consuela starts to wander to another... 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants