Try this:
template:
- sensor:
- name: "total_grid-eskom"
unit_of_measurement: "A"
device_class: current
state: >
{{ [ states('sensor.meter_grid_main_strom_der_phase_a'),
states('sensor.meter_grid_battery_strom_der_phase_a') ]
| map('float',default=0) | sum }}
availability: >
{{ has_value('sensor.meter_grid_main_strom_der_phase_a') and
has_value('sensor.meter_grid_battery_strom_der_phase_a') }}
- name: "Current Power Usage"
unit_of_measurement: "W"
device_class: power
state: "{{ states('sensor.meter_grid_main_phase_a_leistung')|float(0) * 1000 }}"
availability: "{{ has_value('sensor.meter_grid_main_phase_a_leistung') }}"