On my Redmi K80 (HyperOS), the Automate process is often killed by the system, and it fails to capture BOOT_COMPLETED or any restart signals. This causes my step counter logic to break because:
The device resets now_steps to 0 after reboot.
My flow loses its last_steps variable because it's stored in RAM.
When it finally resumes (after I manually tap the icon), the comparison now_steps >= last_steps fails or errors out.
How can I reliably handle this without a working "Restart" broadcast?
Should I use Atomic Store to save last_steps to disk every few minutes?
How to write a robust expression that detects a 0-reset and recalibrates without manual intervention?
Thanks!