Template help?

Not sure why it’s complaining.

{{ states ((‘sensor.grid_consumption’) | float) / 10 | round }}’ but no default was specified. Currently ‘float’ will return ‘0’, however this template will fail to render in Home Assistant core 2022.1

Read the release notes for 2021.10.

Will do, thanks.
Found it.

In Home Assistant Core 2021.12 the template will fail to render if no default value is specified. You can specify a default value by passing to the filter like this: {{ "abc" | float(default=0) }} .

You can also specify |float(0) as it only takes one argument. See here for more:

1 Like