Template Sensor - 'Entity not found' for calculation

I’ve created a basic template to handle a tank level offset in my campervan, tracked via a mopeka sensor. The offset is required to consider the water outlet height and therefore the true minimum value.
My code reports the new ‘true’ value fine but when I try to add a percentage string to the value I get “Entity not found” on the dashboard item.
Here is my code.

template:
    - sensor:
        - name: Fresh Water Level Calibrated
          unit_of_measurement: "mm"
          state: >
            {% set fw_level = states('sensor.fresh_water_tank_level') | float(0) %}
            {% set fw_level = fw_level - 70 %}
            {% set fw_level_pc = fw_level / 450 * 100 %}
            {% if fw_level > 0 %} {{ fw_level | int(0) }} ({{ fw_level_pc | int(0) }}%)
            {% else %} empty
            {% endif %}

This works fine in “development tools - template” but not in the dashboard card. Any ideas ?

Did you set a unit of measurement or device class for the sensor?

If so, you need to either edit the template to always return a numeric value or remove the values you have set for unit of measurement and/or device class.

Yes. Sorry, I missed that from the code snippet.
Updated code from my configuration.yaml now shown above.

I’m new to this so working things out as I go.

So I should remove the ‘unit_of_measurement’ bit ?

I just tried removing the unit-of measurement bit and now it works !
Thank you Didgeridrew!