tuya_cloud_map_extractor icon indicating copy to clipboard operation
tuya_cloud_map_extractor copied to clipboard

Possibly add live location/path direct from vacuum

Open backcountrymountains opened this issue 6 months ago • 2 comments

Unfortunately, the path information retrieved from the tuya cloud doesn't update frequently with my vacuum. For example, the last time I ran the vacuum it only updated the path once during the whole 40 minute cleaning time.

However, my vacuum does barf out a constant stream of base64-encoded json-formatted data while it's running. One part of that data is the vacuum's position:

{{(state_attr('vacuum.downstairs_vacuum','sensor')| base64_decode)}}
{%set pos = (state_attr('vacuum.downstairs_vacuum','sensor')| base64_decode) | from_json %}
{{pos['data']['pos'] }}

returns a constantly updating stream of data:

{"data":{"pos":[-619,-4395]},"infoType":20001}
[-619, -4395]
...
{"data":{"phi":-3141,"pos":[-2224,-3225]},"infoType":20001}
[-2224, -3225]

I don't know what "phi" is.

I don't know if other vacuums also send out this data, but I was wondering how hard it would be to use the data directly sent from the vacuum to draw the path and mark the vacuum's current location on the map.

I've also noticed that when I look at the map in the tuya app, it seems to load path sections sequentially in order to display the combined most recent total path. That is, it loads the path from one area, and then another area, and another on top of the map. Perhaps, my vacuum has a weird way of storing the path data in the tuya cloud and this integration is only downloading the initial path segment and not subsequent path segments?

backcountrymountains avatar Feb 28 '24 18:02 backcountrymountains