sander1988 / Indego

Home Assistant Custom Component for Bosch Indego Lawn Mower
Apache License 2.0
96 stars 29 forks source link

Garden Map #133

Closed provaprova1 closed 1 year ago

provaprova1 commented 3 years ago

Is there a way to display garden map with indego position as in the original Bosch app?

image

Shamshala commented 3 years ago

There is no official way but check out the Discord server, some people have discussed it and come up with a solution, of some sort. :wink:

jm-73 commented 3 years ago

I am not sure that I am going to implement this. I dont have the skills. But you are welcome to contribute with a PR!

mirkin-pixel commented 3 years ago

There is no official way but check out the Discord server, some people have discussed it and come up with a solution, of some sort. πŸ˜‰

Any idee how I can find it on the Discord server? Is it in the home assistant channel?

MartinKuhl commented 3 years ago

Here are some information how to get the map via the bosch API: https://github.com/zazaz-de/iot-device-bosch-indego-controller/blob/master/PROTOCOL.md#getting-the-map

kaystrobach commented 2 years ago

I would also sponsor that. Please contact me personally if you are interested.

jm-73 commented 2 years ago

Still waiting for some PRs... ;-)

kaystrobach commented 2 years ago

That’s sadly not possible right now for me. The sponsoring option is still valid for me. I would throw 200€ in the round for a solution. Payed via paypal or github sponsorinh or something similar. Thanks a lot.

https://github.com/sponsors

jm-73 commented 2 years ago

I dont have the knowledge (nor time). Anyone else?

kaystrobach commented 2 years ago

The solution described here seems doable. But I’m not into the languages used here.

https://github.com/zazaz-de/iot-device-bosch-indego-controller/blob/master/PROTOCOL.md

I doubt we would need a camera entity like it was done for the roborock vacuums. But Iβ€˜ve no idea how to implement that.

https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card

mtpr-ot commented 2 years ago

Thanks for this great integration! In relation to the map request, that would be really nice and all, but what I would really like to have first of all is the map position coordinates from the status call. I would use those to determine which section of the garden the mower is in, and also detect if the mower got stuck. Would that be more doable?

mtpr-ot commented 2 years ago

Would that be more doable?

Turned out it was quite easy to add those coordinates as attributes in the detailed state entity. Will test out and see if it has value.

kaystrobach commented 2 years ago

awesome

kaystrobach commented 2 years ago

I found this description for reading the map:

https://github.com/zazaz-de/iot-device-bosch-indego-controller/blob/master/PROTOCOL.md#getting-the-map

wimb0 commented 2 years ago

I made a quick and dirty script using pyIndego to download the map and add the mower's position: https://github.com/wimb0/indegomap Maybe someone with more knowledge of this integration and/or Home Assistant can build something like this for this integration

jm-73 commented 2 years ago

I am waiting for some pull requests... :-)

Merexor commented 1 year ago

@jm-73 what do you mean with pull request ?

jm-73 commented 1 year ago

"A pull request in GitHub is a request to the maintainer of a repository to pull in some code."

Explanation from:

https://www.dummies.com/article/technology/programming-web-design/general-programming-web-design/what-are-github-pull-requests-264741/

jm-73 commented 1 year ago

Basically I dont have the knowledge how to do this. Somebody else have to implement this and merge the new function with the integration.

mattydebie commented 1 year ago

I'm getting my mower setup tomorrow, might look into integrating the map!

kimzeuner commented 1 year ago

i have found a youtube video (in german) where the map was integrated to HA. There is also a github page about it but i think it won`t work since bosch has changed the log in method. Maybe this can help to add the map in this integration ?! https://www.youtube.com/watch?v=-sOSOXz-Vv0 https://github.com/SmarthomeAddicted/Indego-Integration

Swiftnesses commented 1 year ago

Would love to see this added.

Swiftnesses commented 1 year ago

Looks to relatively 'easy' with your pyIndego @jm-73

https://github.com/wimb0/indegomap/blob/main/get-indego-map.py

kimzeuner commented 1 year ago

Hi Guys, In the last days i thought "it cant be that difficult to add the map when there were already solutions in the past" (before single key id), so i did some copy and paste and trial and error for several hours and finally i had a map from my mower in my home assistant. I made this using the version 5.1 from jm-73 and adding some code snippets from SmarthomeAddicted https://github.com/SmarthomeAddicted/Indego-Integration for me it is working for one day now and i wanted to share it with you as you are also interested in using the map. You cand find the Readme with installation and usage details here --> https://github.com/kimzeuner/Indego-Map-Extension.git Some more details regarding usage and integration in lovelace cards you can find in the already mentioned youtube video by SmarthomeAddicted https://www.youtube.com/watch?v=-sOSOXz-Vv0 Unfortunately i have never worked with python and i really just did some copy and paste so i hope it works for you as it does for me at the moment. Maybe jm-73 can review my files and probably add it to the official integration ?

Hope you can enjoy the map feature!

FBruynbroeck commented 1 year ago

Hi everyone,

I'm currently developing the garden map functionality.

My idea is to add a camera entity that will display the map.

The map will be generated on demand (during camera UI rendering).

If you don't display the dashboard containing the camera, no call will be made to the api.

The map will be refreshed every 10 seconds (default value of CameraImageView rendering).

My fork / POC: https://github.com/FBruynbroeck/Indego/tree/issue133_garden_map

What do you think?

LarsLautrup commented 1 year ago

Does anyone know if its possible somehow to retrieve the map, that the mower "draws" of where it has mowed the lawn, and what parts are missing? That would be nice ...

FBruynbroeck commented 1 year ago

Does anyone know if its possible somehow to retrieve the map, that the mower "draws" of where it has mowed the lawn, and what parts are missing? That would be nice ...

Drawing the mown lawn is not an option for me. The data retrieved from the API is not precise enough. The X/Y positions are too approximate and the refresh rate too long.

If we wanted to simulate the route, we'd have to retrieve the positions continuously and connect points with a line for an ugly/approximate visual result.

The firmware and API have not been designed to achieve this.

To achieve this, the mower would have to record its route and send it to the api, but it doesn't (and probably never will). 😞

However, you can try my feature that displays the mower's position on the map (is always better than nothing). It displays the map directly in the dashboard from a camera entity with a 10-second refresh rate (no need to download the map manually, it's ready to use). I'll be very happy to read your feedback and make improvements/bug fixes if necessary before de pull request. πŸ™‚

LarsLautrup commented 1 year ago

Drawing the mown lawn is not an option for me. The data retrieved from the API is not precise enough. The X/Y positions are too approximate and the refresh rate too long.

Whenever my mower is working, it stop occasionally and "saves the map", before it continues. I thought it would be nice to see a pmap containing what parts of the lawn, that has been mowed and which parts, that has not - but it needs to be by retrieving that internal map, the mower is updating and saving. I fully agree, that retrieving and registering coordinates won't work and probably exhaust the API and the server it runs on.

I'll try your "camera map". Thanks! πŸ™‚

/Lars.

FBruynbroeck commented 1 year ago

Drawing the mown lawn is not an option for me. The data retrieved from the API is not precise enough. The X/Y positions are too approximate and the refresh rate too long.

Whenever my mower is working, it stop occasionally and "saves the map", before it continues. I thought it would be nice to see a pmap containing what parts of the lawn, that has been mowed and which parts, that has not - but it needs to be by retrieving that internal map, the mower is updating and saving. I fully agree, that retrieving and registering coordinates won't work and probably exhaust the API and the server it runs on.

I'll try your "camera map". Thanks! πŸ™‚

/Lars.

Yes, the mower displays "saves the map" but we can't retrieve the desired information from the API. The only information is the percentage of lawn mowed.

kimzeuner commented 1 year ago

Thanks for your work, i just tried it this morning and everything seems to work well so far. It is also much more comfortable than downloading the map etc. as mentioned in "my" fork. Is it possible to "save" the map with a transparent background ? i was not able to find the right command for that until now but i think it would look much better in dark mode. Thanks!

FBruynbroeck commented 1 year ago

Thanks for your work, i just tried it this morning and everything seems to work well so far. It is also much more comfortable than downloading the map etc. as mentioned in "my" fork. Is it possible to "save" the map with a transparent background ? i was not able to find the right command for that until now but i think it would look much better in dark mode. Thanks!

Yes, it's possible. The API returns an image in SVG format. So it's very easy to manipulate the file to change the background color. I've just pushed a commit that meets your needs.

Thanks for your feedback. πŸ™‚

kimzeuner commented 1 year ago

Thanks for your quick response, this helped me a lot. As i also didn`t want to see the stroke i just added ".replace('#CCCCCC', 'transparent')" to your code so it now looks like this: "svg = fromstring(lawn_map.decode("utf-8").replace('#FAFAFA', 'transparent').replace('#CCCCCC', 'transparent'))", not sure if this is something you would like to add.

FBruynbroeck commented 1 year ago

Thanks for your quick response, this helped me a lot. As i also didn`t want to see the stroke i just added ".replace('#CCCCCC', 'transparent')" to your code so it now looks like this: "svg = fromstring(lawn_map.decode("utf-8").replace('#FAFAFA', 'transparent').replace('#CCCCCC', 'transparent'))", not sure if this is something you would like to add.

I thought about it too, but I didn't want to do it directly (it might interest some users to keep the grid in the background). However, if it suits everyone, then I can hide the grid in the same way.

sytchi commented 1 year ago

I'm testing the map for a while now. It's a very nice feature. Thank you @FBruynbroeck. The only issue I've noticed is that the map disappears during updates, which is somehow kind of an unpleasant experience (at least for me).

Unfortunately yesterday the whole integration stopped updating data at all - the entities are available, but the status is basically stuck. Do you think the API could have somehow cut me off? The Bosh APP works fine. Did anyone had similar issue?

kaystrobach commented 1 year ago

Broken without map and in the app since hours πŸ€·β€β™‚οΈ

FBruynbroeck commented 1 year ago

Hello @sytchi, Thanks for your feedback ! πŸ™‚

You should retrieve my latest commits and check if you still have the problem of the disappearing map. Normally it shouldn't happen (except when starting up homeassistant where the map will take a little time to load and just after returning to the dock as it does a final refresh before doing nothing more before the next mowing).

As for the data update problem, I think we all have the same problem. The API has been returning a 403 error since yesterday. I've just created an issue with explanations: https://github.com/jm-73/pyIndego/issues/119

Until we find a solution, you can manually modify the user-agent in pyIndego with a random string, restart homeassistant and your system will work again. πŸ˜‰

The 403 error is probably due to the fact that we're making too many calls to the API following our tests with the map feature. Check in the future and limit calls if necessary...

sytchi commented 1 year ago

Until we find a solution, you can manually modify the user-agent in pyIndego with a random string, restart homeassistant and your system will work again. πŸ˜‰

Call me dumb, but where do I look for pyIndego files in my Home Assintant filesystem? Or what's a proper way of changing user-agent for that lib?

EDIT: Here's the answer: https://github.com/jm-73/pyIndego/issues/119#issuecomment-1573813402

jm-73 commented 1 year ago

Function is released in the 5.3.0 (Beta). Soon available as general release if tests are successful.