...
When replacing a battery (or even placing the same battery again), wait for at least 3h between removal and replacement of the battery to make sure that there is no left-over "power" inside the batterysensor.
Make sure that hubs are live when performing this action, so that the sensor (that has just found power again) can easily connect to the hub without depletion of the battery.
...