Need help debugging ebike: Laggy motor / inconsistent behavior My ebike has been acting weird lately, and I need help figuring out why. It's my daily driver, so I'm hesitant to turn it in for service, as that would probably take at least a month. The bike's one of these. It's built to follow Norwegian/European requirements, which means it has a pedal-assist sensor and a max speed of 25 km/h. It also has e-brakes, meaning the motor is disengaged at the slightest use of the brake handles. Settings are pretty limited with three assistance settings (low, mid, high), in addition to a walk-assist button and the on/off switch. It's mostly stored indoors, both at home and at work. It's only left outside for shorter periods of time when I'm visiting friends and family.

Some observations:


The motor sometimes does not work at all, and only provides assistance in short, inconsistent bursts, completely disregarding set assistance level.
The motor will be always on, disregarding the pedal-assist requirement, just blasting full throttle unless I squeeze the brakes.
The on/off button seems to work fine. As in, when the bike has the battery connected but is switched off, the motor does not engage.
Most of the time, the bike works perfectly.
Possibly coincidental, but the incidents have always happened on/after rainy days.
I first experienced this after leaving the bike unused while on vacation for 3 weeks.
All incidents have occurred on a fully or near fully charged battery.


Hypotheses:


This is somehow related to a wet battery-connection.
Pedal-assist sensor is broken.
Ebrakes are not working properly.


The battery and connector both look fine. I have not yet inspected the wiring or the motor itself. I am grateful for any assistance with how to proceed. Thanks!
The unusual bursts / full blast behavior could be related to your cadence sensor at the bottom bracket. Depending on the type, it could be related to water ingress  / corrosion to the sensing contacts, causing false pedaling to be registered. Also makes sense if it happens around rainy days as water might affect the sensing.

Do you have a throttle you can use to isolate the problem?