Configuration of sensor


I am trying to configure a sensor that shall show the heat exchange efficiency calculated from 3 other sensors in my HVAC system.

Cant quite figure out what to do. I have posted device class as humidity due to that also beein presented as %.

Can anyone help, thanks :slight_smile:


  • sensor:
    • name: “heat exchange efficiency”
      unit_of_measurement: “%”
      state: >
      {% set outdoor = states(‘sensor.outdoor_temperature’) | float %}
      {% set inlet = states(‘sensor.inlet_temperature’) | float %}
      {% set exhaust = states(‘sensor.exhaust_temperature’) | float %}

      {{ ((inlet + outdoor) / (exhaust + outdoor)) | round(1, default=0) }}

When setting up a Template helper, only the state template goes in the “State template” field. That field cannot understand all the YAML configuration you have included as anything but strings and sensors with a defined unit of measurement must return a numeric value.

Remove everything from template: to state: >.

Thanks, that sure did help :slight_smile: