Averaging sensor values

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;

| reject ('in',['unavailable','unknown','none'])



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?

try this

  - platform: min_max
    name: Den Office Average
    type: mean
      - sensor.den_temperature
      - sensor.office_temperature
1 Like

Stephan’s suggestion is a good one and one I use too, but to fix your template (as an educational opportunity), put map('float') after the reject.

1 Like

Thanks both.
I learned something new today@ 3am :slight_smile:

1 Like