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 all of the ESS/inverter/battery/BMS information? #37

Closed mvcl closed 4 weeks ago

mvcl commented 1 year ago

I have a PVS6 and the attached battery box ("ESS"). This software is working great in my HASS setup in every other way that I'm aware. -- In my HASS Energy display, the upper right area shows, "Solar", "Grid", and "Home". There is nothing shown about the battery. I would expect to see the battery represented as a fourth entity with Solar, Grid, and Home. And then also I'd expect to see represented the flows of power into and out of the battery and to see those values tracked and summed in the log and analysis along with the rest.

So why doesn't this battery subsystem have any presence in the Sunpower display in HASS? Is it simply a question of configuration? If so, I must be missing it. TIA

My Device list: from http://10.10.10.123//cgi-bin/dl_cgi?Command=DeviceList

{ "devices": [{ "DETAIL": "detail", "STATE": "working", "STATEDESCR": "Working", "SERIAL": "ZT204685000549A0474", "MODEL": "PV Supervisor PVS6", "HWVER": "6.02", "SWVER": "2022.11, Build 61204", "DEVICE_TYPE": "PVS", "DATATIME": "2022,12,10,21,55,00", "dl_err_count": "0", "dl_comm_err": "420", "dl_skipped_scans": "0", "dl_scan_time": "128", "dl_untransmitted": "63045", "dl_uptime": "356223", "dl_cpu_load": "1.62", "dl_mem_used": "121344", "dl_flash_avail": "98463", "panid": 2591217827, "CURTIME": "2022,12,10,21,59,45" }, { "ISDETAIL": true, "SERIAL": "SY2108850-005505.00448", "TYPE": "HUB+", "STATE": "error", "STATEDESCR": "Error", "MODEL": "SunPower MIDC", "DESCR": "HUB+ SY2108850-005505.00448", "DEVICE_TYPE": "HUB+", "hw_version": "1.5.0", "interface": "ttymxc5", "slave": 220, "SWVER": "0.7.18", "PORT": "P0, Modbus, Slave 220", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,46" }, { "ISDETAIL": true, "SERIAL": "SY2121534552D1805", "TYPE": "EQUINOX-MIO", "STATE": "working", "STATEDESCR": "Working", "MODEL": "SunPower MIO", "DESCR": "ESS Hub SY2121534552D1805", "DEVICE_TYPE": "ESS Hub", "hw_version": "0.4.0", "interface": "ttymxc5", "parent": 11, "slave": 221, "SWVER": "0.7.9", "PORT": "P0, Modbus, Slave 221", "DATATIME": "2022,12,10,21,59,41", "t_degc": "27", "humidity": "26", "v_dcdc_spply_v": "11.397", "v_spply_v": "11.331", "v_gateway_v": "11.32", "fan_actv_fl": "0", "fw_error": "0", "event_history": "2112", "origin": "data_logger", "OPERATION": "noop", "PARENT": "00001C39A01C_M0012205101B5B_M0012205101B63", "CURTIME": "2022,12,10,21,59,46" }, { "ISDETAIL": true, "SERIAL": "SY2111536749A0867", "TYPE": "PV-DISCONNECT", "STATE": "working", "STATEDESCR": "Working", "MODEL": "SunPower PV Disconnect Relay", "DESCR": "PV Disconnect SY2111536749A0867", "DEVICE_TYPE": "PV Disconnect", "hw_version": "0.2.0", "interface": "ttymxc5", "slave": 230, "SWVER": "0.2.10", "PORT": "P0, Modbus, Slave 230", "DATATIME": "2022,12,10,21,59,44", "event_history": "32", "fw_error": "0", "relay_mode": "0", "relay1_state": "1", "relay2_state": "1", "relay1_error": "0", "relay2_error": "0", "v1n_grid_v": "121", "v2n_grid_v": "121.3", "v1n_pv_v": "121.3", "v2n_pv_v": "121.3", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,46" }, { "ISDETAIL": true, "SERIAL": "BC2103004370", "TYPE": "GATEWAY", "STATE": "error", "STATEDESCR": "Error", "MODEL": "SchneiderElectric-ConextGateway", "DESCR": "Gateway BC2103004370", "DEVICE_TYPE": "Gateway", "interface": "sunspec", "mac_address": "40:2e:71:db:82:c", "slave": 1, "SWVER": "V1", "PORT": "P0, SunSpec, Slave 1", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,47" }, { "ISDETAIL": true, "SERIAL": "00001C39A01C", "TYPE": "SCHNEIDER-XWPRO", "STATE": "error", "STATEDESCR": "Error", "MODEL": "SchneiderElectric-XW6848-21", "DESCR": "Storage Inverter 00001C39A01C", "DEVICE_TYPE": "Storage Inverter", "interface": "sunspec", "mac_address": "40:2e:71:db:82:c", "parent": 11, "slave": 10, "SWVER": "V1", "PORT": "P0, SunSpec, Slave 10", "origin": "data_logger", "OPERATION": "noop", "PARENT": "00001C39A01C_M0012205101B5B_M0012205101B63", "CURTIME": "2022,12,10,21,59,47" }, { "ISDETAIL": true, "SERIAL": "BC210300437033751040", "TYPE": "EQUINOX-BMS", "STATE": "error", "STATEDESCR": "Error", "MODEL": "SchneiderElectric-SP1", "DESCR": "ESS BMS BC210300437033751040", "DEVICE_TYPE": "ESS BMS", "interface": "sunspec", "mac_address": "40:2e:71:db:82:c", "parent": 11, "slave": 230, "PORT": "P0, SunSpec, Slave 230", "origin": "data_logger", "OPERATION": "noop", "PARENT": "00001C39A01C_M0012205101B5B_M0012205101B63", "CURTIME": "2022,12,10,21,59,47" }, { "ISDETAIL": true, "SERIAL": "PVS6M20460474p", "TYPE": "PVS5-METER-P", "STATE": "working", "STATEDESCR": "Working", "MODEL": "PVS6M0400p", "DESCR": "Power Meter PVS6M20460474p", "DEVICE_TYPE": "Power Meter", "interface": "mime", "production_subtype_enum": "GROSS_PRODUCTION_SITE", "subtype": "GROSS_PRODUCTION_SITE", "SWVER": "3000", "PORT": "", "DATATIME": "2022,12,10,21,59,47", "ct_scl_fctr": "50", "net_ltea_3phsum_kwh": "17707.3499", "p_3phsum_kw": "0.2765", "q_3phsum_kvar": "0.3223", "s_3phsum_kva": "0.444", "tot_pf_rto": "0.6412", "freq_hz": "60", "i_a": "1.8338", "v12_v": "242.1286", "CAL0": "50", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,47" }, { "ISDETAIL": true, "SERIAL": "PVS6M20460474c", "TYPE": "PVS5-METER-C", "STATE": "working", "STATEDESCR": "Working", "MODEL": "PVS6M0400c", "DESCR": "Power Meter PVS6M20460474c", "DEVICE_TYPE": "Power Meter", "interface": "mime", "consumption_subtype_enum": "NET_CONSUMPTION_LOADSIDE", "subtype": "NET_CONSUMPTION_LOADSIDE", "SWVER": "3000", "PORT": "", "DATATIME": "2022,12,10,21,59,47", "ct_scl_fctr": "100", "net_ltea_3phsum_kwh": "-3401.58", "p_3phsum_kw": "9.9008", "q_3phsum_kvar": "-0.5945", "s_3phsum_kva": "10.0246", "tot_pf_rto": "0.9831", "freq_hz": "60", "i1_a": "42.5075", "i2_a": "40.2974", "v1n_v": "121.0395", "v2n_v": "121.0892", "v12_v": "242.1286", "p1_kw": "5.0997", "p2_kw": "4.8011", "neg_ltea_3phsum_kwh": "11443.84", "pos_ltea_3phsum_kwh": "8042.3", "CAL0": "100", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,48" }, { "ISDETAIL": true, "SERIAL": "M0012205101B5B", "TYPE": "BATTERY", "STATE": "error", "STATEDESCR": "Error", "MODEL": "POWERAMP-Komodo 1.2", "DESCR": "Battery M0012205101B5B", "DEVICE_TYPE": "Battery", "hw_version": "4.33", "interface": "none", "parent": 11, "SWVER": "2.8", "PORT": "P0, None, Slave -1", "origin": "data_logger", "OPERATION": "noop", "PARENT": "00001C39A01C_M0012205101B5B_M0012205101B63", "CURTIME": "2022,12,10,21,59,48" }, { "ISDETAIL": true, "SERIAL": "M0012205101B63", "TYPE": "BATTERY", "STATE": "error", "STATEDESCR": "Error", "MODEL": "POWERAMP-Komodo 1.2", "DESCR": "Battery M0012205101B63", "DEVICE_TYPE": "Battery", "hw_version": "4.33", "interface": "none", "parent": 11, "SWVER": "2.8", "PORT": "P0, None, Slave -1", "origin": "data_logger", "OPERATION": "noop", "PARENT": "00001C39A01C_M0012205101B5B_M0012205101B63", "CURTIME": "2022,12,10,21,59,48" }, { "ISDETAIL": true, "SERIAL": "00001C39A01C_M0012205101B5B_M0012205101B63", "TYPE": "EQUINOX-ESS", "STATE": "error", "STATEDESCR": "Error", "MODEL": "SPWR-Equinox-model", "DESCR": "Energy Storage System 00001C39A01C_M0012205101B5B_M0012205101B6", "DEVICE_TYPE": "Energy Storage System", "hw_version": "0", "interface": "none", "SWVER": "0", "PORT": "P0, Parent, Slave -1", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,49" }, { "ISDETAIL": true, "SERIAL": "E00121937061927", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937061927", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,59,41", "ltea_3phsum_kwh": "827.0713", "p_3phsum_kw": "0.0153", "vln_3phavg_v": "242.93", "i_3phsum_a": "0.06", "p_mppt1_kw": "0.0161", "v_mppt1_v": "37.88", "i_mppt1_a": "0.42", "t_htsnk_degc": "16", "freq_hz": "60", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,49" }, { "ISDETAIL": true, "SERIAL": "E00121937056022", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937056022", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,59,41", "ltea_3phsum_kwh": "777.8371", "p_3phsum_kw": "0.0119", "vln_3phavg_v": "243.45", "i_3phsum_a": "0.04", "p_mppt1_kw": "0.0125", "v_mppt1_v": "30.36", "i_mppt1_a": "0.41", "t_htsnk_degc": "16", "freq_hz": "60.01", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,49" }, { "ISDETAIL": true, "SERIAL": "E00121920109392", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121920109392", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,59,41", "ltea_3phsum_kwh": "783.3916", "p_3phsum_kw": "0.0122", "vln_3phavg_v": "242.68", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0157", "v_mppt1_v": "36.04", "i_mppt1_a": "0.43", "t_htsnk_degc": "16", "freq_hz": "60.01", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,49" }, { "ISDETAIL": true, "SERIAL": "E00121937058632", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937058632", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,59,41", "ltea_3phsum_kwh": "752.1986", "p_3phsum_kw": "0.0122", "vln_3phavg_v": "243", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0157", "v_mppt1_v": "36.34", "i_mppt1_a": "0.43", "t_htsnk_degc": "16", "freq_hz": "60.01", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,49" }, { "ISDETAIL": true, "SERIAL": "E00121942063605", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942063605", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,59,41", "ltea_3phsum_kwh": "768.5711", "p_3phsum_kw": "0.0139", "vln_3phavg_v": "242.72", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0156", "v_mppt1_v": "36.26", "i_mppt1_a": "0.43", "t_htsnk_degc": "17", "freq_hz": "60.01", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,50" }, { "ISDETAIL": true, "SERIAL": "E00121937057724", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937057724", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,59,41", "ltea_3phsum_kwh": "787.0479", "p_3phsum_kw": "0.0129", "vln_3phavg_v": "243.51", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0152", "v_mppt1_v": "36.46", "i_mppt1_a": "0.41", "t_htsnk_degc": "16", "freq_hz": "60.01", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,50" }, { "ISDETAIL": true, "SERIAL": "E00121937061965", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937061965", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,26", "ltea_3phsum_kwh": "789.4494", "p_3phsum_kw": "0.0198", "vln_3phavg_v": "242.98", "i_3phsum_a": "0.08", "p_mppt1_kw": "0.0188", "v_mppt1_v": "37.45", "i_mppt1_a": "0.5", "t_htsnk_degc": "16", "freq_hz": "59.98", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,50" }, { "ISDETAIL": true, "SERIAL": "E00121942035973", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942035973", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,26", "ltea_3phsum_kwh": "756.6602", "p_3phsum_kw": "0.0148", "vln_3phavg_v": "242.12", "i_3phsum_a": "0.06", "p_mppt1_kw": "0.0178", "v_mppt1_v": "36.18", "i_mppt1_a": "0.49", "t_htsnk_degc": "16", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,50" }, { "ISDETAIL": true, "SERIAL": "E00121942033449", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942033449", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,26", "ltea_3phsum_kwh": "751.7173", "p_3phsum_kw": "0.0155", "vln_3phavg_v": "242.54", "i_3phsum_a": "0.06", "p_mppt1_kw": "0.0186", "v_mppt1_v": "37.58", "i_mppt1_a": "0.49", "t_htsnk_degc": "16", "freq_hz": "59.98", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,50" }, { "ISDETAIL": true, "SERIAL": "E00121938067613", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121938067613", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,26", "ltea_3phsum_kwh": "757.4646", "p_3phsum_kw": "0.0132", "vln_3phavg_v": "242.96", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0188", "v_mppt1_v": "37.93", "i_mppt1_a": "0.49", "t_htsnk_degc": "16", "freq_hz": "59.98", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,51" }, { "ISDETAIL": true, "SERIAL": "E00121938076424", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121938076424", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,26", "ltea_3phsum_kwh": "754.3747", "p_3phsum_kw": "0.0127", "vln_3phavg_v": "242.42", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0163", "v_mppt1_v": "32.83", "i_mppt1_a": "0.49", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,51" }, { "ISDETAIL": true, "SERIAL": "E00121937085423", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937085423", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,26", "ltea_3phsum_kwh": "768.3254", "p_3phsum_kw": "0.0182", "vln_3phavg_v": "242.64", "i_3phsum_a": "0.07", "p_mppt1_kw": "0.0176", "v_mppt1_v": "36.84", "i_mppt1_a": "0.47", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,51" }, { "ISDETAIL": true, "SERIAL": "E00121938051452", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121938051452", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,26", "ltea_3phsum_kwh": "757.8691", "p_3phsum_kw": "0.0135", "vln_3phavg_v": "242.37", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.018", "v_mppt1_v": "37.62", "i_mppt1_a": "0.48", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,51" }, { "ISDETAIL": true, "SERIAL": "E00121942035409", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942035409", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "767.2592", "p_3phsum_kw": "0.0121", "vln_3phavg_v": "242.61", "i_3phsum_a": "0.04", "p_mppt1_kw": "0.0171", "v_mppt1_v": "35.59", "i_mppt1_a": "0.48", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,51" }, { "ISDETAIL": true, "SERIAL": "E00121942038546", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942038546", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "783.6173", "p_3phsum_kw": "0.0146", "vln_3phavg_v": "243", "i_3phsum_a": "0.06", "p_mppt1_kw": "0.018", "v_mppt1_v": "36.24", "i_mppt1_a": "0.49", "t_htsnk_degc": "17", "freq_hz": "59.98", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,52" }, { "ISDETAIL": true, "SERIAL": "E00121938075080", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121938075080", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "773.3062", "p_3phsum_kw": "0.0181", "vln_3phavg_v": "242.76", "i_3phsum_a": "0.07", "p_mppt1_kw": "0.0178", "v_mppt1_v": "38.19", "i_mppt1_a": "0.46", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,52" }, { "ISDETAIL": true, "SERIAL": "E00121942052353", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942052353", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "779.4812", "p_3phsum_kw": "0.0134", "vln_3phavg_v": "242.28", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0184", "v_mppt1_v": "37.15", "i_mppt1_a": "0.49", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,52" }, { "ISDETAIL": true, "SERIAL": "E00121938075033", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121938075033", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "745.9672", "p_3phsum_kw": "0.0124", "vln_3phavg_v": "243.53", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0175", "v_mppt1_v": "36.67", "i_mppt1_a": "0.47", "t_htsnk_degc": "16", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,52" }, { "ISDETAIL": true, "SERIAL": "E00121938076113", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121938076113", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "706.6156", "p_3phsum_kw": "0.0135", "vln_3phavg_v": "242.96", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0172", "v_mppt1_v": "35.77", "i_mppt1_a": "0.48", "t_htsnk_degc": "16", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,53" }, { "ISDETAIL": true, "SERIAL": "E00121937064782", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937064782", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "770.5236", "p_3phsum_kw": "0.0163", "vln_3phavg_v": "243.36", "i_3phsum_a": "0.06", "p_mppt1_kw": "0.0183", "v_mppt1_v": "37.58", "i_mppt1_a": "0.48", "t_htsnk_degc": "16", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,53" }, { "ISDETAIL": true, "SERIAL": "E00121942034160", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942034160", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "691.4557", "p_3phsum_kw": "0.0127", "vln_3phavg_v": "243.54", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0172", "v_mppt1_v": "37.76", "i_mppt1_a": "0.45", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,53" }, { "ISDETAIL": true, "SERIAL": "E00121937102286", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121937102286", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "762.0617", "p_3phsum_kw": "0.0139", "vln_3phavg_v": "242.98", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0187", "v_mppt1_v": "37.76", "i_mppt1_a": "0.49", "t_htsnk_degc": "16", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,53" }, { "ISDETAIL": true, "SERIAL": "E00121942033387", "TYPE": "SOLARBRIDGE", "STATE": "working", "STATEDESCR": "Working", "MODEL": "AC_Module_Type_G", "DESCR": "Inverter E00121942033387", "DEVICE_TYPE": "Inverter", "hw_version": "4400", "interface": "mime", "PANEL": "SPR-A420-G-AC", "slave": 0, "SWVER": "4.28.7", "PORT": "", "MOD_SN": "", "NMPLT_SKU": "", "DATATIME": "2022,12,10,21,57,41", "ltea_3phsum_kwh": "734.556", "p_3phsum_kw": "0.0133", "vln_3phavg_v": "243.68", "i_3phsum_a": "0.05", "p_mppt1_kw": "0.0183", "v_mppt1_v": "36.18", "i_mppt1_a": "0.5", "t_htsnk_degc": "17", "freq_hz": "59.97", "stat_ind": "0", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,53" }], "result": "succeed" }

msholly commented 1 year ago

I'm in the same boat, and I even tried thinking of ways to infer the battery charge - but came up empty.

My guess is there's another undocumented local endpoint that offers this information. Or perhaps cloud only?

On the https://sds.mysunpower.com/ web app, there's a GraphQL call with Storage information. There's also a CSV download, so you could in theory clean up your old data, but wouldn't be real-time without heavy automation work.

I've also thought about getting this information with a web scraper. Huginn , Crawlbase, Multi Scrape, etc. If I get anything running, I'll post something here.

mvcl commented 1 year ago

Of course reporting of the battery state/fullness must be available through the interface already utilized. As long as we don't know how to ascertain that, it may be possible to get the data another way. One possibility I believe I saw someplace was to use a Shelley EM device - it uses a CT clamp-on transformer and shows Kilowatts, etc. flowing both in and out of an appliance. I had a very good experience with one -- getting the current and power flows to my electric air source heat pump. It connects over wifi and then the values are collected in HASS. It works well in the History panel. So I wonder if the Shelley EM could do as much for the power flows into and out of the Sunvault battery system.

kpfleming commented 1 year ago

If the power flows in and out are AC, then it's possible; if they are DC, then it won't be usable. I have Shelly 3EMs monitoring my air-source heat pumps and other appliances now, and they work well, but as you noted they'll only be able to report on flow, not status (like 'how full is the battery').

mvcl commented 1 year ago

@kpfleming Thanks for that information! It's clear that because Sunpower's app and customer portal show the battery fullness and other data, then it must be available already in the data communicated over the internet to their servers.

krbaker commented 1 year ago

Just some notes on this. I don't have a Sunpower ESS so I'm a little blind here so I have just not attempted to code for it because I didn't know where to get the data. Reading the debug dump you sent it realy doesn't look like the battery data is in that "API" (there are entries, but not any useful charge state details).

The below look interesting and possible to add (the pattern to add these is fairly easy to follow in the code and I may try to do this in a future version but welcome a pull request too)

}, { "ISDETAIL": true, "SERIAL": "SY2111536749A0867", "TYPE": "PV-DISCONNECT", "STATE": "working", "STATEDESCR": "Working", "MODEL": "SunPower PV Disconnect Relay", "DESCR": "PV Disconnect SY2111536749A0867", "DEVICE_TYPE": "PV Disconnect", "hw_version": "0.2.0", "interface": "ttymxc5", "slave": 230, "SWVER": "0.2.10", "PORT": "P0, Modbus, Slave 230", "DATATIME": "2022,12,10,21,59,44", "event_history": "32", "fw_error": "0", "relay_mode": "0", "relay1_state": "1", "relay2_state": "1", "relay1_error": "0", "relay2_error": "0", "v1n_grid_v": "121", "v2n_grid_v": "121.3", "v1n_pv_v": "121.3", "v2n_pv_v": "121.3", "origin": "data_logger", "OPERATION": "noop", "CURTIME": "2022,12,10,21,59,46" }, {

}, { "ISDETAIL": true, "SERIAL": "SY2121534552D1805", "TYPE": "EQUINOX-MIO", "STATE": "working", "STATEDESCR": "Working", "MODEL": "SunPower MIO", "DESCR": "ESS Hub SY2121534552D1805", "DEVICE_TYPE": "ESS Hub", "hw_version": "0.4.0", "interface": "ttymxc5", "parent": 11, "slave": 221, "SWVER": "0.7.9", "PORT": "P0, Modbus, Slave 221", "DATATIME": "2022,12,10,21,59,41", "t_degc": "27", "humidity": "26", "v_dcdc_spply_v": "11.397", "v_spply_v": "11.331", "v_gateway_v": "11.32", "fan_actv_fl": "0", "fw_error": "0", "event_history": "2112", "origin": "data_logger", "OPERATION": "noop", "PARENT": "00001C39A01C_M0012205101B5B_M0012205101B63", "CURTIME": "2022,12,10,21,59,46" }, {

krbaker commented 1 year ago

If anyone has an ESS and can play around with the "API" I'd be interested (here's the detail I built this plugin from: https://github.com/ginoledesma/sunpower-pvs-exporter/blob/master/sunpower_pvs_notes.md

I'd try all of those endpoints and see if you can get any more data, I'd also just point a web browser at the system with the browser network monitor running and see if there is a way to get the data.

Immediate idea is if the "DeviceDetails" API gets more info on the battery? http://10.10.10.123//cgi-bin/dl_cgi?Command=DeviceDetails&SerialNumber=M0012205101B5B http://10.10.10.123//cgi-bin/dl_cgi?Command=DeviceDetails&SerialNumber=M0012205101B63 http://10.10.10.123//cgi-bin/dl_cgi?Command=DeviceDetails&SerialNumber=00001C39A01C_M0012205101B5B_M0012205101B63

Also surprising your batteries are reporting an error state

msholly commented 1 year ago

I tried those commands on my system, and I just get the following: { "result": "unknown command" }

I'm assuming that the normal DeviceList command is defaulted to return those details, seeing as the first line of my response has the PV Supervisor returning: "DETAIL": "detail",

and my devices all show "ISDETAIL": true,

heyhewmike commented 1 year ago

I tried those commands on my system, and I just get the following: { "result": "unknown command" }

I'm assuming that the normal DeviceList command is defaulted to return those details, seeing as the first line of my response has the PV Supervisor returning: "DETAIL": "detail",

and my devices all show "ISDETAIL": true,

I got the same responses.

Also surprising your batteries are reporting an error state

My Batteries are reporting the same.

heyhewmike commented 1 year ago

I have been thinking about this. I have done some network packet captures and I couldn't find any IP based communication between the PVS and BMS.

I have noticed that the"Port" for the batteries show SunSpec which is an RS485 serial communication. Because we have interrupted the serial communication with the BMS and this is why the batteries is showing "error".

I will be attempting to fix this "error" and find an alternate method to query the server for the data.

mvcl commented 1 year ago

Me too - I got my sunvault battery box open - my first time to see what's inside. I could see both the ethernet and the RS485 cables (black and yellow, respectively) go between the Sunvault and the PVS6. They both terminate in the Sunvault at its Schneider Conext Gateway #865-0329 (https://solar.se.com/us/en/product/conext-gateway/). In briefly scanning its documentation, I can see that this box seems to have Xanbus and Modbus capabilities in addition to the RS485 and ethernet.

So how are the SunPower servers getting the values of the battery activity - production, consumption, % full, time to full charge or time to empty, etc.? They must be passing over the internet from my PVS6. So if the battery data isn't available on the tapped internal ethernet, maybe it's only on the R485. If that is the case, then plausibly the place for us to access the battery data is in network packets on our normal LAN (whether connecting the PVS to the internet via ethernet or wifi).

I'm thinking about sniffing packets on my LAN between the PVS and the internet. Unless the connection is encrypted, we ought to be able to find the data we want in those. My guess is that we may find the communication between the PVS and Sunpower is using HTTP/S for the reason that it tends to "just work" with default configurations of home firewall routers. -- or MAYBE: the Conext gateway does have a USB port on it and some other things which might permit us to do some sort of allowed "debugging" or monitoring of its activity. That is, provided that in its configuration we're not disallowed by Sunpower's configuring it to lock us out.

Does this line of thinking make sense? To get a look what setup and tools to assemble? Something like a managed ethernet switch with a listening replication port? (practically no hubs are used anymore), Wire Shark or some such? and what else? B0AAABED-61B7-4639-8B56-818AED588358_1_105_c

24F90D2A-5834-43B8-805D-B18738E9AD01_1_105_c

heyhewmike commented 1 year ago

From the packet sniffing I have done troubleshooting SunPower App Related Issues I found the App Data sent to the AWS EC2 (Amazon Cloud) instances for SunPower is TLS v1.2 encrypted when it is transmitted to from the PVS to the cloud. Cracking this would be beyond my abilities.

My current thinking is that if I remove my networking equipment (Some use a Raspberry Pi) and returning the Ethernet cable from the PVS to the SunVault will correct the "error" message seen.

I know that I am able to connect my cell phone and laptop to the PVS's installer WiFi. Once there I am able to query the normal 'api' for the device details. This is referenced in the documentation for this integration. https://us.sunpower.com/sites/default/files/tech-note-commissioning-equinoxtm-systems-using-wifi-534241-004_0.pdf

I will be using another router or a cheap gli.Net router with the WiFi as the WAN and the Ethernet as the Lan and bridge them so that I can reconnect it to my networking gear and maintain pulling data that way. <-> the RaspberryPi equivalent would be to use the Pi's WiFi for the PVS instead of your local network and the Ethernet port for the local network instead of the PVS.

My planned connection:

My home assistant server <-ethernet-> my router My router <-ethernet-> gli.net router <-wifi-> PVS

mvcl commented 1 year ago

Certainly we'll not try to crack the usual SSL/HTTPS encryption which is reported to be applied to the data between our Sunpower PVS6 and the SunPower servers on AWS or elsewhere on the internet. On the other hand the battery information must be communicated between the Conext Gateway and the PVS6 on either the internal ethernet or the RS-485 interfaces. So which is it? Why does the PVS6 have both interfaces connecting it to the SunVault (battery box)? - which interface is used for which purpose?

As a very last resort I suppose one could create a logged-in web session which extracts the information from the MySunpower monitoring web pages...

koleson commented 1 year ago

I found the ESS status is available on the local PVS API via the following URL:

http://172.x.x.1/cgi-bin/dl_cgi/energy-storage-system/status

The output looks like the following:

{
    "errors":   [],
    "ess_report":   {
        "battery_status":   [{
                "battery_amperage": {
                    "unit": "A",
                    "value":    -24.2
                },
                "battery_voltage":  {
                    "unit": "V",
                    "value":    52.1
                },
                "customer_state_of_charge": {
                    "unit": "%",
                    "value":    45
                },
                "last_updated": "2023-05-06 04:07:32",
                "serial_number":    "BCXXXXXXXXXXXXXXXXX",
                "system_state_of_charge":   {
                    "unit": "%",
                    "value":    53
                },
                "temperature":  {
                    "unit": "C",
                    "value":    26.400000000000002
                }
            }],
        "ess_state":    [{
                "operational_mode": "SELF_CONSUMPTION",
                "permission_to_operate":    true,
                "storage_controller_status":    "RUNNING"
            }],
        "ess_status":   [{
                "enclosure_humidity":   {
                    "unit": "%",
                    "value":    20
                },
                "enclosure_temperature":    {
                    "unit": "C",
                    "value":    35
                },
                "ess_meter_reading":    {
                    "agg_power":    {
                        "unit": "kW",
                        "value":    1.223
                    },
                    "last_updated": "2023-05-06 04:07:35",
                    "meter_a":  {
                        "reading":  {
                            "current":  {
                                "unit": "A",
                                "value":    4.48
                            },
                            "last_updated": "2023-05-06 04:07:35",
                            "power":    {
                                "unit": "W",
                                "value":    552.07040000000006
                            },
                            "voltage":  {
                                "unit": "V",
                                "value":    123.23
                            }
                        }
                    },
                    "meter_b":  {
                        "reading":  {
                            "current":  {
                                "unit": "A",
                                "value":    4.5200000000000005
                            },
                            "last_updated": "2023-05-06 04:07:35",
                            "power":    {
                                "unit": "W",
                                "value":    556.9996000000001
                            },
                            "voltage":  {
                                "unit": "V",
                                "value":    123.23
                            }
                        }
                    }
                },
                "last_updated": "2023-05-06 04:07:32",
                "serial_number":    "XXXXXXXXXXX_M00XXXXXXXXX_M001XXXXXXXXXX"
            }],
        "hub_plus_status":  {
            "aux_port_voltage": {
                "unit": "V",
                "value":    11.221
            },
            "contactor_error":  "NONE",
            "contactor_position":   "CLOSED",
            "grid_frequency_state": "METER_FREQ_IN_RANGE",
            "grid_phase1_voltage":  {
                "unit": "V",
                "value":    123.9
            },
            "grid_phase2_voltage":  {
                "unit": "V",
                "value":    123.80000000000001
            },
            "grid_voltage_state":   "METER_VOLTAGE_IN_RANGE",
            "hub_humidity": {
                "unit": "%",
                "value":    34
            },
            "hub_temperature":  {
                "unit": "C",
                "value":    26
            },
            "inverter_connection_voltage":  {
                "unit": "V",
                "value":    0.277
            },
            "jump_start_voltage":   {
                "unit": "V",
                "value":    1.397
            },
            "last_updated": "2023-05-06 04:07:35",
            "load_frequency_state": "METER_FREQ_IN_RANGE",
            "load_phase1_voltage":  {
                "unit": "V",
                "value":    123.9
            },
            "load_phase2_voltage":  {
                "unit": "V",
                "value":    123.7
            },
            "load_voltage_state":   "METER_VOLTAGE_IN_RANGE",
            "main_voltage": {
                "unit": "V",
                "value":    11.375
            },
            "serial_number":    "SYXXXXXXX-XXXXXX.XXXXX"
        },
        "inverter_status":  [{
                "a_n_voltage":  {
                    "unit": "V",
                    "value":    123.23
                },
                "ac_current":   {
                    "unit": "A",
                    "value":    4.5
                },
                "ac_power": {
                    "unit": "kW",
                    "value":    1.223
                },
                "b_n_voltage":  {
                    "unit": "V",
                    "value":    123.23
                },
                "last_updated": "2023-05-06 04:07:35",
                "phase_a_current":  {
                    "unit": "A",
                    "value":    4.48
                },
                "phase_b_current":  {
                    "unit": "A",
                    "value":    4.5200000000000005
                },
                "serial_number":    "00001XXXXXXX",
                "temperature":  {
                    "unit": "C",
                    "value":    35.13
                }
            }],
        "last_updated": "2023-05-06 04:07:36"
    }
}

The PVS's local API is documented by a Swagger JSON embedded in the firmware image.

koleson commented 1 year ago

A few notes:

Enjoy!

koleson commented 1 year ago

One last thing - I still haven't figured out how the PVS obtains this information. It might be over RS-485, it might be Modbus over TCP on the Ethernet cable (probably SunSpec), it might be another API on the Conext Gateway, it might be something else.

heyhewmike commented 1 year ago

If you look at each device, in the '172.x.x.1/cgi-bin/dl_cgi?Command=DeviceList', there is an 'Interface' that lists the communication method that I suspect each device communicates with the PVS by. The Batteries are 'none', the Meters & Micros are 'mime' and the 'SchneiderElectric-ConextGateway' & 'Storage Inverter' & BMS are SunSpec. The 'Hub+' and others that are ttymxc5. If the Interface is SunSpec or ttymxc5 there is additional info under 'Port' that will identify the comms and unique identifier for each device. I believe this will give a clue as to where the communication method is.

koleson commented 1 year ago

I think ttymxc5 is RS-485 based on some strings in tools in the firmware image called rs485test (which does the obvious) and psoc4_fwup (which can update the firmware of the PSoC in the MIDC - side note, PSoC chips are all over the system).

Which - it makes sense that the PVS gets this data over RS-485. It doesn't really explain the function of the Ethernet connection from the Conext Gateway to the PVS. But, hopefully this is enough to address the original issue of getting data from the PVS into Home Assistant.

heyhewmike commented 1 year ago

@koleson I believe it does. I believe I have an idea how to perform that integration.

msholly commented 1 year ago

Great job finding that endpoint, I'm getting the same response as well.

The app doesn't report the actual timestamp of its data, so who knows how delayed it actually is. I'm showing a difference of 8% from system_state_of_charge to customer_state_of_charge, and a ~5% difference between customer_state_of_charge and the SunPower app. I hope this is helpful in normalizing the numbers for the HA dashboard.

Happy to test a pre-release if you need testing help.

mvcl commented 1 year ago

Please add me too for any needed help on pre-release testing!

heyhewmike commented 1 year ago

I have developed a simple python script that is able to pull the json live and parse it to get the values. I am now attempting to integrate it. @krbaker Are you able to assist?

jayanty commented 1 year ago

I have a Conext 6848 inverter that I've integrated into home assistant using modbus maps published by Schneider. Those are supposed to be available via RS-485 or modbus TCP if using their gateway. The Sunspec protocols offer a limited set of data. Schneider's own modbus maps offer a lot more info. Here's the spec for the Conext XW inverter. There's a different set for the gateway. Conext XW Modbus 503 spec 990-6268B.pdf

Not sure if this applies to what you all are discussing since I don't have batteries integrated into my Sunpower setup. Happy to share more details if you see the ability to directly use modbus via TCP or RS-485.

krbaker commented 11 months ago

@heyhewmike I can certainly try, I'm happy to take a patch too, but I will look (its a little harder not having ESS myself). Do you have a link to the script you wrote?

I'm thinking I might split the ESS integration into its own integration? Thoughts?

heyhewmike commented 11 months ago

@heyhewmike I can certainly try, I'm happy to take a patch too, but I will look (its a little harder not having ESS myself). Do you have a link to the script you wrote?

@krbaker here is a link. https://github.com/heyhewmike/hass-sunpower/tree/beta-ESS/custom_components%2Fsunpower

There are 2 files that are of importance. sunvault.py and sunvault.output.txt (output of what the script returns).

I also started trying to edit the const.py to incorporate the values in.

The comment here shows the actual PVS response when queried.

I haven't been able to do much since the pvdr tripped in my hub+ and now my ess gateway is under an RMA.

I'm thinking I might split the ESS integration into its own integration? Thoughts?

I am just sticking my toe into coding here. My first thought with a separate integration would mean having 2 to update each integration with each PR or update made to the current integration. If possible during the configuration, or reconfiguration, of the integration to be able to select if you have an ESS or not and provide a logic to either ignore (No ESS) or use (Yes ESS) the sunvault code might be easiest long term as you will have a single code base to maintain. However setting it up in the first place might be more difficult.

Easier path now might not be the best long term.

koleson commented 8 months ago

Just wanted to put a note here: I found out a few months ago that the PVS-ESS communication no longer uses RS-485 - it's now just Modbus over TCP on the (black?) Ethernet cable. I haven't fussed with that yet - I have an ongoing issue where every 5-6 months my PVS6 has to be replaced, and I don't want to give anyone any reason to try to blame me for the problem.

dlp688 commented 8 months ago

I have an ESS system and would be happy to help contribute to this endeavor. Let me know how I can help gather data or test out commands on my system.

heyhewmike commented 8 months ago

I recently had a short in a comm wire between the PVDR and the ESS that caused a major headache and loss of production over a month period.

I am not going to be able to assist anymore.

Sadly I lost my Spouse Approval Factor, SAF, so I am no longer able to integrate the PVS monitoring into my HA for automation and data analytics. There was fear from my spouse that what I did for the integration would be seen by the MFG as modifying the system and voiding a warranty.

dlp688 commented 7 months ago

@krbaker Is there anything I can do to help get the battery information imported into HA?

CanisUrsa commented 2 months ago

I have spent the last few days working on this specific issue. Thus far it seems to work but I don't know how accurate the information is. I can see the battery charging, discharging. The system doesn't report total input / output power from the battery so I had to calculate instantaneous power and then use the integrator integration (readme has details) to integrate that into a total input and output value. This can then be utilized by the Energy panel. I need a couple of days to compare the sunpower app's daily report to what home assistant reports but it should be pretty good. I am looking into adding the state of the battery (grid available or not) so if I lose grid power I can use automation to turn off certain devices. Additionally I am looking at addressing the constants that are deprecated.

https://github.com/CanisUrsa/hass-sunpower/tree/refactor_with_ess

If you do end up using this know that I changed the unique ids of the fields to closer match to the example shown here https://developers.home-assistant.io/docs/entity_registry_index/

mbowie commented 1 month ago

I've been toying with https://github.com/CanisUrsa/hass-sunpower/tree/refactor_with_ess for the last couple of days, and aside from some fairly minor foibles, it's doing the thing as best I can tell. (As in it's populating all the data I'm keen to get my grubby hands on.)

Admittedly, I've not taken the time to debug the status quo extensively, but I did add an else to return {} for https://github.com/CanisUrsa/hass-sunpower/blob/af69f9c7e212c6e3ef4dcb7e8aab42aa2dce85cd/custom_components/sunpower/__init__.py#L47, as I was seeing polling results flap everything to "unavailable" every few minutes. If it fell through into https://github.com/CanisUrsa/hass-sunpower/blob/af69f9c7e212c6e3ef4dcb7e8aab42aa2dce85cd/custom_components/sunpower/__init__.py#L60 and beyond, there was nothing in the data dict for it to operate on; so errors ensued.

Aside from that, the SunVault, HUB+, BMS, and ESS all report a state of "error", which I've not yet put any effort into figuring out. (My http://foo.bar.baz/cgi-bin/dl_cgi/energy-storage-system/status endpoint does show an error code, so that may well be reasonable.)

If there's some level of interest in getting the ESS bits into a more consumable place, and addressing the deprecated constants etc, I'd be happy to lend a hand. (No experience with the HA side of things, but somewhat Python literate.)

krbaker commented 1 month ago

I'm working on pulling in an ESS branch, you can follow here: https://github.com/krbaker/hass-sunpower/issues/61

krbaker commented 4 weeks ago

moving this to be a full release now that at least one user has gotten data.

mbowie commented 4 weeks ago

I've also moved over to the updated release as of this evening... so far, it seems all is well! 🤞

Thanks for making it happen folks! 🤘

krbaker commented 4 weeks ago

marking this as closed, feel free to open bugs (I don't have an ESS myself) but I hope any end up just being improvements etc.