Helper "Combine" yaml config

Dear community,

currently I´m struggling with a sensor to combine multiple input sensors. Until now I was working with template sensors.

Now I´ve found the great and functional helper “combine” via the helpers tab in the webuis config parts.

As I really love the feature of packaging stuff together via a package.yaml I´m asking myself, if this helper can bin configured via yaml.

Thanks and regards

Jakob

Thanks, @Didgeridrew!

Unfortunately the sensor seems to be unable to cover “input signal unknown”.
If one of the aggregated sensors is unknown the result is “unknown”.

With a template sensor I can cover this:

template:

  • sensor:
    • name: bpvinverter_generated_energy
      unique_id: bpvinverter_generated_energy
      icon: mdi:transmission-tower
      state_class: total_increasing
      unit_of_measurement: kWh
      device_class: energy
      state: >
      {% if is_number(states(‘sensor.bpvinverter1_generated_energy_total’)) and states(‘sensor.bpvinverter2_generated_energy’) | float(0) >= 0 %}
      {{ ( states(‘sensor.bpvinverter1_generated_energy_total’)|float(0) + states(‘sensor.bpvinverter2_generated_energy’)|float(0) )|round(0)|int(0) }}
      {% else %}
      {{ ( states(‘sensor.bpvinverter1_generated_energy_total’)|float(0) + states(‘sensor.bpvinverter2_generated_energy’)|float(0) )|round(0)|int(0) }}
      {% endif %}

Am I wrong somewhere?

Thanks and regards

Jakob

You can use if else endif in the UI