First check when it's started, then maintain status as active as long as the machine haven't been idle for too long. The time will have to be tested for sure, maybe just report all of it via MQTT to start with, and then it's possible to see how long it's idle in Home assistant to see what the longest time is.
So for example if there is a point where it's idle (meaning vibrations is close to zero) for 5 minutes at the most, modify the code to not report washing done until 6 or 7 minutes have passed. It means we will have 6 or 7 minute lag for knowing it's done, but that's better than false positives. And probably it's never idle for that long.
First check when it's started, then maintain status as active as long as the machine haven't been idle for too long. The time will have to be tested for sure, maybe just report all of it via MQTT to start with, and then it's possible to see how long it's idle in Home assistant to see what the longest time is.
So for example if there is a point where it's idle (meaning vibrations is close to zero) for 5 minutes at the most, modify the code to not report washing done until 6 or 7 minutes have passed. It means we will have 6 or 7 minute lag for knowing it's done, but that's better than false positives. And probably it's never idle for that long.