Shelly EM - Power Factor - Current - Calculations

Hi everybody,

I was needed to find a solution for calculating two entities not provided by Shelly EM from API or MQTT directly, like the power factor and the current
I searched for long time inside the community but didn’t find anything what I really needed

So looking on the web and something here, I built this yaml configuration, hoping now to help somebody, like me some hours ago!

Active power and Voltage come from Shelly Integration (or MQTT if you prefer), Reactive power come from MQTT (API not provide this)

  - platform: template
    # Calcolo Cosfi a partire da potenza attiva P e reattiva Q
    sensors:
      pci_cosfi:
        friendly_name: "PCI CosFi"
        value_template: '{{ (cos(atan(states("sensor.pci_potenza_reattiva")|float / states("sensor.pci_power")|float)))|float|round(3) }}'
        unit_of_measurement: "CosFi"
#       icon: hass:cosine-wave

  - platform: template
    # Calcolo Corrente a partire da potenza attiva P, Tensione e CosFi
    sensors:
      pci_corrente:
      # EM01 - Canale 2
        friendly_name: "PCI Corrente"
        value_template: '{{ ((states("sensor.pci_power")|float) / ((states("sensor.pci_voltage")|float)*(states("sensor.pci_cosfi")|float)))|float|round(3) }}'
        unit_of_measurement: "A"
#       icon: hass:current-ac

Here is the result…It’s all in italian, but hope you understand…Bye!

PCI

1 Like

Hi Gio,

Thanks for this, it is intersting. I also have a Shelly EM. Could you explain me what usage do yo do with the Reactive Power or the power factor ? Do you use it to detect if certain equipment is on ?

Thanks,

Hi boug,

glad to see your interest!
I use these values to control my home electrical power distribution, just to watch consumptions and see if some devices introduce a lot of reactive load that is not really fine. The PF parameter still to be close to one, but for example I saw that my UPSs contributes to decrease it…just an evaluation…

In the screenshot I supervised my induction hob

You can find a lot of info about power active/reactive and PF on the web