rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
667 stars 73 forks source link

Feature Request: API Call for actual loaded map #334

Closed b2az closed 3 years ago

b2az commented 3 years ago

Expected behavior I'd like to have an API call, where i can see, which map is loaded rn. In my setup there are 2 stored maps atm, which are loaded a) from valetudo frontend b) via a REST-Service out of Home Assistant.

Depending on the active map, i could do then some automations and UI stuff.

In the screenshot below there are two buttons which are set to a X/Y (goto Stairs , goto trash bin) This could be two different locations depending on the loaded map.

A (not always working) workaround I'm using is to measure the dBm from /api/wifi_status and also get the BSSID out of this call (1 Access Point per floor).

Pseudo-code: IF bssid changes to the one from first floor AND dBm > 35 THEN floor=1 ELSEIF bssid changes to the one from second floor AND db > 35 THEN floor=2 ENDIF Screenshots image

rand256 commented 3 years ago

Actually there is no concept as a name for a current map.

You can save map snapshots with valetudo by some user-specified names, but those are only snapshots. And the only map that is currently loaded into the device is untitled by design. Yes, we can try to save somewhere the name of the map we last loaded, but there will be just no guarantee that the current map would be actually equal to that map, as it could be modified, reset or changed anytime by any other means that are not controlled by valetudo.

tl;dr The best we can add is an API call to get last loaded map name, not the actual one.

b2az commented 3 years ago

Hi @rand256 thank you for your fast reply and also your active development on RE. After thinking about your TLDR, I think a call for getting the last loaded map name would totally solve my issue.

Thanks in advance.

Best, b2az

b2az commented 2 years ago

Thx for implementing this @rand256 it makes our lifes easier!