Pedometer data mess after hidden reboot on

28 views
Skip to first unread message

Vale Lane

unread,
Mar 18, 2026, 9:28:43 AM (6 days ago) Mar 18
to automa...@googlegroups.com
​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!

Henrik "The Developer" Lindqvist

unread,
Mar 18, 2026, 11:03:24 AM (6 days ago) Mar 18
to Automate for Android
Ensure the "run on system startup" option is enabled.
Variable values are always stored on disk, using Atomic is only necessary for variables that's accessed concurrently by multiple fiber, and for values that should persist between flow restarts.
As the documentation say, "'Hardware reset' is usually a device reboot but could also be due to the sensor hardware having been turned off, so when using proceed Immediately expect that the steps taken output may reset to zero, or any other value, at any time.
There's no accurate way to overcome this problem, if there were i'd implemented in the block. Try 
  • on BOOT_COMPLETED the hardware has surely reset, so you should reset your internal counter as well
  • if the steps taken output is less that then its prior value then the hardware has reset
  • use a shorter period between each block so the "lost" steps take count due a reset will be less, less accuracy loss

мJ ZЖУ

unread,
Mar 20, 2026, 9:56:09 AM (4 days ago) Mar 20
to Automate for Android
There is Health connect app purpose is to keep step count even while offline I think it already by design for step counter to reset to zero on restart. 
Reply all
Reply to author
Forward
0 new messages