Calculating sensor for power (V x A)

Hi,
I am trying to have a sensor which shows Power/Watt by calculating my current power for the Tesla Wallbox out of Voltage and Ampere. Unfortunately my config doesn’t work (shows value not available) . Where’s my error?

- sensor:
    - name: "Wallbox_Watt"
      unique_id: Wallbox_Watt
      state: >-
        {{ (states(('sensor.tesla_wall_connector_phase_a_voltage')|float(0) * ('sensor.tesla_wall_connector_phase_a_current')|float(0)) + 
            states(('sensor.tesla_wall_connector_phase_b_voltage')|float(0) * ('sensor.tesla_wall_connector_phase_b_current')|float(0)) + 
            states(('sensor.tesla_wall_connector_phase_c_voltage')|float(0)) * ('sensor.tesla_wall_connector_phase_c_current')|float(0)) }}
      unit_of_measurement: W
      device_class: power
      state_class: measurement

Thx for your help!

{{ (states('sensor.tesla_wall_connector_phase_a_voltage')|float(0) * states('sensor.tesla_wall_connector_phase_a_current')|float(0)) + 
   (states('sensor.tesla_wall_connector_phase_b_voltage')|float(0) * states('sensor.tesla_wall_connector_phase_b_current')|float(0)) + 
   (states('sensor.tesla_wall_connector_phase_c_voltage')|float(0) * states('sensor.tesla_wall_connector_phase_c_current')|float(0)) }}

this works, thank you! :slight_smile:
that was a dumb error :crazy_face:

1 Like

Thank you for posting this!

I ended up using this to calculate the current consumption from this device, but I believe it’s incorrect as reported for my device. When my vehicle was charging, it was showing 14.x kW, but this device on a 60 amp circuit is only supposed to have an output of 11.5 kW. I ended up removing phase C from the calculation and it looks correct on my end.

Does this seem right? Or is it regional specific? I’m located in the US.

When calculating in a 3-phase system you should use the phase voltage, and not the line voltage.
V(p) = V(L) / sqrt(3).

Without excluding any phase, try to divide your total power by 1.73205080757 and you should have the right value, otherwise I will have to go back to the old books (or look for an electricity expert).

No, it’s the same regardless the line frequency or voltage, as soon you are in an AC circuit.