krbaker / hass-sunpower

Home Assistant SunPower Integration using the local installer ethernet interface.
Apache License 2.0
49 stars 22 forks source link

Where is the data of home consumption and solar pushing production to home/grid? #54

Closed julio8a closed 6 months ago

julio8a commented 6 months ago

Here are my two meters and one inverter:

{
            "ISDETAIL": true,
            "SERIAL":   "PVS5M702297p",
            "TYPE": "PVS5-METER-P",
            "STATE":    "working",
            "STATEDESCR":   "Working",
            "MODEL":    "PVS5M0400p",
            "DESCR":    "Power Meter PVS5M702297p",
            "DEVICE_TYPE":  "Power Meter",
            "SWVER":    "17",
            "PORT": "",
            "DATATIME": "2023,10,25,19,10,01",
            "ct_scl_fctr":  "50",
            "net_ltea_3phsum_kwh":  "0.03",
            "p_3phsum_kw":  "0",
            "q_3phsum_kvar":    "0.0002",
            "s_3phsum_kva": "0.0034",
            "tot_pf_rto":   "0",
            "freq_hz":  "60",
            "CAL0": "50",
            "origin":   "data_logger",
            "OPERATION":    "noop",
            "CURTIME":  "2023,10,25,19,10,06"
        }, {
            "ISDETAIL": true,
            "SERIAL":   "PVS5M702297c",
            "TYPE": "PVS5-METER-C",
            "STATE":    "working",
            "STATEDESCR":   "Working",
            "MODEL":    "PVS5M0400c",
            "DESCR":    "Power Meter PVS5M702297c",
            "DEVICE_TYPE":  "Power Meter",
            "SWVER":    "17",
            "PORT": "",
            "DATATIME": "2023,10,25,19,10,01",
            "ct_scl_fctr":  "100",
            "net_ltea_3phsum_kwh":  "-6766.11",
            "p_3phsum_kw":  "-0.9063",
            "q_3phsum_kvar":    "-0.2761",
            "s_3phsum_kva": "1.0512",
            "tot_pf_rto":   "-0.8747",
            "freq_hz":  "60",
            "CAL0": "100",
            "origin":   "data_logger",
            "OPERATION":    "noop",
            "CURTIME":  "2023,10,25,19,10,06"
        }, {
            "ISDETAIL": true,
            "SERIAL":   "450051912002128",
            "TYPE": "SOLARBRIDGE",
            "STATE":    "working",
            "STATEDESCR":   "Working",
            "MODEL":    "AC_Module_Type_D",
            "DESCR":    "Inverter 450051912002128",
            "DEVICE_TYPE":  "Inverter",
            "SWVER":    "1078804428",
            "PORT": "",
            "MOD_SN":   "P23M20781484",
            "NMPLT_SKU":    "",
            "DATATIME": "2023,10,25,19,08,16",
            "ltea_3phsum_kwh":  "2494.6615",
            "p_3phsum_kw":  "0.0935",
            "vln_3phavg_v": "246.72",
            "i_3phsum_a":   "0.39",
            "p_mpptsum_kw": "0.097",
            "v_mppt1_v":    "56.27",
            "i_mppt1_a":    "1.85",
            "t_htsnk_degc": "36.55",
            "freq_hz":  "60.02",
            "stat_ind": "0",
            "origin":   "data_logger",
            "OPERATION":    "noop",
            "CURTIME":  "2023,10,25,19,10,06"
        }

My Energy Distribution always shows solar pushing to Grid and Grid to home, which is incorrect. image

Here are the available sensors for consumption: image

I'm assuming there is no clamp to monitor production since the meter for production shows zero.

What I did was just add up the lifetime_power for each inverter and added it to a template to provide to the energy dashboard, which works:

template:
  - sensor:
    - name: "solar_production"
      unit_of_measurement: 'kWh'
      state: >
        {{ states("sensor.solar_production_lifetime_power") | float }}     
      device_class: energy
      state_class: total

But I'm not seeing values for "KWH to home" or "HWH to Grid" like the README describes: image

This is what my energy dashboard config looks like: image Consumption = consumption_lifetime_power solar_production = sum or lifetime_power of all inverters

Some help or guidance would be greatly appreciated. Thank you!

julio8a commented 6 months ago

I figured it out.

Since my consumption lifetime value is pretty much the grid consumption (mine is negative because I've contributed more to the grid than consumed), I just created this entity to get home consumption: solar_production_lifetime + grid_usage_lifetime (This is the lifetime meter from consumption) = home_consumption entity