Anyone experience with connecting a Growatt solar-inverter?

On the other hand can you show me how to display the daily data and graph? Thank you
My output here:

{‘data’: [{‘plantMoneyText’: '914845.8 ', ‘plantName’: ‘VamLang’, ‘plantId’: ‘169382’, ‘isHaveStorage’: ‘false’, ‘todayEnergy’: ‘41.5 kWh’, ‘totalEnergy’: ‘428.7 kWh’, ‘currentPower’: ‘0 W’}, {‘plantMoneyText’: '1158975.4 ', ‘plantName’: ‘HuuDatHCM’, ‘plantId’: ‘158250’, ‘isHaveStorage’: ‘false’, ‘todayEnergy’: ‘11.3 kWh’, ‘totalEnergy’: ‘543.1 kWh’, ‘currentPower’: ‘0 W’}], ‘totalData’: {‘currentPowerSum’: ‘0 W’, ‘CO2Sum’: ‘971.8 T’, ‘isHaveStorage’: ‘false’, ‘eTotalMoneyText’: '2073821.2 ', ‘todayEnergySum’: ‘52.8 kWh’, ‘totalEnergySum’: ‘971.8 kWh’}, ‘success’: True}

{‘plantData’: {‘plantMoneyText’: '88561.0 ', ‘plantName’: ‘VamLang’, ‘plantId’: ‘169382’, ‘currentEnergy’: ‘41.5 kWh’}, ‘data’: {‘15:00’: ‘2732.67’, ‘05:00’: ‘0’, ‘18:30’: ‘0’, ‘11:30’: ‘6174’, ‘12:00’: ‘7115.1’, ‘07:30’: ‘2849.67’, ‘08:30’: ‘2772.78’, ‘17:30’: ‘230.13’, ‘10:30’: ‘5191.07’, ‘09:00’: ‘4776.31’, ‘03:00’: ‘0’, ‘14:00’: ‘2209.38’, ‘16:00’: ‘3146.34’, ‘13:30’: ‘5131.08’, ‘02:00’: ‘0’, ‘01:00’: ‘0’, ‘12:30’: ‘5292.54’, ‘04:00’: ‘0’, ‘15:30’: ‘2869.51’, ‘06:30’: ‘482.87’, ‘07:00’: ‘1566.02’, ‘19:00’: ‘0’, ‘05:30’: ‘0’, ‘10:00’: ‘4410.84’, ‘17:00’: ‘931.12’, ‘09:30’: ‘4060.9’, ‘08:00’: ‘4211.44’, ‘03:30’: ‘0’, ‘11:00’: ‘5838.95’, ‘18:00’: ‘21.77’, ‘14:30’: ‘5297.4’, ‘01:30’: ‘0’, ‘04:30’: ‘0’, ‘06:00’: ‘281.13’, ‘13:00’: ‘3885.62’, ‘00:30’: ‘0’, ‘16:30’: ‘1805.45’, ‘02:30’: ‘0’}, ‘success’: True}

If you are ok with python modify custom_components/growatt/sensor.py to get data for 2 plants.
This sensor as it of now designed for single plants per user.

I have created a github repo to add my own functionality since i wasn’t happy with the result yet, i add multiple sensors for every inverter in a “plant” these have the current power output as it’s state, but it has a lot more info in it’s attributes. Even though i don’t personally have 2 plants, it wasn’t much work so i added a way to add multiple plants to it. Be sure to read the installation instructions in the readme.

To get the total of both plants together you may need to add a template sensor adding the value of both “growatt total” sensors together (i’m not sure if the total grabs the total of all plants)

@indykoning Thanks 4 your efforts! Looking good, now tying to get your new custom_component up and running…

Couldn’t have done it without Anil Roy since i’d have no idea where to start before the code from the start of this thread.

Let me know how getting it up and running went, and if it’s lacking any features.

I’m currently trying to make it so it can add more sensors for the inverters like the SolarEdge sensor so i don’t have to use template sensors to display data like the individual inputs on the inverter.

Hi,
I have a problem. My other plant consists of 2 inverter. Sometimes getting the total power (capacity) of both inverter, sometimes only get the power (capacity) of either
image

I have a mismatch with the timing on the total revenue per day. This sensor starts at 11:00 see:

For people with multiple plants (@Tran_Nhan ), i’m sorry i forgot to push my commit adding functionality for multiple plants. it’s on my repository now

It should go up together with the total energy today. And it retrieves this straight from growatt server, does it also go down to 0 on the app and growatt server website at 11:00? maybe it’s a setting on the growatt server. Mine resets back to 0 at 24:00

Good news the integration should be included in home assistant soon https://github.com/home-assistant/home-assistant/pull/25635

After which hopefully it’ll be in one of the coming updates.

1 Like

:grinning:
You’ve been working hard! Thanx!

It is now confirmed to be in the next update (0.99) :tada:

The update is out! https://www.home-assistant.io/blog/2019/09/18/release-99/

You will have to rename the platform from growatt to growat_server

Thanks for the great job writing this component!
Didn’t even know about this component till I saw the 0.99 release blog this morning.
Works straight out of the box!

Try it tonight, thanks again!

Hi everyone

I have had a go at adding some (rudimentary support) to encompass battery storage “state of charge” as well. It is a hack but I am hoping it will prove useful to some of you who also have storage batteries attached to their Growatt Systems.

You can find it in a fork: https://github.com/pobl/home-assistant/blob/782c7fdac640966fa7ffe9f928148f1581a703cd/homeassistant/components/growatt_server/sensor.py also you can find a stand alone battery sensor as a custom_component which is how this started life.

@indykoning I have not made a pull request as I thoroughly expect my code is super suboptimal (not been at this very long!) so any help tidying it up for future release would be obviously hugely welcome.

I would love to help, it is not too bad but it can be made a bit more efficient.

this is not really the way you’d want to do it, in case of someone having multiple plants. I had someone running into that issue a little bit higher up in this post.
Maybe you can search the array for the current plant id. after which you should check if the plant has isHaveStorage set to true since mine has that set to false and i do not have storageCapacity in my array

Maybe move this if down one so you have plant_info available to use, so you can make it so the sensor will only be added if it is available.

The stuff under here is very much optional.

Maybe you could replace the replace % with a more versatile regex like here, it only allows numbers, dots and commas to pass through

As a bonus maybe update this data handling class to turn is_total into a string variable like type so you can have the retrieving of the list handled in here.

I’m really happy there are more people eager to make this work well :smiley:

PS:


What you had in the previous commit looks really promising, i think all it needs is a new probe created and the probe being edited to accept 3 different sensor types instead of 2.

Hi pobl and others,

I have a similar setup with a Growatt inverter+PV panels and some batteries and wanted to see if I could get all those sensors into Home assistant. With indykoning’s help I’ve managed to parse the data received from Growatt and have singled out which parameters are meaningful and should be integrated into home assistant. Unfortunately I have no knowledge of Python but am willing to put in the time if I can be pointed in the right direction.
Can anyone help?

I am following this dicussion very closely.
I have a Growatt system with battery and the ‘Current power’ value is meaning less, this value represents what the inverter is outputting source being Solar panels or Battery or combined.
In theory this can be
Current generation (From Sun -> goes to local load)
Current generation (From Sun-> goes to local load + Battery storage)
Current generation (From Sun-> goes to local load + Battery Storage + Export to grid)
Current generation (From Battery-> local load)
Current generation (From Sun + Battery -> goes to local load)


Battery status, solar production, consumption etc would be more usefull data to support automatons based on these.

@indykoning I have a OneSolar inverter. The OneSolar wifi dongle seems to be a rebadged Growatt wifi dongle. Instead of connecting to the Growatt server, the dongle connects to the SMTEN server. Other than that, everything else seems to be exactly the same.

Using https://github.com/indykoning/PyPi_GrowattServer, I was able to connect to the SMTEN server and got some data back.

import growattServer

api = growattServer.GrowattApi()
api.server_url = 'http://server.smten.com/'
login_response = api.login(<username>, <password>)
#Get a list of growatt plants.
print(api.plant_list(login_response['userId']))

As you can see above, I used the api.server_url variable to point to the the SMTEN server instead of the default Growatt server.

Would it be possible to add server_url as an optional configuration item to the HomeAssistant Growatt component? That way, I would be able to get my invertor talking to HA.

Thanks!