Average between sensors helper

A dedicated helper to calculate an average between sensor entities (counting only those with valid state) would be a nice to have. Today it seems the only way is to use template sensor, something like:

{% set a = ['sensor.outside_front_climate_temperature', 'sensor.outside_rear_climate_temperature'] 
  | select('has_value') | map('states')
  | map('float', 0) | average(none) %}
{{ a if a is not none else states('sensor.nws_temperature') }}

Don’t forget to vote for your own FR - it doesn’t happen automatically.

1 Like

This is available in the Helpers as “Combine the States of Several Sensors”… “arithmetic mean” is one of the options.

2 Likes

I understand why the OP did not find that, since there are no mentioning of that feature for that integration.
Min/Max might have been what it started out as, but what it has now transformed into makes the name kind of misleading.

A “feature request” to rename that integration would be in order, but I have no good suggestion to what the name should be. “Number helpers” or “Math helpers” is my best bets.

2 Likes