MickMake / GoSungrow

GoLang implementation to access the iSolarCloud API updated by SunGrow inverters.
https://mickmake.com/
GNU General Public License v2.0
148 stars 42 forks source link

Some endpoints seem to be missing from MQTT feed produced by HA Add-on #81

Open Paraphraser opened 10 months ago

Paraphraser commented 10 months ago

One of the phrases in the read-me says "All the read-only endpoints are mapped out and fully tested".

I don't understand the precise distinction between what makes an endpoint read-only or write-only, or if there are endpoints that are read/write. For the moment, I'm assuming that the metrics I'm about to discuss are readable.

Consider the following:

$ SUNGROW_PSID=yourIDhere
$ MPPT1_Voltage=${SUNGROW_PSID}_1_1_1.p5
$ MPPT2_Voltage=${SUNGROW_PSID}_1_1_1.p7
$ MPPT1_Current=${SUNGROW_PSID}_1_1_1.p6
$ MPPT2_Current=${SUNGROW_PSID}_1_1_1.p8
$ Phase_A_Voltage=${SUNGROW_PSID}_1_1_1.p18
$ Phase_A_Current=${SUNGROW_PSID}_1_1_1.p21

$ GoSungrow show point data 202309051100 202309051200 5 $MPPT1_Voltage $MPPT1_Current $MPPT2_Voltage $MPPT2_Current $Phase_A_Voltage $Phase_A_Current

To express this in words, I want to retrieve the voltage and current for each string, plus the mains voltage seen by the SG5.0RS inverter and the current being output by the inverter.

Why? It seems to me that knowing per-string production, especially over time, is a good way of keeping a watch on performance degradation (eg bird droppings). Similarly, keeping track of voltage lets you know when your DNSP is up to no good. Current is just along for the ride.

The show point data command works and produces sensible information:

# DataTable AppService.queryMutiPointDataList.ResultData.Data - EndTimeStamp:20230905120000 MinuteInterval:5 Points:p5,p6,p7,p8,p18,p21 PsId:9999999 PsKeys:9999999_1_1_1,9999999_1_1_1,9999999_1_1_1,9999999_1_1_1,9999999_1_1_1,9999999_1_1_1 StartTimeStamp:20230905110000 
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┓
┃ Timestamp              ┃ Ps Key           ┃ 9999999_1_1_1.p18    ┃ 9999999_1_1_1.p21    ┃ 9999999_1_1_1.p5    ┃ 9999999_1_1_1.p6    ┃ 9999999_1_1_1.p7    ┃ 9999999_1_1_1.p8    ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━┫
┃ 2023-09-05 11:00:00    ┃ 9999999_1_1_1    ┃ 252                  ┃ 19.8                 ┃ 378                 ┃ 6.2                 ┃ 363.5               ┃ 6.8                 ┃
┃ 2023-09-05 11:05:00    ┃ 9999999_1_1_1    ┃ 248.7                ┃ 20.1                 ┃ 371.8               ┃ 6.7                 ┃ 357.3               ┃ 7.2                 ┃
┃ 2023-09-05 11:10:00    ┃ 9999999_1_1_1    ┃ 250.3                ┃ 20                   ┃ 377.6               ┃ 6.4                 ┃ 363.1               ┃ 7                   ┃
┃ 2023-09-05 11:15:00    ┃ 9999999_1_1_1    ┃ 249.9                ┃ 20                   ┃ 373.5               ┃ 6.5                 ┃ 358.9               ┃ 7.1                 ┃
┃ 2023-09-05 11:20:00    ┃ 9999999_1_1_1    ┃ 249.7                ┃ 20                   ┃ 373.1               ┃ 6.5                 ┃ 358.6               ┃ 7.1                 ┃
┃ 2023-09-05 11:25:00    ┃ 9999999_1_1_1    ┃ 250.6                ┃ 19.8                 ┃ 380.1               ┃ 6.2                 ┃ 365.6               ┃ 6.9                 ┃
┃ 2023-09-05 11:30:00    ┃ 9999999_1_1_1    ┃ 250                  ┃ 20                   ┃ 375.3               ┃ 6.5                 ┃ 360.7               ┃ 7.1                 ┃
┃ 2023-09-05 11:35:00    ┃ 9999999_1_1_1    ┃ 249.5                ┃ 20.1                 ┃ 371.1               ┃ 6.6                 ┃ 356.6               ┃ 7.2                 ┃
┃ 2023-09-05 11:40:00    ┃ 9999999_1_1_1    ┃ 249.6                ┃ 20                   ┃ 376.5               ┃ 6.4                 ┃ 362                 ┃ 7                   ┃
┃ 2023-09-05 11:45:00    ┃ 9999999_1_1_1    ┃ 250.6                ┃ 19.9                 ┃ 372.4               ┃ 6.4                 ┃ 356.5               ┃ 7.1                 ┃
┃ 2023-09-05 11:50:00    ┃ 9999999_1_1_1    ┃ 250.4                ┃ 19.9                 ┃ 371.2               ┃ 6.5                 ┃ 355.2               ┃ 7.1                 ┃
┃ 2023-09-05 11:55:00    ┃ 9999999_1_1_1    ┃ 250                  ┃ 20                   ┃ 372.6               ┃ 6.4                 ┃ 356.5               ┃ 7.1                 ┃
┃ 2023-09-05 12:00:00    ┃ 9999999_1_1_1    ┃ 249.5                ┃ 20.1                 ┃ 372.2               ┃ 6.5                 ┃ 356.2               ┃ 7.1                 ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┛

I'd really like to be able to get the same information from the Home Assistant add-on but, for the life of me, I can't find anything that looks like those values.

I set up a monitoring process to log all MQTT messages, like this:

$ mosquitto_sub -v -h homeassistant.local -t "homeassistant/sensor/GoSungrow/#" -F "%I %t %p" -u USERNAME -P PASSWORD >GoSungrow-mqtt-feed.txt

and then set about wading through a day's worth of data to see if I could ferret out the metrics of interest. Nada.

I also reduced the topic string to just "#" but still didn't find anything useful.

Is there some trick to getting the Home Assistant add-on to produce additional fields?

soundvibe commented 5 days ago

+1. Would like to get data for each string in HA as well.