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

Allow rendering robot icon only, with no rooms #622

Closed
Maudfer opened this issue Jul 2, 2024 · 12 comments
Closed

Allow rendering robot icon only, with no rooms #622

Maudfer opened this issue Jul 2, 2024 · 12 comments
Labels
enhancement New feature or request

Comments

@Maudfer
Copy link

Maudfer commented Jul 2, 2024

Hi!
This integration is amazing, very well done. I've been playing around with it and my Floorplan in the Picture-elements card recently, to some very interesting results:
image

It would be great to have either a way to render only the robot, without the rooms (maybe only the robot and its path). Or maybe having some exposed attributes from where I can get the robot coordinates relative to the map.

I've tried some experiments to make do with what the integration currently exposes, I was trying to subtract pixels between the Saved Map and Current Map entities using CSS, to achieve a similar effect, but wasn't able to.

Anyway, this is not high priority, just something fun I've been playing with, and want to give you the idea, if it's easy to do.
Great work on this and thanks!

@Maudfer Maudfer added the enhancement New feature or request label Jul 2, 2024
@Maudfer
Copy link
Author

Maudfer commented Jul 2, 2024

Btw, for those interested, here's how it looks without the vacuum map overlayed, for reference
image

@Tasshack
Copy link
Owner

Tasshack commented Jul 2, 2024

There is the transparent option in the color scheme configuration options but the problem with that is it will make all of your maps transparent not just the one you put into your floorplan.

Custom card that I am making will support transparent map rendering with only selected objects but it is still work in progress.
#466

By the way, camera entity already has all of the object coordinates but those are in map coordinates not px values. To convert the coordinates to pixel values you also need to use three point calibration data that is also present in the entity attributes.

@Tasshack Tasshack closed this as completed Jul 2, 2024
@Maudfer
Copy link
Author

Maudfer commented Jul 2, 2024

Ohh, thank you @Tasshack!
Those are both useful bits of information, I didn't know about the camera attributes. I think I can work on those.
All I need is a percentage value relative to the full map size.

@Tasshack
Copy link
Owner

Tasshack commented Jul 2, 2024

All I need is a percentage value relative to the full map size.

Its not that simple.

@tungmeister
Copy link

tungmeister commented Jul 5, 2024

@Maudfer I've done this by customising the integration to create a couple of additional cameras so I can have an overlay camera map (for room names) and a camera map that just shows the robot and path:
image
He's a screenshot from before I created the second additional cameras for the room overlays:
image
I can share my modified version with you if you'd like.

@Maudfer
Copy link
Author

Maudfer commented Jul 5, 2024

Whoa, this looks AMAZING. I love what you did with the 3D there as well! Would you share the customized version of the integration, indeed, please?

In the last few days I was experimenting with creating a custom integration that loads the camera entity from @Tasshack 's integration as an input, grabs the vacuum position and calibration data, and then outputs another entity with the calculated position values. But I've yet to get it to work.

But now I'm thinking I like your approach better! @tungmeister

@tungmeister
Copy link

tungmeister commented Jul 5, 2024

@Maudfer dreame_vacuum.zip
Just extract and paste over your existing integration folder.
you'll then get additional config options in the integration settings where you can pick the objects you want visible on the additional maps, set the color scheme to transparent for the additional maps:
image

@Maudfer
Copy link
Author

Maudfer commented Jul 6, 2024

Thank you so much @tungmeister !
I'm gonna try it as soon as I finish work for the day

Don't you wanna put this into a proper fork? Then it would be possible for people to download it from HACS

But thanks anyway, this solves my problem completely.

I was trying to apply an affine transform on the coordinates vacuum coordinates using python and the calibration data, but could never get it to align correctly, since I have the camera entity scaled on my floorplan.

@Maudfer
Copy link
Author

Maudfer commented Jul 6, 2024

@tungmeister Thank you so much dude!
This is freaking amazing!

image

A tip if anyone sees this and wanna try it, first download the beta version of Dreame Vacuum (v2.0.0b15) from HACS, then extract @tungmeister's files on top of it.

@tungmeister
Copy link

tungmeister commented Jul 6, 2024

@Maudfer I have a fork, it's just not up to date and I didn't have time yesterday to sort it so uploaded my files directly for you. Glad it's working!

@IdiotTryingToFindWay
Copy link

@Maudfer I have a fork, it's just not up to date and I didn't have time yesterday to sort it so uploaded my files directly for you. Glad it's working!

So assume i'm an idiot. if i just copy the files in to the integration does it create a map as above but to my rooms layout? i havent created a floorplan map or anything.

@Maudfer
Copy link
Author

Maudfer commented Jul 22, 2024

@IdiotTryingToFindWay No, what this modified version of the integration does is just expose a separate version of the vacuum map as a new Home Assistant entity, that you can configure to be just the floating robot on a transparent background, for example.

Then if you want to do what I did, you have to create a floorplan of your house (in photoshop, for example), and superimpose the map image on top of the floorplan image. The very first picture I posted on this thread shows how it looks if I put the original vacuum map on top of the floorplan I created, while the last image shows how it looks using @tungmeister's modified version.

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

4 participants