Closed Benchamoneh closed 1 year ago
Looking at your code in sensor.py line 35 your example data references pdischarge1 (correct) but p1charge1 (extra 1).
Is this the problem? Might you be looking for p1charge1? Line35 below:
#home-assistant-test | 2023-03-01 21:32:34.535 DEBUG (MainThread) [custom_components.grott.sensor] Payload: {"device": "NWCPA47006", "time": "2023-03-01T21:32:34", "buffered": "no", "values": {"datalogserial": "NAC3915162", "pvserial": "NWCPA47006", "pvstatus": 6, "pvpowerin": 0, "pv1voltage": 123, "pv1current": 0, "pv1watt": 1, "pv2voltage": 0, "pv2current": 0, "pv2watt": 0, "pvpowerout": 0, "pvfrequentie": 5000, "pvgridvoltage": 2464, "pvgridcurrent": 15, "pvgridpower": 0, "pvgridvoltage2": 0, "pvgridcurrent2": 0, "pvgridpower2": 0, "pvgridvoltage3": 0, "pvgridcurrent3": 0, "pvgridpower3": 0, "totworktime": 111688551, "eactoday": 120, "pvenergytoday": 120, "eactotal": 138743, "epvtotal": 107934, "epv1today": 25, "epv1total": 60803, "epv2today": 16, "epv2total": 32732, "pvtemperature": 232, "pvipmtemperature": 223, "pvboosttemp": 213, "bat_dsp": 522, "eacharge_today": 95, "eacharge_total": 46348, "batterytype": 1, "uwsysworkmode": 6, "systemfaultword0": 0, "systemfaultword1": 0, "systemfaultword2": 0, "systemfaultword3": 0, "systemfaultword4": 32, "systemfaultword5": 0, "systemfaultword6": 0, "systemfaultword7": 2048, "pdischarge1": 0, "p1charge1": 0, "vbat": 519, "SOC": 11, "pactouserr": 12707, "pactousertot": 12707, "pactogridr": 0, "pactogridtot": 0, "plocaloadr": 12700, "plocaloadtot": 12700, "spdspstatus": 6, "spbusvolt": 2957, "etouser_tod": 206, "etouser_tot": 115836, "etogrid_tod": 2, "etogrid_tot": 297107, "edischarge1_tod": 101, "edischarge1_tot": 67936, "eharge1_tod": 88, "eharge1_tot": 63816, "elocalload_tod": 260, "elocalload_tot": 4294898079}}
Sorry I should have just looked properly, that's the issue. submitted PR with the fix.
Hi @Benchamoneh thanks for the bug and the PR.
Your PR was damn close, however that value is used by SPH aka Hybrid systems, what we need to do is add a new lookup to provide the same named value. I'll submit a commit to main with that very shortly so you can re-test.
@Benchamoneh - Could you please pull the main
branch of the integration through HACS and let me know if the value now appears?
Yeah TBH the doubt started to creep in after submitting the PR that maybe it wasn't a typo. Either way, just redownloaded main and I now have the missing sensor.
Thanks for the hard work and rapid bugs fixes!
No problem at all, I'm hoping to do a release over the weekend I'll close it at that point. Glad I could assist with a quick fix.
Released in v1.1.0
Great work on this integration, it's filled a gap in my HA instance that's been there for far too long.
Anyway, reviewing the sensors created by Grott I see a sensor for "Battery Discharging Power" but not the equivalent "Battery Charging Power". The discharge sensor seems to be created using pdischarge1 from Grott, but I don't see a sensor pulling the data from pcharge1.
Grott output below, and the resulting sensors following that. I've omitted the values Grott retrieved because this post would get really long otherwise, but you can see them in the MQTT json message along with the transmitted pcharge1 value.
For info: HA-GROTT version: 1.0.1 Grott version: 2.8.2 (Beta) Hardware: SPA3000TL ("AcCouple", with ShineWiFi-S logger) I have the "additional sensors from raw MQTT values" option checked.
HA sensors built: