adrigzr / badconga

Deprecated plugin for Home Assistant for Cecotec Conga Vacuums.
27 stars 4 forks source link

better error handling and map behaviour, more robot info #24

Open zzarne opened 2 years ago

adrigzr commented 2 years ago

Hi @zzarne, thanks for the changes. Is this ready to be merged?

zzarne commented 2 years ago

Well while I think that my pull request is fine (I could merge it myself, btw), I'm seeing the strangest of things in my logs and I wanted to get to the bottom of this before merging. The device status is fine for hours. Then it begins to alternate between

2021-09-20 11:10:51 DEBUG (Thread-100125) [custom_components.badconga.app.client] [SMSG_DEVICE_STATUS] {'mapHeadId': 1631806440, 'areaCleanFlag': 1, 'workMode': 0, 'battery': 200, 'chargeStatus': True, 'type': 3, 'faultCode': 2105, 'cleanPreference': 1, 'repeatClean': 0, 'cleanTime': 0, 'cleanSize': 0, 'waterLevel': 11, 'dustBoxType': 1, 'mopType': False}
2021-09-20 11:10:56 DEBUG (Thread-100127) [custom_components.badconga.app.client] [SMSG_DEVICE_STATUS] {'mapHeadId': 1581865008, 'areaCleanFlag': 1, 'workMode': 0, 'battery': 139, 'chargeStatus': False, 'type': 0, 'faultCode': 0, 'cleanPreference': 3, 'repeatClean': 0, 'cleanTime': 0, 'cleanSize': 0, 'waterLevel': 12, 'dustBoxType': 3, 'mopType': False}
2021-09-20 11:10:57 DEBUG (Thread-100129) [custom_components.badconga.app.client] [SMSG_DEVICE_STATUS] {'mapHeadId': 1631806440, 'areaCleanFlag': 1, 'workMode': 0, 'battery': 200, 'chargeStatus': True, 'type': 3, 'faultCode': 2105, 'cleanPreference': 1, 'repeatClean': 0, 'cleanTime': 0, 'cleanSize': 0, 'waterLevel': 11, 'dustBoxType': 1, 'mopType': False}

and so on for hours. Note how the mapHeadId changes, as well as chargeStatus/battery. The latter leads to the homeassistant entity to change it's state every few seconds. With this mapHeadId being a timestamp, note that the lower one is before I bought my robot. My conclusion is that the server mixes reports from different robots belonging to different people. I haven't seen other people's maps yet, but I wouldn't be surprised. I should probably report this as a security or privacy issue, but I wouldn't know how and where.

While already being off-topic: how's the Valetudo integration coming along? When I last tried it last november, I had to hack it a bit for my 5090, had minor stability issues and preferred the simplicity of badconga's map integration into homeassistant.

adrigzr commented 2 years ago

Hi @zzarne, I wouldn't be surprised if you were getting reports of other people. Never seen anything like that before.

We're almost done with Valetudo's integration. Check it out. It is pretty straight forward to configure.

zzarne commented 2 years ago

My robot was fine for a few months. When I was about to merge these changes, it started acting up again. mapHeadId and cleanPreference were toggling again, CMSG_PING not being answered and so on. A reboot of the robot fixed it, so next time I checked the free memory and indeed, the RobotApp was leaking memory until none was left. The robot was still being able to start cleaning, but stopped after a minute or so. I looked around a bit and found typos in the logs, ini-files, method name and so on. It's amazing that these robots work at all.

Now I think that it's not other people's reports I was seeing, but just half-dead processes zombieing around. Apart from a reboot killall Monitor RobotApp everest-server AuxCtrl log-server ; /etc/init.d/robotManager start fixes this. Sadly I know of no way of rebooting it via this integration.

Since many of the changes in this pull request work around robot issues that can not be mitigated by us, I'll remove those changes as they only mask the real issue. If I find a way to reliably detect the issue I'll implement an attribute which tells the user to reboot the robot.