You are correct. Unavailable makes sense.
We need to change it slightly to make sure it gets a first value.
{% set v = (states('sensor.shed_door_control_adc') | float / 5 * 100 ) | int %}
{% set old_v = states('sensor.tank_fill') | int %}
{% if old_v == "unavailable" %}
{{ v }}
{% else %}
{% if ((v-old_v)/v) | abs > 0.1 %}
{{ old_v }}
{% else %}
{{ v }}
{% endif %}
{% endif %}
Pardon the indentation, I’m trying on my phone.
This should make sure it sets the tank fil the first time and then allows 10% changes.
The only issue is that if the first value is a false high value then it will have a hard time getting down to the correct value