just to give you - and those who are reading this topic later - an update about the progress in the past view days and my journey struggling with documentation and what not.
I had to prepare and set up mqtt in home assistant with these steps (and I hope that I will not have missed one cause it was a trial and error mess over days) after I had watched a few videos about the topic in general , but most of those were specific to achieve a goal like measuring water consumption (which I can remember). At least I was able to understand how to set the mqqt thing up properly in HA and learned how it should work and how to play around using the mqtt explorer. Good to get familiar with the whole topic in general first cause grott is again a different beast and the documentation not always helpfull or right or questionable. If you find the topic for multiple growatt inverter support then you will find a grott ini parameter described as
#1
for safety reasons the HA mqtt addon will need a user and a passwort so I had to add the new HA user via settings - person - then the tab user - add new user
name: mymqtt
pw: mymqtt
#2
I installed the mosquitto broker from the ha addon store found in settings and used the configuration tab to set it up seen as seen in this yaml:
logins:
- username: mymqtt
password: mymqtt
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
active: false
folder: mosquitto
#3
Then I opened the configurations and set up the mqqt integration by pressing “configure” . I ended up in a page with the headline setting where the first point is a blue “mqqt new configuration” option I pressed.
I did not change anything except adding the user mymqtt and his pw
I pressed continue and changed nothing on the following page. I pressed SEND at the bottom
#4
At that point I pressed on the bottom of the mqtt setting page the blue button listen which after that switched to “cancel listening”
I also added in the listen to the later needed topic “energy/growatt”.
Once that was done I copied the topic from there to the top where it offers a "release packet " and pasted the same “energy/growatt” in the topic and wrote a message aka Payload called “hurz” which after pressing the blue realease button below would reappeat in the listening section with a time stamp and counter:
#5
At this point I went ahead and also installed mqtt explorer which will be later helpfull to get behind the messages or the flood of those at least if you have many devices.
You can establish a connection and then do the same: send message to certain topics and listen to them. Of cause this is not needed nor mandatory I guess.
#6
Now it was time to continue the growatt journey at the point mentioned in my previous message, which was the constant flow of errors
then I installed the mqtt explorer to play around and listen and publish my own topic and how this explorer interacted with the mqtt integration.
my core question and issue was how to establish the whole mqqt connection.
Simple as described above and then the things required for the grott.ini
Assuming HA is running on ip whatsoever.2 and grott is running on a different device on ip whatsoever.26 you only have to change the settings here by removing the #
I have added my lines instead to make my changes more clear
[MQTT]
nomqtt = False
#ip = localhost
ip = whatsoever.2
port = 1883
topic= energy/growatt
#auth = False
auth = False
#user = grott
user = mymqtt
#password = growatt2020
password = mymqtt
So all the 5 steps before were a simple preparation needed to get it running, but remember my question “how to establish a connection successfully” ?
I had asked cause it did not work at all. I got rejections, server disconnected and what not believe is so tiny.
I had removed all those not needed # when I thought I would need such parameter, but was not thinking so much about, what it meant.
auth = False
This line had stopped my installation from working 24 or 36 hours cause it simply means that even though user and password are in that setup defined grott would not send these to the HA mqtt broker and therefore the HA mqtt broker did not get messages. Grott says that the authentification did not work.
After changing that line to auth = True
boy the messages came in cause in the meantime I had added more inverters / sticks to grott from the smallest to the biggest.
#7
To achieve that you will need to enable a feature called Multi Inverter Support as described here
If you have only 1 type basic inverter (TL-S, TL-X). Grott will work out of the box.
* For MQTT the device (PVSerial) is defined as "key" in the JSON Message
* if you want separate topics for each inverter you can add to the [MQTT] section of the grott.ini:
`mqttinverterintopic="True"`
or for docker
`-e gmqttinverterintopic="True"`
The inverterid will be added to the topic (e.g: `energy/growatt/<your pvserial>`)
But after so much trouble I was not sure if that can be true, cause why should the option in the grott.ini now beng set in " ", while in the grott.ini lines above it was a simple
auth = False
and not
auth = "False"
#8
And that is where I am right now: getting a flood of messages from about 4 or 5 inverters every few seconds cause my stick is set up to send messages every minute to the growatt server.
#9
And now I will have to find a way to get these growatt data in HA by hand or switch to the HA integration Muppet3000 has provided. But I guess I will try to implement the first inverter by hand to see how it works before I move ahead.
How did you set the sensors delivered by grott in HA up ?
And for those who are also struggling as I was struggling here a picture of how it would look like once it is working right
Main issue was the line MQTT message - message sent were I had gotten authentification errors. If you wanna use the developers ini with the user grott and pw growatt2020 make sure that you create such user in HA first , then configure that in the mqtt broker and finally reboot.
This is a screenshot from grott running on a pi 3 installed and started manually as described here and in the grott description after getting the grott.ini right
Finally: do not try this without the proper awareness that you really have a daylight aka that the inverter is running. After sunset or when the inverter had turned to idle grott will start but show no progress or messages on the screen, not before the sun is providing so much daylight that the growatt inverter will wake up again and start sending data to the cloud cause then you will also see the messages being sent as shown here.