It looks like this sensor doesn’t automatically save to flash.
restore (Optional, boolean): Whether to store the intermediate result on the device so that the value can be restored upon power cycle or reboot. Warning: this option can wear out your flash. Defaults to false.
I will guess that your device is “randomly” resetting and that is causing the value to reset. Logs will tell you if there is a correlation with reset of the sensor and device restart.