Convert kW tot Watt

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') }}"

THANKS!! You did it.

1 Like

Can I also substract? Just exchanging the “+” by “-” didnt work.
Can these operations done with more than two Values?

      - name: "Meter Grid H1 in Watt"
        unit_of_measurement: "W"
        device_class: power
        state: "{{ states('sensor.meter_grid_main_watt')|float(0) - states('sensor.meter_grid_cottage_watt')|float(0) }}"
        availability: "{{ has_value('sensor.meter_grid_main_watt') }}"

Is there a reference overview for these operations, which you would recommend?

I agree with Tom. My Home Assistant restarts in about 30-seconds, which is how long it would take for me to find the "Template Category:.