I am trying to get an average value for a set of temperature sensors, and would like to avoid 'unavailable; or 'unknown; kind of values if any of my sensors goes out;
{{
[states('sensor.den_temperature'),
states('sensor.office_temperature')]
| reject ('in',['unavailable','unknown','none'])
|average(0)
}}
Above code outputs value of zero. This is fixed by suffixing each of the inputs with | float.
But, then no longer works if any of the sensors becomes unavailable.
What am I doing wrong?