Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106441

Templating: Arithmetic mean under a condition

$
0
0

Hi!

I do calculate a value based on 3 frequencies:

  - platform: template
    sensors:
          netzfrequenz_mittelwert:
             friendly_name: "Mittelwert der Netzfrequenz"
             unit_of_measurement: "Hz"
             value_template: '{{ ((states("sensor.wr_links_freq") | float + states("sensor.wr_mitte_freq") | float + states("sensor.wr_rechts_freq") | float ) | float / 3) | round(3) }}'

This works fine, as long as all values are meaningful. Unluckily those values come from solar inverters wich are offline during the night. So I would like to “tune” this formula to use only values >40 and if none of the 3 inverters return a value >40 to use another sensor as source (sensor.l1_frequenz).

Could you please help me to achive this?

Best

Pascal

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>