For me, @Jezza34000 code works with secondary account. Will verify with latest changes at some point.
When you said āsecondary accountā are you telling you are using 2 accounts with same robot (with share option) ?
Or 2 accounts with 2 robots ?
Yes, created second account and shared the robot there from main.
Ok i made new try and i can really catch what the problemā¦
I notice issue when using sharing account option, but i can determinate really when it cause trouble or notā¦
Can confirm, latest build does not work with shared account, robot is detected and status read, but it cannot connect WSS, so result is, controlling the robot is not working.
When I use main, all works (tested only few commands)!
OK then delete shared account
Weback/Tesvor component is now HACS compatible.
Please remove manual installation. And reinstall using HACS (better for next updates in component)
Will using main account now work alongside with app?
Delete share option, and yes
Iām still having the same error setting up the integration, even after deleting secondary accounts. The only way that I managed to make it work was starting a clean and then restarting home assistant. Apparently, my vacuum doesnāt setup if itās idle.
I donāt know what happen with your robotā¦
Messages coming from server are not usable, many information are missing (when idle)
Maybe try to delete and recreate a new account and register again your robot. I was expericing problem when WeBack done his API migrationā¦
That is my last idea i can give you !
Deleted all shares, using main only, vacuum is functioning. But logs in warning mode is full of websocket warnings and sometimes those turn into errors. Is websocket warning spam expected behavior here?
Can you give me log ?
@Jezza34000 just as a update, your integration is working really well, no disconnections so far.
The only problem is that I canāt restart my home assistant if my robot is idle for a while, just as I said before.
Is it possible for you to make a patch that makes HA, at least setup, ignore the errors that I was having (as shown on my previous log)?
Sorry to bother and keep posting this, but that is really the only problem that Iām having with your great integration.
Thanks a lot!
Sorry, I have the integration disabled currently and did not have time to debug it, hopefully will have the log for you in the following days.
@Jezza34000 I was going to say that it was working fine, but itās not. It worked for about three days, but today I started a clean and the robot got stuck for a while and now itās unavailable.
2022-11-05 11:59:29.394 INFO (MainThread) [custom_components.weback_vacuum] Creating new Weback Vacuum Robot component 2022-11-05 11:59:29.395 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi ] WebackApi__init_
2022-11-05 11:59:29.396 DEBUG (MainThread) [custom_components.weback_vacuum] Weback vacuum robots: login started
2022-11-05 11:59:29.403 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi has no or invalid cached creds, renew it...
2022-11-05 11:59:29.404 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi ] Send HTTP request Url=https://user.grit cloud.com/prod/oauth Params={'json':{'payload': {'opt': 'login', 'pwd': 'aaaaaaaaaaaaaa'}, 'header': {'language': 'en', 'app_name': 'WeBack', 'calling_code': '0055', 'api_version': '1.0', 'account': '[email protected]', 'client_id': 'yugong_app'}}}
I also tried starting a clean manually to see if HA updated, but no success. Shortly after, I restarted HA and, as expected due to starting a clean, it came back.
Ok but you can describe problem. Without log I can do absolutely nothingā¦
The 4 logs lines you gave me donāt show any problem
Sorry, canāt reproduce it right now, that was the only thing that I grabbed before.
Anyway, more logs afteÅ updating to the latest version (1.0.4) failing setup if the robot is idle (for a while on the charger):
2022-11-07 15:38:44.546 INFO (MainThread) [custom_components.weback_vacuum] Creating new Weback Vacuum Robot component
2022-11-07 15:38:44.546 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi __init__
2022-11-07 15:38:44.547 DEBUG (MainThread) [custom_components.weback_vacuum] Weback vacuum robots: login started
2022-11-07 15:38:44.550 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi has no or invalid cached creds, renew it...
2022-11-07 15:38:44.551 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] Send HTTP request Url=https://user.grit-cloud.com/prod/oauth Params={'json': {'payload': {'opt': 'login', 'pwd': 'redacted_pwd'}, 'header': {'language': 'en', 'app_name': 'WeBack', 'calling_code': '0055', 'api_version': '1.0', 'account': '[email protected]', 'client_id': 'yugong_app'}}}
2022-11-07 15:39:01.529 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi : Send HTTP OK, return=200
2022-11-07 15:39:01.530 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi : HTTP data received = {'msg': 'success', 'code': 1, 'data': {'jwt_token': 'redacted_token', 'expired_time': 86400, 'api_url': 'https://user.grit-cloud.com/prod/api', 'wss_url': 'wss://user.grit-cloud.com/prod/wss', 'region_name': 'us-east-1'}}
2022-11-07 15:39:01.715 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi login successful
2022-11-07 15:39:01.717 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi failed to saved new creds
2022-11-07 15:39:01.718 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi ask : robot list
2022-11-07 15:39:01.718 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] Send HTTP request Url=https://user.grit-cloud.com/prod/api Params={'json': {'opt': 'user_thing_list_get'}, 'headers': {'Token': 'redacted_token', 'Region': 'us-east-1'}}
2022-11-07 15:39:07.616 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi : Send HTTP OK, return=200
2022-11-07 15:39:07.617 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi : HTTP data received = {'msg': 'success', 'code': 1, 'data': {'thing_list': [{'sub_type': 'xs-x6', 'create_timestamp': '1667416258122', 'is_admin': True, 'thing_name': 'xs-x6-30-83-98-b6-d5-88', 'thing_nickname': 'Aspirador', 'hardware_version': '0.0', 'batch_num': '0', 'app_name': 'WeBack', 'user_account': '[email protected]', 'mac': '30-83-98-b6-d5-88', 'firmware_version': '2.1.0', 'thing_status': {'connected': 'true', 'upgrade_logic': '1.0', 'extend_function_flag': 1, 'robot_x': None, 'robot_y': None, 'point_num': None, 'clean_time': None, 'config_app': 'WeBack', 'firmware_version': '2.1.0.0420s', 'yugong_software_version': '2.1.0', 'device_2_app_proto_version': '1.2', 'device_2_app_proto_info': {'mapdata_src': 's3', 'mapdata_info': 'vs_yw_1.2', 'direction_ctl': 'user_topic', 'virtual_wall_ctl': 'array'}}, 'brand_icon': 'https://www.grit-cfg.com/device/brand/xs-x6.png'}]}}
2022-11-07 15:39:07.623 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi get robot list OK : [{'sub_type': 'xs-x6', 'create_timestamp': '1667416258122', 'is_admin': True, 'thing_name': 'xs-x6-30-83-98-b6-d5-88', 'thing_nickname': 'Aspirador', 'hardware_version': '0.0', 'batch_num': '0', 'app_name': 'WeBack', 'user_account': '[email protected]', 'mac': '30-83-98-b6-d5-88', 'firmware_version': '2.1.0', 'thing_status': {'connected': 'true', 'upgrade_logic': '1.0', 'extend_function_flag': 1, 'robot_x': None, 'robot_y': None, 'point_num': None, 'clean_time': None, 'config_app': 'WeBack', 'firmware_version': '2.1.0.0420s', 'yugong_software_version': '2.1.0', 'device_2_app_proto_version': '1.2', 'device_2_app_proto_info': {'mapdata_src': 's3', 'mapdata_info': 'vs_yw_1.2', 'direction_ctl': 'user_topic', 'virtual_wall_ctl': 'array'}}, 'brand_icon': 'https://www.grit-cfg.com/device/brand/xs-x6.png'}]
2022-11-07 15:39:07.624 DEBUG (MainThread) [custom_components.weback_vacuum] Weback vacuum robots: [{'sub_type': 'xs-x6', 'create_timestamp': '1667416258122', 'is_admin': True, 'thing_name': 'xs-x6-30-83-98-b6-d5-88', 'thing_nickname': 'Aspirador', 'hardware_version': '0.0', 'batch_num': '0', 'app_name': 'WeBack', 'user_account': '[email protected]', 'mac': '30-83-98-b6-d5-88', 'firmware_version': '2.1.0', 'thing_status': {'connected': 'true', 'upgrade_logic': '1.0', 'extend_function_flag': 1, 'robot_x': None, 'robot_y': None, 'point_num': None, 'clean_time': None, 'config_app': 'WeBack', 'firmware_version': '2.1.0.0420s', 'yugong_software_version': '2.1.0', 'device_2_app_proto_version': '1.2', 'device_2_app_proto_info': {'mapdata_src': 's3', 'mapdata_info': 'vs_yw_1.2', 'direction_ctl': 'user_topic', 'virtual_wall_ctl': 'array'}}, 'brand_icon': 'https://www.grit-cfg.com/device/brand/xs-x6.png'}]
2022-11-07 15:39:07.624 INFO (MainThread) [custom_components.weback_vacuum] Found robot : xs-x6-30-83-98-b6-d5-88 nickname : Aspirador
2022-11-07 15:39:07.625 DEBUG (MainThread) [custom_components.weback_vacuum.VacDevice] WebackApi RobotController __init__
2022-11-07 15:39:07.625 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi WSS Control __init__
2022-11-07 15:39:07.626 DEBUG (MainThread) [custom_components.weback_vacuum] Starting vacuum robot components
2022-11-07 15:39:07.785 DEBUG (MainThread) [custom_components.weback_vacuum.WebackApi] WebackApi (WSS): adding a new subscriber
2022-11-07 15:39:07.792 ERROR (MainThread) [homeassistant.components.vacuum] Error while setting up weback_vacuum platform for vacuum
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/weback_vacuum/vacuum.py", line 58, in async_setup_platform
vacuums.append(WebackVacuumRobot(device))
File "/config/custom_components/weback_vacuum/vacuum.py", line 93, in __init__
self._attr_supported_features = supported_features
UnboundLocalError: local variable 'supported_features' referenced before assignment
@Jezza34000 Thank you for the complement
I have a doubt, I have looked at the plugin code and it only āloginā once.
The token issued by the servers has a duration of one day.
That token is used for http and wss requests.
What happens when the token expires?
I do not see any reconnect process in the code.