swa72 / home-assistant

13 stars 1 forks source link

convert sensor if sensor is unavailable #31

Open swa72 opened 2 years ago

swa72 commented 2 years ago

Template warning: 'float' got invalid input 'unavailable' when rendering template '{{ states('sensor.gasverbrauch')| float + 142.250 }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2021.12

Template warning: 'float' got invalid input 'unknown' when rendering template '{% if states('sensor.smlreadercounter') == 'unavailable' %} {{ states('sensor.smlreadertotaltnergyconsumption') }} {% else %} {{ ((states('sensor.smlreadercounter') | float) * 0.001) }} {% endif %}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2021.12

swa72 commented 2 years ago

https://community.home-assistant.io/t/circular-mean-averaging-angles-in-a-circle/375398/5?u=swa72

Good example ….