rianadon / the-energy-detective-py

Unofficial library for reading from The Energy Detective power meters
0 stars 3 forks source link

TED5000 Power Factor Calculation #7

Closed realumhelp closed 2 years ago

realumhelp commented 2 years ago

While I was digging around for the MTU data I found that the TED5000 LiveData.xml does actually include a PowerFactor value. However, in the official TED5000 documentation does not include this field.

Official Interface API: http://files.theenergydetective.com/docs/TED5000-API-R330.pdf

This is the calculation for PF which matches the values inside of LiveData.xml["LiveData"]["Power"]["MTU[1-4]"]["PF"]

       power_factor = 0.0
       if ap_power != 0:
            power_factor = round(((power_now / ap_power) * 100), 1)

VS.

       power_factor = int(data["Power"]["MTU%d" % mtu.position]["PF"])

Currently the code uses the above calculation, but the value does potentially seem to be available in the XML. Take it or leave it. I just wanted to post this information somewhere.

rianadon commented 2 years ago

Thank you! I will add a link to this in the documentation.