Template warning - Float 'unavailable' - no default

While evaluating the template, the sensor's value was unavailable

states.sensor.tvattmaskin_energi.state | float

The float filter cannot convert unavailable to a number.

When this happened in previous versions of Home Assistant, float would simply convert unavailable to 0 and say nothing. However, now it tells you that this incident occurred and warns you that you should provide float with a default value (you decide what that value should be).

If you want float to use 0 as a default value, just specify it like this everywhere you use it in your templates:

float(0)

For example:

        value_template:  >
          {% if states.sensor.tvattmaskin_energi.state | float(0) > 3.0 %}
            {{ "Running" }}
          {% elif states.sensor.tvattmaskin_energi.state | float(0) > 1 %}
            {{ "On" }}
          {% else %}
            {{ "Off" }}
          {% endif %}

For more information, refer to: