muppet3000 / homeassistant-grott

Home Assistant Integration for Grott - MQTT
MIT License
65 stars 14 forks source link

Grott container not communicating with MQTT #76

Closed AlesPokorny closed 5 months ago

AlesPokorny commented 5 months ago

Hello, I followed the installation guide using docker compose and somehow MQTT is not receiving the data and I am not sure why.

I think Grott container gets the data correctly and sends it to growatt servers because I can see it updating on server.growatt.com although I only see there an update every 5 minutes even though I set it to 1 minute but that could just be how they display it.

image

In home assistant, I can connect to MQTT but there is no data even though the grott.ini has the correct ip setup image

And when I check the mosquitto.log, I see something like this: image

Does anyone know what I could be doing wrong?

muppet3000 commented 5 months ago

Can you show me what the logs in Grott are showing? Are you running grott as a standalone application or using the home-assistant add-on?

AlesPokorny commented 5 months ago

Here are the logs: _grott_logs.txt

I am running it as standalone. Everything has its own docker container

muppet3000 commented 5 months ago

Are they the only logs? If the inverter is pushing updates to your grott instance you should be seeing entries like this:

         - Growatt packet received:
                  <socket.socket fd=16, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.18.0.13', 35008), raddr=('172.18.0.5', 5781)>
         - Growatt original Data:
                 \x00\xb7\x00\x06\x03\x3f\x50\x04\x09\x33\x2c\x44\x58\x45\x41\x76\x44\x5d\x77
                 \x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72
                 \x21\x20\x22\x24\x35\x73\x45\x5f\x47\x57\x74\x74\x47\x72\x6f\x77\x61\x74\x74
                 \x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x74\x61
                 \x74\x74\x3b\x72\x6a\x77\x61\x66\x28\x4d\xe0\x6f\x7f\x61\x74\x7d\x1b\x7a\xa7
                 \x77\x6b\x74\x74\x4e\x51\x6f\x76\x33\xd4\x7d\x85\x75\xc1\x7f\xc5\x74\x8e\x47
                 \x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74
                 \x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x56
                 \xe3\x67\xfa\x4e\xfb\x6f\x5c\x61\x74\x53\xe6\x72\x6f\x77\x61\x74\x74\x47\x72
                 \x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x20\x74
                 \x44\x6c\x0d\x7d\x68\xf9\x07\x47\x72\x6f\x79\x61\x75\x07\xa4\x72\x6f\x77\x6b
                 \x74\x74\x85\xdf\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f
                 \x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47
                 \x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6d\x18\xb9\x75
                 \x5a\x46\x61\x6e\x57\x61\x74\x76\x40\x62\xd6\x67\xb8\x74\x74\x47\x72\x6f\x77
                 \x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72                                                                                                                                                                                                                                                 \x6f\x77\x32\x74\x75\x4c\x8c\x6f\x77\x61\x74\x74\x47\x72\x6e\x77\x61\x74\x74                                                                                                                                                                                                                                                 \x47\x72\x6f\x77\x61\x74\x77\xaf\x76\x0b\x77\x64\x74\x74\x47\x72\x6f\x77\x61
                 \x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x74\x2f\x61\x74\x74\x47\x70\x6b                                                                                                                                                                                                                                                 \x77\x76\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47
                 \x72\x6e\xdf\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x46\xda\x6f\x77\x4d\x50
                 \x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x43\x53\x61\x74\x74\x48\x72\x6a\x7c
                 \x32\x45\xba\x47\x72\x6f\xde\x61\x76\x0c\xf6\x72\x6f\x77\x60\x74\x70\x84\x2d
                 \x6f\x77\x61\x3b\x74\x46\xe4\x2d\x77\x61\x74\x3a\x47\x73\x1f\xed\x61\x74\x74
                 \x86\x72\x6f\x3d\xb3\x74\x74\x51\x81\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61
                 \x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f
                 \x77\x62\x9c\x74\x47\x73\x0c\x77\x61\x74\x74\x47\x65\x7b\x5f\x9b\xce\x74\x48
                 \x6c\x6f\x67\x65\x35\x10\x0a\x39\x6f\x7e\x65\x98\x74\x27\x64\x5f\x77\x61\x74
                 \x74\x47\x72\x22\x3c\x61\x74\x74\x47\x72\x6f\x36\x31\x35\x24\x47\x72\x63\xd4
                 \x6d\xec\x74\x44\x72\x6f\x7b\xfe\x78\xea\x4b\xe8\x63\xed\x6d\xd5\x78\xe7\x7e
                 \xf4\x7b\xf9\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x76\x0a\x73\x80\x74\x27
                 \x47\x73\x64\x89\x61\x74\x74\x47\x76\x68\x77\x61\x74\x74\x47\x72\x6f\x77\x61
                 \x74\x74\x47\x72\x6f\x77\x02\x74\x77\x60\x35\x6f\x77\x61\x16\x74\x45\x0c\x99
                 \x77\x61\x5f\xb4\x47\x72\x44\xb7\x61\x74\x74\x5f\x72\x6f\x77\x61\x74\x74\x47
                 \x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74
                 \x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77
                 \x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72
                 \x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74
                 \x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x46\x7e\xcc\x7b\xf9
                 \x74\x77\x47\x42\x6f\x71\x61\x5c\x74\xe3\x72\xfe\x77\x65\x74\x75\x47\x72\x6f
                 \x6c\x61\x62\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x33\x6f\xb7\x61\x74\x74\x47
                 \x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74
                 \x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77
                 \x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72\x6f\x77\x61\x74\x74\x47\x72
                 \x6f\x9c\x0e
         - Grott automatic protocol detection
         - Grott data record length 839
         - layout   :  T065004XSPH
         - no matching record layout found, try generic
         - Record layout used :  T06NNNNXSPH
         - Growatt data decrypted V2
         - Grott Growatt data decrypted
         - Growatt plain data:
                 00b70006033f50044e41433339313531363200000000000000000000000000000000000000004
                 e5743504134373030360000000000000000000000000000000000000000000000000000030000
                 007c00050000125c0a9200080000095c08c8000a00000923000152a009c207ae08a400fa00000
                 00000000000000000000000000000000000000000000000000000000000000000000000218213
                 8e0989002b000027a1000000000000000000000000000000000000000000000000005400031e6
                 20a098d730000000e000173e30000000a0000c2ad000000000000000000000000000000000000
                 00000000000000000000000000000000000000000000000000000000000000026fd8012e01130
                 1200000020710b910d90000000000000000000000000000000000000000000000000000005300
                 010bfe00000000000000010000000000000000000003e80464000500000000000000000000000
                 00000000000001b58000000000204001700000000000000000000000000000000000001a80000
                 000000000000000001a800002c24000000000000000000002c240000000f00050b5331ce00000
                 0a9000278b1000000010004c35f0000004f000196420000004e0001709a000000c100004ad200
                 0016f300000000000000000000000000000000000000000000000000000000000003e80000016
                 30000000000171428faba000f1e00100441644d4b000904ec006016300000000000004d4b0000
                 000000004150415000000ca30c98000300000c9f0c9e0c9a0c9a0ca10ca00c9b0c98000000000
                 00000000000046504e1005300010bfe0000000004070000000000000000000000000000006300
                 0327470000006200027ef600002bc000002bc0000000180000000000000000000000000000000
                 00000000000000000000000000000000000000000000000000000000000000000000000000000
                 00000000000000000000000000000000000000000000000000000000000000000000000000000
                 000000000010ca30c98000300300006002800a40091000400010000001b001600000000000000
                 00004100c00000000000000000000000000000000000000000000000000000000000000000000
                 000000000000000000000000000000000000000000000000000000000eb6f
         - Growatt new layout processing
                 - decrypt       :  True
                 - offset        :  6
                 - record layout :  T06NNNNXSPH

         - Grott data record date/time processing started
         - no or no valid time/date found, grott server time will be used (buffer records not sent!)
         - Grott values retrieved:
                 -  datalogserial        :  NAC3915162
                 -  pvserial             :  NWCPA47006
                 -  pvstatus             :  5
                 -  pvpowerin            :  470.0
                 -  pv1voltage           :  270.6
                 -  pv1current           :  0.8
                 -  pv1watt              :  239.6
                 -  pv2voltage           :  224.8
                 -  pv2current           :  1.0
                 -  pv2watt              :  233.9
                 -  pvpowerout           :  857.8
                 -  pvfrequentie         :  50.1
                 -  pvgridvoltage        :  244.1
                 -  pvgridcurrent        :  4.3
                 -  pvgridpower          :  1014.5
                 -  pvgridvoltage2       :  0.0
                 -  pvgridcurrent2       :  0.0
                 -  pvgridpower2         :  0.0
                 -  pvgridvoltage3       :  0.0
                 -  pvgridcurrent3       :  0.0
                 -  pvgridpower3         :  0.0
                 -  totworktime          :  23388.6
                 -  eactoday             :  8.4
                 -  pvenergytoday        :  8.4
                 -  eactotal             :  20438.6
                 -  epvtotal             :  15970.4
                 -  epv1today            :  1.4
                 -  epv1total            :  9520.3
                 -  epv2today            :  1.0
                 -  epv2total            :  4983.7
                 -  pvtemperature        :  30.2
                 -  pvipmtemperature     :  27.5
                 -  pvboosttemp          :  28.8
                 -  bat_dsp              :  51.9
                 -  eacharge_today       :  8.3
                 -  eacharge_total       :  6860.6
                 -  batterytype          :  1
                 -  uwsysworkmode        :  5
                 -  systemfaultword0     :  0
                 -  systemfaultword1     :  0
                 -  systemfaultword2     :  0
                 -  systemfaultword3     :  0
                 -  systemfaultword4     :  0
                 -  systemfaultword5     :  0
                 -  systemfaultword6     :  0
                 -  systemfaultword7     :  0
                 -  pdischarge1          :  700.0
                 -  p1charge1            :  0.0
                 -  vbat                 :  51.6
                 -  SOC                  :  0.2
                 -  pactouserr           :  0.0
                 -  pactousertot         :  0.0
                 -  pactogridr           :  42.4
                 -  pactogridtot         :  42.4
                 -  plocaloadr           :  1130.0
                 -  plocaloadtot         :  1130.0
                 -  spdspstatus          :  0.5
                 -  spbusvolt            :  289.9
                 -  etouser_tod          :  16.9
                 -  etouser_tot          :  16196.9
                 -  etogrid_tod          :  0.1
                 -  etogrid_tot          :  31215.9
                 -  edischarge1_tod      :  7.9
                 -  edischarge1_tot      :  10400.2
                 -  eharge1_tod          :  7.8
                 -  eharge1_tot          :  9436.2
                 -  elocalload_tod       :  19.3
                 -  elocalload_tot       :  1915.4
         - MQTT jsonmsg:
                         {"device": "NWCPA47006", "time": "2024-01-25T13:34:12", "buffered": "no",
                         "values": {"datalogserial": "NAC3915162", "pvserial": "NWCPA47006",
                         "pvstatus": 5, "pvpowerin": 4700, "pv1voltage": 2706, "pv1current": 8,
                         "pv1watt": 2396, "pv2voltage": 2248, "pv2current": 10, "pv2watt": 2339,
                         "pvpowerout": 8578, "pvfrequentie": 5006, "pvgridvoltage": 2441,
                         "pvgridcurrent": 43, "pvgridpower": 10145, "pvgridvoltage2": 0,
                         "pvgridcurrent2": 0, "pvgridpower2": 0, "pvgridvoltage3": 0,
                         "pvgridcurrent3": 0, "pvgridpower3": 0, "totworktime": 168398195,
                         "eactoday": 84, "pvenergytoday": 84, "eactotal": 204386, "epvtotal": 159704,
                         "epv1today": 14, "epv1total": 95203, "epv2today": 10, "epv2total": 49837,
                         "pvtemperature": 302, "pvipmtemperature": 275, "pvboosttemp": 288,
                         "bat_dsp": 519, "eacharge_today": 83, "eacharge_total": 68606,
                         "batterytype": 1, "uwsysworkmode": 5, "systemfaultword0": 0,
                         "systemfaultword1": 0, "systemfaultword2": 0, "systemfaultword3": 0,
                         "systemfaultword4": 0, "systemfaultword5": 0, "systemfaultword6": 0,
                         "systemfaultword7": 0, "pdischarge1": 7000, "p1charge1": 0, "vbat": 516,
                         "SOC": 23, "pactouserr": 0, "pactousertot": 0, "pactogridr": 424,
                         "pactogridtot": 424, "plocaloadr": 11300, "plocaloadtot": 11300,
                         "spdspstatus": 5, "spbusvolt": 2899, "etouser_tod": 169, "etouser_tot":
                         161969, "etogrid_tod": 1, "etogrid_tot": 312159, "edischarge1_tod": 79,
                         "edischarge1_tot": 104002, "eharge1_tod": 78, "eharge1_tot": 94362,
                         "elocalload_tod": 193, "elocalload_tot": 19154}}
         - Grott MQTT topic used : energy/growatt
         - MQTT message message sent
         - Grott Send data to PVOutput disabled
         - Grott Send data to Influx disabled
         - Grott extension processing started :  grotcsv
         - Grott extension module entered

I get one of those every minute when my datalogger publishes data.

AlesPokorny commented 5 months ago

yes that's the only thing I get so I guess Grott is not receiving anything. The weird thing is that I can still see the data in server.growatt.com, which makes me think that the changes I made in the Datalogger did absolutely nothing. I even tried to power cycle it and nothing... Do you know what could cause this?

muppet3000 commented 5 months ago

I was just about to suggest a power-cycle.

Maybe worth setting them back to the defaults (server.growatt.com) and then trying the process again. But if they're not showing up in Grott then I reckon they're still just going directly to growatt for some reason....

AlesPokorny commented 5 months ago

ok so I changed it back to defaults > powercycle > back to grott > powercycle and now grott receives the data... growatt works in mysterious way. Now even in MQTT I can see every minute a new client connected and disconnected but still can't see the data in home assistant

1706192070: New connection from 172.25.0.1:40412 on port 1883.
1706192070: New client connected from 172.25.0.1:40412 as automatic (p2, c1, k60).
1706192070: Client automatic disconnected.
1706192130: New connection from 172.25.0.1:40634 on port 1883.
1706192130: New client connected from 172.25.0.1:40634 as automatic (p2, c1, k60).
1706192130: Client automatic disconnected.
1706192132: New connection from 172.25.0.1:40652 on port 1883.
1706192132: New client connected from 172.25.0.1:40652 as automatic (p2, c1, k60).
1706192132: Client automatic disconnected.
1706192192: New connection from 172.25.0.1:40860 on port 1883.
1706192192: New client connected from 172.25.0.1:40860 as automatic (p2, c1, k60).
1706192192: Client automatic disconnected.
muppet3000 commented 5 months ago

ok, so you have logs in Grott now and you've got data being spewed into MQTT. All good.

So you've installed my integration right? All of the data should appear in that integration and look something like this: image

Have you remembered to use the MQTT integration in Home Assistant? Once you have the MQTT integration setup and you add the Grott integration the Integration should consume it straight from the MQTT listener in HA.

AlesPokorny commented 5 months ago

Aaaah I was looking at the wrong place. I thought I would also see it in the MQTT integration but that one shows absolutely nothing, while it is all in your integration. Thanks man! I will buy you a coffee ☕

muppet3000 commented 5 months ago

No problem, the dedicated integration does all the sexy formatting to make sure that power rates are tracked correctly and that all the stats can be used on the energy dashboard etc. You can do native publishing of stuff via MQTT but this method felt a bit cleaner for growth in the future e.g. re-configuring the inverter etc.