oven-lab / tuya_cloud_map_extractor

Tuya cloud vacuum map extractor for Home Assistant
MIT License
27 stars 6 forks source link

[BUG] - Map format not supported Map version [60] #31

Open backcountrymountains opened 7 months ago

backcountrymountains commented 7 months ago

Describe the bug This was working for my iHome AutoVac Nova, but now it has an error.

Version: Core 2023.12.3 Supervisor 2024.02.0 Operating System 11.4 Frontend 20231208.2

Log entry

 WARNING (SyncWorker_16) [custom_components.tuya_cloud_map_extractor.tuya_vacuum_map_extractor.main] Got 500 from server while downloading map.
2024-02-28 08:24:41.729 ERROR (SyncWorker_16) [custom_components.tuya_cloud_map_extractor.tuya_vacuum_map_extractor.main] Unsupported data type. Include the following data in a github issue to request the data format to be added: 500b'PEVycm9yPgo8Q29kZT5TZXJ2ZXJFcnJvcjwvQ29kZT4KPE1lc3NhZ2U+U2VydmVyIEVycm9yLCBwbHMgY29udGFjdCBzZXJ2aWNlIHByb3ZpZGVyPC9NZXNzYWdlPgo8L0Vycm9yPg=='b'eydyZXN1bHQnOiBbeydtYXBfdHlwZSc6IDAsICdtYXBfdXJsJzogJ2h0dHBzOi8vdHktdXMtc3RvcmFnZS1wZXJtYW5lbnQuaW90YmluZy5jb20vYjllYTdiLTUyNzI5NjEyLXJ4c2piZTczMDdmOGMzMjg1OWRjL2NvbW1vbi9sYXlvdXQvbGF5LmJpbj9DQz1kODQ4ZWY3NjEyYTI0ZDRjOGM1Y2VmNTM4YjljMjJiYiZDUz02MDE3MGM3ZDZlYTI1OTIxYmIxY2NhNGRhNzQwZmE3MmY2NDZmNTg0ZDIzNjM5N2ViMDlhM2JmM2ZiMjQyYjIzJkNFPTE3MDkwOTUzNzk3OTYmQ0E9VjEmQ1I9Mid9LCB7J21hcF90eXBlJzogMSwgJ21hcF91cmwnOiAnaHR0cHM6Ly90eS11cy1zdG9yYWdlLXBlcm1hbmVudC5pb3RiaW5nLmNvbS9iOWVhN2ItNTI3Mjk2MTItcnhzamJlNzMwN2Y4YzMyODU5ZGMvY29tbW9uL3JvdXRlL3JvdS5iaW4/Q0M9ZDg0OGVmNzYxMmEyNGQ0YzhjNWNlZjUzOGI5YzIyYmImQ1M9ZTI4ZTQ0MTFjOTJmMGNiOGQ1NmYwNjgxY2Y5ZDVkZDU2YTYzZTcwYmMyNjFjMWYwNGU1Yzk0NWQ0Yzk2M2NiYyZDRT0xNzA5MDk1Mzc5ODAwJkNBPVYxJkNSPTInfV19' Thank you!
2024-02-28 08:24:41.730 WARNING (SyncWorker_16) [custom_components.tuya_cloud_map_extractor.camera] Unable to parse map data
2024-02-28 08:24:41.731 ERROR (SyncWorker_16) [custom_components.tuya_cloud_map_extractor.camera] Map version [60] is not supported.

If I base64 decode the message I get:

<Error>
<Code>ServerError</Code>
<Message>Server Error, pls contact service provider</Message>
</Error>

and a bunch of other stuff. Maybe this is just a communication error and not a map decoding error.

oven-lab commented 7 months ago

Exactly, the server returns an Internal server error (http 500). So unfortunately there is nothing to do on your end.

I also get this error from time to time, but it usually clears up after some time.

backcountrymountains commented 7 months ago

I have been experiencing this issue for a while and it wasn't resolving itself, so I did the equivalent of "turn it off, turn it back on again" by nuking the config and re-adding the tuya cloud map extractor vacuum and now it works fine again! No idea why.

I did also log into my iot.tuya.com account and did the Get Link of Real-Time Map thing, which returned links to some .bin files that I don't understand. It gave links for 0: layout map and 1: path map. Not sure if manually making the request on iot.tuya.com made a difference.

e.t.a.: I just tried to turn on the map extractor camera for my other vacuum (same model) and it gave the same error, so I nuked it as well, and now the second vacuum map is working fine, without doing anything on iot.tuya.com.

Is there anything the integration caches or saves or something that gets stale with the credentials or links to the maps? If nuking and re-adding works, maybe there's something more to refresh when the vacuum camera turns on? Dunno.

oven-lab commented 7 months ago

Oooh! How exciting!

Then it seems like the integration has some bug when it makes some sort of request error. Perhaps some encoding error or other hard to find bug. Will look into it later then!

backcountrymountains commented 7 months ago

I made an edit above, but I type slow and you responded during my edit. Not sure if it adds any helpful info.

Anyway, thanks for the great integration!

oven-lab commented 7 months ago

Ahh, I see.

As for caching, the integration caches the download links for 55 minutes to avoid making API request every time the maps need to be be updated. The links are supposed to be valid for 1h, but it wouldn't be the first time Tuya doesn't follow their own standards. That or a timestamp bug in the integration.

But as stated, I will look into it as soon as I get time to continue working on the project!