Anyone experience with connecting a Growatt solar-inverter?

That’s more than i got :wink: I don’t seem to get te custom_component thing working…

I did see on github that there is a integrated component coming, I guess in this wensday

That would be super!

If you are that far you must have the sensor working have you added it to the Lovelace card?
I was using

 _LOGGER.error(
                "Growatt data is. {}".format(kw))

as sort of print command, should have used

 _LOGGER.info(
                "Growatt data is. {}".format(kw))
``` instead

V0.90 is online, no Growatt component…would have been great.

Point 4.2.5 in the manual.
Address:http://domain/v1/plant/data

Are you able to get a json output and paste it here. May be able to do what I did with my fronius inverter using json.

@anilet the syntax for custom_components is changed, I have now put the code above in the file ./custom_components/growatt/sensor.py

@Paul_Flavel Finally got my Growatt sensor working as a custom-component:

I also installed this on my Hassbian-Pi: API client by Sjord

When I start this python script with:

python -m growatt username password

I get a return with lot more “values” from the Growatt-server/API. Since I’m not a programmer, could you please show me how to add all these in the above python-script to get them to show up in HomeAssistant?

{‘totalData’: {‘isHaveStorage’: ‘false’, ‘CO2Sum’: ‘368.69 T’, ‘totalEnergySum’: ‘369.8 kWh’, ‘currentPowerSum’: ‘1.25 kW’, ‘eTotalMoneyText’: ‘78.2 (€)’, ‘todayEnergySum’: ‘14 kWh’}, ‘success’: True, ‘data’: [{‘plantName’: ‘4936 - Duhen’, ‘isHaveStorage’: ‘false’, ‘plantMoneyText’: ‘78.2 (€)’, ‘currentPower’: ‘1.25 kW’, ‘todayEnergy’: ‘14 kWh’, ‘plantId’: ‘71635’, ‘totalEnergy’: ‘369.8 kWh’}]}

{‘success’: True, ‘plantData’: {‘plantName’: ‘4936 - Duhen’, ‘plantMoneyText’: ‘3.0 (€)’, ‘plantId’: ‘71635’, ‘currentEnergy’: ‘14 kWh’}, ‘data’: {‘12:30’: ‘2182.05’, ‘13:30’: ‘1987.75’, ‘05:30’: ‘0’, ‘06:30’: ‘6.97’, ‘03:00’: ‘0’, ‘01:00’: ‘0’, ‘07:30’: ‘398.25’, ‘06:00’: ‘0’, ‘04:00’: ‘0’, ‘13:00’: ‘2128.67’, ‘12:00’: ‘2201.13’, ‘02:00’: ‘0’, ‘11:00’: ‘2136.43’, ‘09:00’: ‘1446.27’, ‘02:30’: ‘0’, ‘08:00’: ‘813.77’, ‘11:30’: ‘2188.67’, ‘14:30’: ‘1655.96’, ‘10:00’: ‘1919.92’, ‘04:30’: ‘0’, ‘10:30’: ‘2063.47’, ‘15:00’: ‘1457.63’, ‘00:30’: ‘0’, ‘01:30’: ‘0’, ‘09:30’: ‘1697.6’, ‘05:00’: ‘0’, ‘03:30’: ‘0’, ‘14:00’: ‘1831.33’, ‘08:30’: ‘1162.35’, ‘07:00’: ‘102.72’}}

Happy that you got the sensor working.
Most of these are historical data like total energy produced, total co2 reduced etc which are no interest to me or are easily calculated from HA>Influxdb>Grafana. The second part is the hourly data for charting on their site which we can get from HA anyway.

@anilet I think HA 0.92 broke my Growatt custom-component. Any ideas on how to get it going again?

  1. Move and rename growatt.py file to custom_components/growatt/sensor.py

  2. Create an empty init.py file in custom_components/growatt/

  3. Create manifest.json file in custom_components/growatt/ with

{
 "domain": "growatt",
 "name": "Growatt Sensor",
 "documentation": "",
 "dependencies": [],
 "codeowners": [],
 "requirements": []
} 

Thanks! Will try when I get home tonight

Works like a charm again, thanks a lot!

Also getting the same error, how did you get past this?

just follow the steps in anilet’s last post, that should do the trick

If you are stuck at the above error you can safely ignore it. That was a leftover from my testing,I have updated the code above to remove it.
If you are stuck at the new custom component format error follow instructions here
I have uploaded the custom_component to Github here

1 Like

Hi,
If I have 2 plants in 1 account, how do I create 2 sensors and monitor them separately? Please help me

I do not have access to an account with 2 or more plants, it is impossible to get it working without one.
Can you download growatt_api_client and run it

python -m growatt username password

and send me the output.

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)