Weback cloud integration: testers and help required

Long overdue, but the spam behaviour looks like this in warning (constant, when vacuum is docked) :

2022-12-29 17:32:40.084 WARNING (Thread-329 (run_forever)) [websocket] websocket connected
2022-12-29 17:34:41.100 WARNING (Thread-332 (run_forever)) [websocket] websocket connected
2022-12-29 17:36:42.598 WARNING (Thread-333 (run_forever)) [websocket] websocket connected
2022-12-29 17:38:43.577 WARNING (Thread-334 (run_forever)) [websocket] websocket connected
2022-12-29 17:40:44.642 WARNING (Thread-335 (run_forever)) [websocket] websocket connected
2022-12-29 17:42:46.117 WARNING (Thread-336 (run_forever)) [websocket] websocket connected
2022-12-29 17:44:47.145 WARNING (Thread-337 (run_forever)) [websocket] websocket connected
2022-12-29 17:46:48.637 WARNING (Thread-338 (run_forever)) [websocket] websocket connected
2022-12-29 17:48:49.619 WARNING (Thread-339 (run_forever)) [websocket] websocket connected
2022-12-29 17:50:50.660 WARNING (Thread-340 (run_forever)) [websocket] websocket connected
2022-12-29 17:52:52.128 WARNING (Thread-341 (run_forever)) [websocket] websocket connected
2022-12-29 17:54:53.148 WARNING (Thread-342 (run_forever)) [websocket] websocket connected
2022-12-29 17:56:54.165 WARNING (Thread-343 (run_forever)) [websocket] websocket connected
2022-12-29 17:58:55.461 WARNING (Thread-344 (run_forever)) [websocket] websocket connected
2022-12-29 18:00:56.688 WARNING (Thread-345 (run_forever)) [websocket] websocket connected
2022-12-29 18:02:58.183 WARNING (Thread-346 (run_forever)) [websocket] websocket connected
2022-12-29 18:04:59.167 WARNING (Thread-347 (run_forever)) [websocket] websocket connected
2022-12-29 18:07:00.157 WARNING (Thread-348 (run_forever)) [websocket] websocket connected
2022-12-29 18:09:01.224 WARNING (Thread-349 (run_forever)) [websocket] websocket connected
2022-12-29 18:11:02.666 WARNING (Thread-350 (run_forever)) [websocket] websocket connected
2022-12-29 18:13:03.740 WARNING (Thread-351 (run_forever)) [websocket] websocket connected
2022-12-29 18:15:05.169 WARNING (Thread-352 (run_forever)) [websocket] websocket connected
2022-12-29 18:17:06.217 WARNING (Thread-353 (run_forever)) [websocket] websocket connected
2022-12-29 18:19:07.207 WARNING (Thread-354 (run_forever)) [websocket] websocket connected
2022-12-29 18:21:08.238 WARNING (Thread-355 (run_forever)) [websocket] websocket connected
2022-12-29 18:23:09.230 WARNING (Thread-356 (run_forever)) [websocket] websocket connected
2022-12-29 18:25:10.221 WARNING (Thread-357 (run_forever)) [websocket] websocket connected
2022-12-29 18:27:11.293 WARNING (Thread-358 (run_forever)) [websocket] websocket connected
2022-12-29 18:29:12.744 WARNING (Thread-359 (run_forever)) [websocket] websocket connected
2022-12-29 18:31:13.810 WARNING (Thread-360 (run_forever)) [websocket] websocket connected
2022-12-29 18:33:15.263 WARNING (Thread-363 (run_forever)) [websocket] websocket connected

Comes from core websocket but is triggered by vacuum integration. When integration is disabled, the websocket warnings spam stopps.
I am not familiar with HA under the hood, but warning spam every 2 minutes makes log reading from HA UI a nightmare when trying to debug other stuff.

Can this be addressed or we are stuck with turn core log mode away from Warning?

Hi ! This message is logged when integrations connect to the WeBack’s Server (every 120sec when docked)
but this should not be a WARNING i will update this :slight_smile:

Thanks everyone who’s contributed so far to the Weback integration. Works really well on HASS Core running Android 13 w/Termux.

I miss the map and rooms functionality. I would love to ask the vacuum to clean a specific room.

So, I’ve reversed the Weback APK, done some digging, and can finally report on the map format. I intend to fork @Jezza34000’s repo and add maps in time. Will submit a PR when ready. I’ve only spent a few hours on this so far.

My device is an ‘Electriq Helga’ - iQlean LR01. It uses LiDAR navigation. I noticed many different paths in the APK for different navigation / mapping systems. It’s possible that the following only applies to LiDAR machines.

Weback API - Maps

POST https://user.grit-cloud.com/prod/api

opt can be set to: (pass sub_type and thing_name)

reuse_map_list_get

No extra params. Returns reusable (ie. live map) listings.

reuse_map_get
Pass map_id (int). Returns JSON response with map_data property. Will get into how this is decoded shortly.

history_map_list_get
Return a list of historic maps - unsure why / what for at the moment.

history_map_get
Pass file_name to retrieve map_data.

map_data Format

map_data is base64 encoded, zlib compressed. You need to base64 decode, then run that through a zlib decompressor. You’ll get JSON.

This JSON includes:

  • Map dimensions, resolution, origin
  • Map data (base64, 2bit encoding, big endian)
  • Room_id → Room name mapping
  • Room bounding boxes
  • Various paths
  • Forbidden zones (interestingly, there’s a mop-specific forbidden zone which doesn’t appear in the app. It may be usable with in stock vacuum firmware.)

After much headscratching, I managed to parse the actual map bitmap. It’s base64 encoded too, but then also in 2-bit format. The pixel states are nothing, floor, wall as far as I can tell. I’ve only just reversed engineered this format so much more work to be done. Here’s a janky python script which will render a map image from the original map_data JSON (ie. from reuse_map_get). Save map_data as map.b64 to process.

import base64
import zlib
import json
from PIL import Image

class VacMap:
    def __init__(self, input):
        self.data = json.loads(zlib.decompress(base64.b64decode(input)))
        print(len(self.data['MapData']))
        self.map_data = bytearray(base64.b64decode(self.data['MapData']))
    
map_data = VacMap(open("map.b64").read())

map = bytearray(b"")

h = map_data.data['MapHigh']
w = map_data.data['MapWidth']

h, w = h, w

for i in range(0, len(map_data.map_data)):
    byte = map_data.map_data[i]

    map.append(((byte & 192) >> 6) * 85)
    map.append(((byte & 48) >> 4) * 85)
    map.append(((byte & 12) >> 2) * 85)
    map.append((byte & 3) * 85)

print("width " + str(w) + " height " + str(h))
img = Image.frombytes("L", (int(w), int(h)), bytes(map))
img.show()

Here’s an example of one of my map_datas:

{
    "ProtocolVersion":"1.0",
    "map_id":"12",
    "MapHigh":150,
    "MapWidth":218,
    "ChargerPoint":[
       -0.509063720703125,
       -20.13894653320313
    ],
    "MapOrigin":[
       109,
       147
    ],
    "MapResolution":0.05000000074505806,
    "MapData":"//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////1VX//////////////////////////////////////////////////////////////////////QAf///////////////////1V////////////////////////////////////////////////9AB////////////////////QFVVVV////////////////////////////////////////////0AFVVVVVf/////////////9AAAAAH////////////////////////////////////////////QAAAAAAB/////////1VV//0AAAAAV///////////////////////////////////////////9AAAAAAAH/////////QAFVVQAAAAAH1V/////////////////////////////////////////0AAAAAAAf////////9AAAAAAAAAAAXQH/////////////////////////////////////////QAAAAAAB/////////0AAAAAAAAAAAdAf/////////////////////VVVV///////////////9AAAAAAAH/////////QAAAAAAAAAAB0B/////////////9VVVVVVVVAAAFf//////////////0AAAAAAAf////////9AAAAAAAAAAAFVX/////////////0AAAAAAAAAAABX//////////////QAAAAAAV/////////0AAAAAAAAAAAAf//////////////QAAAAAAAAAAAAVVVVf/////////9AAAAAAB//////////QAAAAAAAAAAAB//////////////9AAAAAAAAAAAAAAAAB////1VVVVVUAAAAAAH/////////9AAAAAAAAAAAAH//////////////0AAAAAAAAAAAAAAAAH////QAAAAAAAAAAAAf/////////0AAAAAAAAAAAAf//////////////QAAAAAAAAAAAAAAAAf///9AAAAAAAAAAAAB//////////QAAAAAAAAAAAB//////////////9AAAAAAAAAAAAAAAAB////0AAAAAAAAAAAAH/////////9AAAAAAAAAAAAFf/////////////0AAAAAAAAAAAAAAAAH////QAAAAAAAAAAAAf/////////0AAAAAAAAAAAAB//////////////QAAAAAAAAAAAAAAAAf///9AAAAAAAAAAAAB//////////QAAAAAAAAAAAAH/////////////9AAAAAAAAAAAAAAAAB////0AAAAAAAAAAAAH/////////9AAAAAAAAAAAAAf/////////////0AAAAAAAAAAAAAAAAH////QAAAAAAAAAAAAf/////////0AAAAAAAAAAAAB//////////////QAAAAAAAAAAAAAAAAf///9AAAAAAAAAAAAB//////////QAAAAAAAAAAAAX/////////////9AAAAAAAAAAAAAAAAB////0AAAAAAAAAAAAH/////////1VVVVVQAAAAAAF//////////////0AAAAAAAAAAAAAAAAH////QAAAAAAAAAAAAf/////////QAAAAVVQAAAAAf//////////////VAAAAQAAAAAAAAAAAf///9AAAAAAAAAAAAB/////////9AAAABABAAAAAB///////////////UAAABQAAAAAAAAAAB////0AAAAAAAAAAAAH/////////0AAAAEAEAAAAAH//////////////9AAFAAUAAAAAAAAAAH////QAAAAAAAAAAAAf/////////QAAAAQAQAAABVf//////////////0AAUABQAAAAAAAAAAf///9AAAAAAAAAAAAB/////////9AAAABABAAAAF///////////////9QABAAAAAAAAAAAAAB////0AAAEAAAAAAAAH/////////0AAQFUAEAAAAFf//////////////0AAAAAAAAAAAAAAAAH////QAQAAAAAAAAAAf/////////QAAAfQAQAAAAB///////////////QAAAAAAAAAAAAAAAAf///9AAAAAAAAAAAAB/////////9AAAB9ABAAAAAH//////////////9AAAAAAAAAAAAAAAAB////0AAAAAAAAAAAAH/////////0AAAH0AQAAAAAf//////////////0AAAAAEAAAAAAAAAAH////QAAAAAAAAAAAAf/////////QAAAVVVAAAAAB///////////////UAAEAAUAAAAAAAAAAf///9AAAAAAAAAAAAB/////////9AAAAFAEAAABVX///////////////QAFQAAAAAAAAAAAAB////0AAAAAAAAAAAAH/////////0AAAAUAQAAAX////////////////9AAVAAAAAAAAAAAAAH////QAAAAAAAAAAAAX/////////QAAABQBAAAB/////////////////0ABUAAAAAAAAAAAABf///9AAAAAAAAAAAAAf////////9AAAAFAEAAAH////////////////1QABQAFAAAAAAAAAAH////0AAAAAAAAAABAB/////////0AAAAVAQAAAf////////////////QAAAAAUAAAAAAAAAAf////QAAAAAAAAAAAAH///////9VVUBVVUAAAAB////////////////9AAAAAAAAAAAAAAAAB////9AAAAAAAAAAAAAf///////0B/QH/9AAAAAH9Vf/////////////0AAAAAAAAAAAAAAAAH////0AAAAAAAAAAAAB///////1QH9V//0AAAAAVUB//////////////QAAAAAAAAAAAAAAAAf////QAAAAAAAAAAAAH///////QAf////QAAAAAAAH/////////////9UAAAAAAAAAAAAAAAB////9AAAAAABQAAAFVVVf////9AV////9AAAAAAAAf/////////////1AAFAAEAAAAAAAAAAH////0AAAAAAFAAAAfUAUB////0B/////0AAAAAAAB//////////////QAAUAAQAAAAAAAAAAf////QAAAAAAUAAAF9ABQH////QH/////QAAAAAAAH/////////////9AABQAAAAAAAAAAAAB////9AAAAAABVVVVVUAFAf///9Vf////9AAAAAAAAf/////////////0BVVQAAAAAAAAAAAAH////0AAAAAAH///9AQBf9///////1VV/0AAAAAAAB//////////////VX/9AUAAAAAAAAAAAf////QAAAABVX///0BVX///VX////QAFVQAAAAAAAH/////////////////0BQAAAAAAAAAAB////1AAAAAFAf///QH////9Af///9AAAAAAAAAAAAf////////////////9QAAAAAAAAAAAAVf///QAAAAAAB///9Vf////0B//VV0AAAAAAAAAAAB/////////////////0AAAAAAAAAAAAAB///9AAAAAAAH//////////QFV9AFQAAAAAAAAAAAH/////////////////QAAAAAAAAAAAAAH///0AAAAAAAf/////////9VQH0AAAAAAAAAAAAAAf////////////////9AAAAAAAAAAAAAAf///QAAAAAAB//////////1UAfQAAAAAAAAAAAAAB/////////////////0AAAAAAAAAAAAAB///9AAAAAAAH//////////QAB9AAAAAAAAAAAAAAH/////////////////QAAAAAAAAAAAAAH///0AAAAAAAf/////////9AAV0AAAAAAAAAAAAAAf////////////////9UAAAAAAAAAAAAAf///QAAAAAAB//////////0AAFVAAAAAAAAAAAAAB//////////////////QAAAAAAAAAAAAB///9AAAAAAAH//////////VUAEAAAAAAAAAAAAAAH/////////////////9AAAAAAAAAAAAAFX//0AAAAAAAf///////////QAQAAAAAAAAAAAAAAf/////////////////0AAAAAAAAAAAAAAVV/QAAAAAAB///////////9ABAAAAAAAAAAAAAAB//////////////////QAAAAAAAAAAAAAAAH9AAAAAAAH/////////9VUAAAAAAAAAAAAAAAAH/////////////////9AAAAAAAAAAAAAAAAf0AAAAAAAf/////////0BQAAAAAAAAAAAAAAAAf/////////////////0AAAAAAAAAAAAAAAB/QAAAAAAB//////////QFAAAAAAAAAAAAFAABV//////////////////QAAAAAAAAAAAAAAAH9AAAAAAAH/////////9AAAAAAAAAAAAAAAAAFX/////////////////9AAAAAAAAAAAAAAAAf0AAAAABVf/////////0AAAAAAAAAAAAAAAAAAf/////////////////0AAQAAAAAAAAAAAAB/QAAAAAF///////////QAAAAAAAAAAAAAAAAAB//////////////////QAAAAAAAAAAAAAAAH9AAAAAAH//////////9AAAAAAAAAAAAAAAAAAH/////////////////9AAAAAAAQAAAAAAAAf0AAAAAAf//////////0AAAAABAAAAAAAAAAAAf/////////////////0AAAAAABAAFAAAAAB/QAAAAAB///////////QAAAAAFAAAAAAAAAAAB//////////////////QAAAAAAUAAUAAAAAH9AAAAAAX//////////9AAAFAAQAAAAAAAAUAAH/////////////////9AAAAAABQABQAAAAAf0AAAAAB///////////0AAAEABAAAAAAAABAAAf/////////////////1VVVVVAFAAFAAAAAB/QAAAAAH///////////QAAAQAEAAAAAABVUABV///////////////////////0AUAAUAAAAAH9AAAAAAf//////////9AAEAAAQAAAAAAB/QAX////////////////////////QBQABQAAAAAf0AAAAAF///////////0AAUAABVQAAAAAH9AF////////////////////////9VVVVVVQAAAB/QAAAAAf///////////QBUAAAVVAAAAAAfVVf//////////////////////////////9AAAAH9AAAAAB///////////9AAAAAB0AAAAAAB9AB///////////////////////////////0AAAAf0AAAAAH///////////1AAAAAXQAAAAAAX0AF///////////////////////////////QAAAB/QAAAAVf///////////UAAAAFVAAAAAAFfQAF//////////////////////////////9AAAAH9AAAAB////////////9AAAAAAEAAAAAAB9AAH//////////////////////////////0AAAAf0AAAAH////////////0AAAAAAAAAAAAAH0AAf//////////////////////////////QAAAB/QAAAAf////////////QAAAAAAAAAAAEAfVAB//////////////////////////////9AAAAH9AAAABVX//////////9AAAAAAAAAAAAQB/1VVf/////////////////////////////0AAAAf0AAAAFAf//////////0AAAAAAAAAAAFVV//UB//////////////////////////////QAAAB/QAAAAUAP//////////QAAAAAAAAAAAUAH/9AH////////////////////////////99AAAAH9AAAABQAP/////////9QFVUAAAAAAABQAf/8Af///////////////////////////wH0AAAAf0AAAAFAA//////////1V//UAAAAAAAFAB//wF///////////////////////////8AfQAAAB/QAAAAUAD//////////QH//QAAAAAAAVVX//Vf///////////////////////////AB9AAAAH9AAAABQAX/////////9Af/9AAAAAAAB/////////////////////////////////AAH0AAAAf0AAAAFAB//////////0B//UAAAAAAAX////////////////////////////////0AAfQAAAB/QAAAAUAH//////////VX/9AAAAAAAB////////////////////////////////VQAB9AAAAH9AAAABVAf/////////////0AAAAAAAH///////////////////////////////0AAAH0AAABf0AAAAH0B//////////////QAAAAAAAf////////////////////1VVVVVVVVVVQAABfQAAAH/UAAAAfVX/////////////9AAAAAAAB/////////////////////QAAAAAAAAAQAAAH9AAAAf/QAAABf///////////////0AAAAAAAH////////////////////9AAAAAAAAABAAAA/0AAAB/9AAAAB////////////////VVVQAAAAf////////////////////0AAAAAAAAAEAAAP/QAAAH/0AAAAH//////////////////9QAAAB/////////////////////QAAAAAAAAAVQAAP9AAAAVVQAAAAVVVVVVVVVVV/9VVVf//1AAAAF////////////////////9AAAAAAAAAABVAA/0AAAAAAAAAAAAAAAAAAAAAFVUAABVVVQAAAAH////////////////////0AAAAAAAAAAAFUD/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVVVV/////////////////QAAAAAAAAAAAAVX1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFVVX/////////////9AAAAAAAAAAAAABVQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////QAVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////9AF0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/////////////0AfQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//////////////QB9AAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/////////////9AH0AAAAAAUAAAAAAAAAAAAAAVUAAAAAAVQAAAAAAAAAAAAAAAAAAAAAAAAf/////////////1VfVUAAAAFUAAAAAAAAAAAAAB/UAAAAAB9UAAAAAAAAAAAAAAAAAAAAAAAB//////////////////QAAAAfQAAAAAAAAAAAAAH9AAAAFAH/QAAAAAAAAAAAAAAAAAAAAAAAH/////////////////9AAAAF9AAAAAAAAAAAAAAf0AAAAUAf9VVVVVQAAAAAAAAAAAAAAAAAAf/////////////////1VVVVf0AAAAAAAAAAAAAB/QAAABQB//////9QAAAAAAAAAAAAAAAAAB////////////////////////QAAAAUAAAAAAAAH9AAAAFAH//////9AAAAAAAAAAAAAAAAAAH///////////////////////9VVVVVVVVVVVVVVf1VVVVVVf//////0AAAAAAAAAAAAAAAAAAf/////////////////////////////////////////////////////VVVVVVVVVQAAAAAAAAB//////////////////////////////////////////////////////////////9VVVVVVVVVX//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////",
    "MapSize":10900,
    "can_edit_zone_info":true,
    "can_select_zone_clean":true,
    "laser_goto_path_y":[
       
    ],
    "goto_point":[
       
    ],
    "forbidden_zone_point_num":0,
    "forbidden_zone_y":[
       
    ],
    "room_zone_info":[
       {
          "room_id":0,
          "clean_times":1,
          "clean_order":4294967295,
          "room_point_x":[
             -560,
             -550,
             -490,
             -470,
             -360,
             -350,
             -350,
             -340,
             -340,
             -320,
             -270,
             -260,
             -260,
             -270,
             -270,
             -380,
             -380,
             -390,
             -500,
             -510,
             -570,
             -580,
             -740,
             -740,
             -750,
             -840,
             -850,
             -850,
             -840,
             -840,
             -830,
             -610
          ],
          "room_point_y":[
             -1220,
             -1210,
             -1210,
             -1190,
             -1190,
             -1180,
             -810,
             -800,
             -760,
             -730,
             -730,
             -720,
             -430,
             -420,
             -380,
             -380,
             -590,
             -600,
             -600,
             -610,
             -610,
             -630,
             -630,
             -850,
             -860,
             -860,
             -910,
             -1030,
             -1040,
             -1200,
             -1210,
             -1210
          ],
          "room_name":"Kitchen"
       },
       {
          "room_id":3,
          "clean_times":1,
          "clean_order":4294967295,
          "room_point_x":[
             710,
             890,
             890,
             880,
             880,
             860,
             830,
             760,
             750,
             750,
             690,
             680,
             680,
             540,
             540,
             530,
             460,
             450,
             450,
             440,
             350,
             340,
             340,
             360,
             360,
             450,
             460,
             460,
             510,
             510,
             650,
             670
          ],
          "room_point_y":[
             -1280,
             -1280,
             -990,
             -980,
             -630,
             -630,
             -600,
             -600,
             -590,
             -470,
             -470,
             -460,
             -350,
             -350,
             -390,
             -400,
             -400,
             -410,
             -480,
             -490,
             -490,
             -500,
             -710,
             -730,
             -790,
             -790,
             -800,
             -840,
             -850,
             -1260,
             -1260,
             -1290
          ],
          "room_name":"Lounge"
       },
       {
          "room_id":4,
          "clean_times":1,
          "clean_order":4294967295,
          "room_point_x":[
             20,
             40,
             190,
             200,
             200,
             190,
             190,
             180,
             80,
             70,
             70,
             -269,
             -260,
             -210,
             -200,
             -200,
             -190,
             -190,
             -180,
             -20,
             -10,
             -10
          ],
          "room_point_y":[
             -1300,
             -1270,
             -1270,
             -1260,
             -1230,
             -1220,
             -940,
             -930,
             -930,
             -920,
             -375,
             -374,
             -400,
             -400,
             -410,
             -710,
             -720,
             -1170,
             -1180,
             -1180,
             -1190,
             -1300
          ],
          "room_name":"Bedroom"
       },
       {
          "room_id":7,
          "clean_times":1,
          "clean_order":4294967295,
          "room_point_x":[
             -380,
             -270,
             -269,
             60,
             80,
             90,
             430,
             440,
             530,
             540,
             790,
             800,
             870,
             880,
             880,
             870,
             550,
             540,
             340,
             330,
             90,
             60,
             60,
             -419,
             -409,
             -390
          ],
          "room_point_y":[
             -370,
             -370,
             -374,
             -375,
             -380,
             -360,
             -360,
             -350,
             -350,
             -340,
             -340,
             -330,
             -330,
             -320,
             -180,
             -170,
             -170,
             -180,
             -180,
             -190,
             -190,
             -180,
             -190,
             -190,
             -400,
             -400
          ],
          "room_name":"Hallway"
       },
       {
          "room_id":8,
          "clean_times":1,
          "clean_order":4294967295,
          "room_point_x":[
             -419,
             -540,
             -560,
             -720,
             -740,
             -840,
             -850,
             -850,
             -840,
             -409
          ],
          "room_point_y":[
             -190,
             -190,
             -210,
             -210,
             -240,
             -240,
             -250,
             -390,
             -400,
             -400
          ],
          "room_name":"Bathroom"
       }
    ],
    "laser_wall_line_x":[
       
    ],
    "laser_wall_line_y":[
       
    ],
    "laser_wall_line_point_num":0,
    "forbidden_zone_x":[
       
    ],
    "laser_goto_path_x":[
       
    ],
    "selected_zone":[
       
    ],
    "map_type":"yw_ls",
    "vendor_firmware_version":"4.00.26",
    "map_name":"House",
    "update_timestamp":"1672739662",
    "create_timestamp":"1672613898",
    "forbidden_zone_info":[
       
    ],
    "forbidden_mop_zone_x":[
       
    ],
    "forbidden_mop_zone_y":[
       
    ],
    "room_info":{
       "0":{
          "room_name":"Kitchen"
       },
       "3":{
          "room_name":"Lounge"
       },
       "4":{
          "room_name":"Bedroom"
       },
       "7":{
          "room_name":"Hallway"
       },
       "8":{
          "room_name":"Bathroom"
       }
    }
 }

And here’s the resulting image:

tmpx45879i7

4 Likes

Hi, nice work, I was just digging to samer direction as well, made about half way but as you did more already, just awsome.
Meanwhile, seems currently weback mamibot vacuums have trouble of getting map and location info at all:

can share status BEFORE error:

{
   "notify_info":"thing_status_update",
   "thing_status":{
      "connected":"true",
      "working_status":"ChargeDone",
      "voice_switch":"on",
      "volume":19,
      "voice_pack":"default",
      "carpet_pressurization":false,
      "undisturb_mode":"off",
      "fan_status":"Strong",
      "water_level":"None",
      "error_info":"NoError",
      "yugong_debug_version":"0.3.3.1",
      "yugong_software_version":"0.3.3",
      "vendor_software_version":"2.2.3",
      "vendor_firmware_version":"2.2.0",
      "vendor_system_version":"2.0.1",
      "vendor_vupdate_version":"2.1.0",
      "current_status_percentage":0,
      "Voicebox_Source":"null",
      "battery_level":100,
      "continue_clean":false,
      "offset_hours":2,
      "offset_minutes":0,
      "clean_area":2.450000047683716,
      "clean_time":77,
      "save_map":"off",
      "upgrade_logic":"1.0",
      "hardware_platform":"5002-1004",
      "extend_function_flag":3,
      "laser_wall_line_x":"None",
      "laser_wall_line_y":"None",
      "mop_forbidden_zone_x":"None",
      "mop_forbidden_zone_y":"None",
      "forbidden_zone_x":[
         169,
         169,
         223,
         223
      ],
      "forbidden_zone_y":[
         45,
         78,
         78,
         45
      ],
      "planning_rect_x":[
         
      ],
      "planning_rect_y":[
         
      ],
      "goto_point":"None",
      "laser_goto_path_x":"None",
      "laser_goto_path_y":"None",
      "forbidden_zone_point_num":4
   },
   "thing_name":"exvac-880-00-e9-3a-06-7d-59"
}

and AFTER error:

{
   "notify_info":"thing_status_update",
   "thing_status":{
      "Voicebox_Source":"null",
      "battery_level":87,
      "carpet_pressurization":false,
      "clean_area":6.440000057220459,
      "clean_time":912,
      "connected":"true",
      "continue_clean":false,
      "current_status_percentage":0,
      "error_info":"CannotFindCharger",
      "extend_function_flag":3,
      "fan_status":"None",
      "hardware_platform":"5002-1004",
      "offset_hours":2,
      "offset_minutes":0,
      "save_map":"off",
      "undisturb_mode":"off",
      "upgrade_logic":"1.0",
      "vendor_firmware_version":"2.2.0",
      "vendor_software_version":"2.2.3",
      "vendor_system_version":"2.0.1",
      "vendor_vupdate_version":"2.1.0",
      "voice_pack":"default",
      "voice_switch":"on",
      "volume":19,
      "water_level":"High",
      "working_status":"Malfunction",
      "yugong_debug_version":"0.3.3.1",
      "yugong_software_version":"0.3.3"
   },
   "thing_name":"exvac-880-00-e9-3a-06-7d-59"
}

Map data is not taken as well:
currently no incoming map_data
before it was:

2022-11-08 13:18:00.608 DEBUG (Thread-341 (run_forever)) [custom_components.weback_vacuum.WebackApi] WebackApi (WSS) Msg received {'notify_info': 'map_data', 'map_data': 'some_big_map_raw_data_here', 'thing_name': 'exvac-880-00-e9-3a-06-7d-59'}

will keep an eye on this thread and the error thread linked.

Hi Kenno,

Very interesting - your data is quite different to mine. I wonder if this is something to do with it:

Have you tried pushing "save_map": "on"?

There is an alternative MQTT topic (not AWS IoT Core), that the vacuum device is subscribed to. I’m now pushing sync_thing opts to this channel (grit_tech/notify/server_2_device/<thing name>)

You can update WebackWssCtrl::update_status in WebackApi.py in @Jezza34000’s component to the following to get map_data packets back. I assume they made this change to both reduce latency bandwidth utilisation on their infrastructure.

async def update_status(self, thing_name, sub_type):
        """
        Request to update robot status
        """
        _LOGGER.debug(f"WebackApi (WSS) update_status {thing_name}")
        payload = {
            "topic_name": "grit_tech/notify/server_2_device/" + thing_name,
            "opt": "sync_thing",
            "sub_type": sub_type,
            "topic_payload": {
                "notify_info": "sync_thing",
                "cmd_timestamp_s": int(time.time())
            },
            "thing_name": thing_name,
        }
        await self.publish_wss(payload)

I’ve made progress with paths, rooms, and have managed to integrate with the GitHub - PiotrMachowski/lovelace-xiaomi-vacuum-map-card: This card provides a user-friendly way to fully control map-based vacuums in Home Assistant. Supported brands include Xiaomi (Roborock/Viomi/Dreame/Roidmi/Valetudo/Valetudo RE), Neato, Wyze, Roomba, Ecovacs (and probably more). card. I’ll update this thread when I have something in beta state.

Here’s a preview (path is in blue, not really visible, but see bottom left room on map:

2 Likes

Not yet. When I have more time, I can play around a bit, currently changed update_status to grit_tech/notify/server_2_device as You suggested: nothing changed, but did not modify any calls as well, so expected behavior here.
Currently main problem with default save_map: off is with weback mamibot issue. Weback App does not show lidar map as well at the moment. Waiting update from Weback in that issue.

Great, please let us know when you have an update. I had map issues a few weeks back that I guess were cloud related.

Also: The patch I suggested will not do anything except show WebackApi (WSS) MAP data received in the logs if a map_data message is received and logging is enabled.

Yes, I understood that.

Will do!

1 Like

Excellent Job with this integration!
Now I can control my PHCLEANBOT-VTEC PHOENIX using home assistant.

Also I would like to ask if could be possible to know the area cleaned in meters?

Thanks again!

1 Like

Hello,
Yes you can found it in attributes.
You got many information about robot

1 Like

Hello @Jezza34000,

Thanks for your reply. I dont get many attributes for my robot and the clean time is not increased every time I use the vacuum.
Here are some images of the attributes I get for my vacuum:

robot1

I would appreciate the running time and area cleaned in meters.
This could be possible because it’s an old account?

thanks again!

A rough fork supporting maps is available at GitHub - talss89/homeassistant_weback_component at map-support

It’s only tested on the Electriq iQlean-LR01. Testing and feedback would be appreciated, and then hopefully get this merged into the main repo once it’s stable.

1 Like

Thank you @talss89 for your amazing work !
I merged you work :+1:

1 Like

Thanks. I’ve just raised another PR with some fixes and features - goto point and rectangle cleaning is now supported, and other performance enhancements.

on my side, map version gives

3-01-23 16:56:41.696 INFO (MainThread) [custom_components.weback_vacuum] Found robot : exvac-880-00-e9-3a-06-7d-59 nickname : Charlie
2023-01-23 16:56:41.697 DEBUG (MainThread) [custom_components.weback_vacuum.VacDevice] WebackApi RobotController __init__
2023-01-23 16:56:41.697 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi __init__
2023-01-23 16:56:41.697 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi WSS Control __init__
2023-01-23 16:56:41.701 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi checking token validity : 2023-01-24 16:52:30.344470
2023-01-23 16:56:41.702 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi token is valid
2023-01-23 16:56:41.702 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi use cached creds.
2023-01-23 16:56:41.702 ERROR (MainThread) [homeassistant.setup] Error during setup of component weback_vacuum
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component
result = await task
File "/config/custom_components/weback_vacuum/__init__.py", line 90, in async_setup
await vacuum_device.load_maps()
File "/config/custom_components/weback_vacuum/VacDevice.py", line 39, in load_maps
map_data = await self.get_reuse_map_by_id(self.robot_status["hismap_id"], self.sub_type, self.name)
KeyError: 'hismap_id'

Hmm… looks like hismap_id is specific to certain models of vacuum…

@kenno - Did you get your device working normally in the end? Are you receiving map_data messages?

We need to find a way to obtain the current active map ID for your device.

What output do you get from calling the REST API opt - history_map_list_get and reuse_map_list_get?

Raised issue #11 to track this. Not all devices return `hismap_id` · Issue #11 · Jezza34000/homeassistant_weback_component · GitHub

Version without map addon works.
Weback Mamibot have not fixed missing map issue for weback app as well, so maybe this is one possible reason. Need to try to call api manually to see what data moves between. But maybe add empty map if no data available to have more universal solution.

Also have an error with the new version when starting the integration:

Error during setup of component weback_vacuum

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/config/custom_components/weback_vacuum/__init__.py", line 90, in async_setup
    await vacuum_device.load_maps()
  File "/config/custom_components/weback_vacuum/VacDevice.py", line 39, in load_maps
    map_data = await self.get_reuse_map_by_id(self.robot_status["hismap_id"], self.sub_type, self.name)
KeyError: 'hismap_id'

Thanks, I’ll try to push a fix that at least allows the component to run without a map later today.

@kingisch - What model of vacuum do you have?

Also, do you have a saved map in the Weback app? (Map Management → Save / Use) I wonder if this is a factor.

@kingisch @kenno The map-support branch at GitHub - talss89/homeassistant_weback_component at map-support now has a patch for this. Let me know if it works for you - component now falls back to basic maps (no room names), then no maps at all.

1 Like