I have a watersoftener which reports the weight of the unit but only every few hours. The template is configured as:
- platform: template
sensors:
softner_weight:
friendly_name: "Softner Weight"
unit_of_measurement: 'Percentage'
value_template: "{{ states('sensor.water_softner_weight') | float * 10000 | float(0)}}"
But every time I start HA, I get the error below. I thought I added the default by adding: | float(0) - but that doesn’t seem to work. Could anyone suggest how I fix this?
TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ states('sensor.water_softner_weight') | float * 10000 | float(0)}}' but no default was specified') while processing template 'Template<template=({{ states('sensor.water_softner_weight') | float * 10000 | float(0)}}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.softner_weight'