Help with value template sensor

No matter what I try, I cannot get this template sensor to load. Any suggestions? Also, what file do I put this in other than customize.yaml? template.yaml or sensor.yaml?

Note that my template statement evaluates perfectly in Dev tools.

template:
  - sensor:
    - name: "Sum of all Battery Current draw"
      value_template: >-
         {{ states('sensor.battery_current') | float + states('sensor.inverter_2_battery_current') | float + states('sensor.inverter_3_battery_current') | float }}
      unit_of_measurement: "A"
      device_class: energy

The new format uses state instead of value_template.
You should supply defaults for your float filters.
You should supply an availability template to prevent erroneous output when any sensor is unavailable.

template:
  - sensor:
    - name: "Sum of all Battery Current draw"
      state: >
        {{ states('sensor.battery_current') | float(0) + states('sensor.inverter_2_battery_current') | float(0) + states('sensor.inverter_3_battery_current') | float(0) }}
      unit_of_measurement: "A"
      device_class: energy
      availability: >
        {{ states('sensor.battery_current') | is_number and states('sensor.inverter_2_battery_current') | is_number and states('sensor.inverter_3_battery_current') | is_number }}
2 Likes

Ok, now THAT makes total sense. THANK YOU!!
I searched and searched but never saw that clue/change.

What file do the template sensors go into?

Jeff

configuration.yaml