MQTT Battery Sensor

Hi,

I have set up Owntracks on my Android phone ans also set up a sensor for my battery using this: https://www.home-assistant.io/cookbook/track_battery_level/

I noticed that the battery values comes through and updates but if somehow the phone is not connected the battery value disappear (I see ’ %’ instead)

Is there a way I could have HA retain the value until it’s updated again? Surely, we don’t need my phone to have an active socket connection to be able to disaply that value

Any help would be appreciated.

Thanks

Hi did you find a way to do this?