Python Plugin: Growatt Inverter

Python and python framework

Moderator: leecollings

User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python Plugin: Growatt Inverter

Post by sincze »

Should be possible I think but needs work.
Maybe Growatt returns both the inverters in the JSON. Not sure.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
nitpicker
Posts: 69
Joined: Tuesday 29 July 2014 10:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Growatt Inverter

Post by nitpicker »

When I check the debug log, then only the new one (installed yesterday) is returned now. So the values of the new inverter are now written in the first inverter log. So the data is not correct anymore...
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python Plugin: Growatt Inverter

Post by sincze »

Does it show up in Growatt as 2 converters? then it should be able to be splitted indeed

Other dirty option would be.... create second growatt account... attach 2nd converter to second account and add an additional plugin for second inverter.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
nitpicker
Posts: 69
Joined: Tuesday 29 July 2014 10:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Growatt Inverter

Post by nitpicker »

sincze wrote: Tuesday 08 September 2020 18:03 Does it show up in Growatt as 2 converters? then it should be able to be splitted indeed

Other dirty option would be.... create second growatt account... attach 2nd converter to second account and add an additional plugin for second inverter.
They are both showing on the website of Growatt, but the script returns only the newly added one.

To create a second account is indeed a dirty option :D
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python Plugin: Growatt Inverter

Post by sincze »

In the debug log do you see multiple entries for:
['powerValue'] and ['totalValue'] ?
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
nitpicker
Posts: 69
Joined: Tuesday 29 July 2014 10:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Growatt Inverter

Post by nitpicker »

Yes, I see both one time, in the line: "(GrowattMain) Retrieved following json:..."
nitpicker
Posts: 69
Joined: Tuesday 29 July 2014 10:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Growatt Inverter

Post by nitpicker »

sincze wrote: Tuesday 08 September 2020 18:03 Other dirty option would be.... create second growatt account... attach 2nd converter to second account and add an additional plugin for second inverter.
Ok... ok... I used the dirty option :oops:

It works, so, happy now
cORT3X
Posts: 1
Joined: Saturday 20 September 2014 19:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Growatt Inverter

Post by cORT3X »

hello :)

i tried addin this script for my domoticz system,
but i does not show up in the hardware list
any suggestions ?
i did add chmod + x and restarted

thanks
nitpicker
Posts: 69
Joined: Tuesday 29 July 2014 10:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Growatt Inverter

Post by nitpicker »

Did you allow 'Accept new Hardware Devices'?
User avatar
Rolandet
Posts: 95
Joined: Thursday 31 January 2019 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: Python Plugin: Growatt Inverter

Post by Rolandet »

Hi all

Since several days i'm not receiving any data from the portal anymore.

According to the log it should all work just fine, but the counters all remain on zero.

Here's an example of my log:

Code: Select all

 2021-10-17 17:07:56.592 Growatt: (Growatt) Login Succesfull
2021-10-17 17:07:56.592 Growatt: (Growatt) Plant ID: 324242 was found
2021-10-17 17:07:56.592 Growatt: (Growatt) Analyzing Data (3):
2021-10-17 17:07:56.592 Growatt: (Growatt) ---> Headers found
2021-10-17 17:07:56.592 Growatt: (Growatt) ---> Process Cookie Started
2021-10-17 17:07:56.592 Growatt: (Growatt) ---> SessionID found: 4B8E7A774DBD176C0E8926AD29F5517E
2021-10-17 17:07:56.593 Growatt: (Growatt) ---> ServerID found: 6ce0ae79fda023b3d5fed64b691287ab|1634483276|1634483276
2021-10-17 17:07:56.593 Growatt: (Growatt) Request Data with retrieved cookie!
2021-10-17 17:07:56.593 Growatt: (Growatt) Pushing 'WriteDirective' on to queue
2021-10-17 17:07:56.593 (Growatt) Processing 'WriteDirective' message
2021-10-17 17:07:56.593 Growatt: (Growatt) Sending 410 bytes of data 
Can anyone point me in the right direction to firx this?
Custodes Septentrionum
sstolk
Posts: 28
Joined: Tuesday 03 December 2013 9:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Growatt Inverter

Post by sstolk »

After further research the Growatt API is not right in Domoticz but OK in PVOutput.

Domoticz device filled by this script:
Image
What you are seeing here is the TOTAL amount of produced power for the whole plant since installation.
Not the daily produced kWh.

Domoticz as of today where you can see where it went skyhigh:
Image

The total amount is the only thing Domoticz keeps track off but not PVOutput.

I think something has changed in the Growatt API since 7 june 2022.
Can somebody confirm the same issue?
nitpicker
Posts: 69
Joined: Tuesday 29 July 2014 10:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Contact:

Re: Python Plugin: Growatt Inverter

Post by nitpicker »

The pass2php script was changed:

define('LOGIN_FORM_URL', 'https://server-api.growatt.com/newTwoLoginAPI.do'); // 16-06-2022: URL of the login form.
define('LOGIN_ACTION_URL', 'https://server-api.growatt.com/newTwoLoginAPI.do'); // 16-06-2022: Login action URL. Sometimes, this is the same URL as the login form.

So maybe this script also need to change
vespino
Posts: 49
Joined: Tuesday 05 August 2014 14:41
Target OS: Linux
Domoticz version:

Re: Python Plugin: Growatt Inverter

Post by vespino »

This plugin worked for a decent amount of time, but I'm now getting the following errors:

Code: Select all

2022-08-03 09:24:20.647 Error: Growatt: Call to function 'onStart' failed, exception details:
2022-08-03 09:24:20.655 Error: Growatt: Traceback (most recent call last):
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 264, in onStart
2022-08-03 09:24:20.655 Error: Growatt: _plugin.onStart()
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 136, in onStart
2022-08-03 09:24:20.655 Error: Growatt: createDevices()
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 353, in createDevices
2022-08-03 09:24:20.655 Error: Growatt: image = Images["Growatt"].ID # Get id from database
2022-08-03 09:24:20.655 Error: Growatt: KeyError: 'Growatt'
Any thoughts?
User avatar
Rolandet
Posts: 95
Joined: Thursday 31 January 2019 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: Python Plugin: Growatt Inverter

Post by Rolandet »

vespino wrote: Wednesday 03 August 2022 9:25 This plugin worked for a decent amount of time, but I'm now getting the following errors:

Code: Select all

2022-08-03 09:24:20.647 Error: Growatt: Call to function 'onStart' failed, exception details:
2022-08-03 09:24:20.655 Error: Growatt: Traceback (most recent call last):
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 264, in onStart
2022-08-03 09:24:20.655 Error: Growatt: _plugin.onStart()
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 136, in onStart
2022-08-03 09:24:20.655 Error: Growatt: createDevices()
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 353, in createDevices
2022-08-03 09:24:20.655 Error: Growatt: image = Images["Growatt"].ID # Get id from database
2022-08-03 09:24:20.655 Error: Growatt: KeyError: 'Growatt'
Any thoughts?
Try renaming the Hardware device and save

My connection failes from time to time. Whenever I just change the name a bit, it seems to re-initialise the connection with growatts server
Custodes Septentrionum
User avatar
waltervl
Posts: 5846
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Growatt Inverter

Post by waltervl »

Rolandet wrote: Wednesday 03 August 2022 16:03 Try renaming the Hardware device and save

My connection failes from time to time. Whenever I just change the name a bit, it seems to re-initialise the connection with growatts server
TIP: Just pressing the update button without a (small) change will also stop and (re)start a plugin.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
Rolandet
Posts: 95
Joined: Thursday 31 January 2019 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: Python Plugin: Growatt Inverter

Post by Rolandet »

:D
waltervl wrote: Wednesday 03 August 2022 17:05
Rolandet wrote: Wednesday 03 August 2022 16:03 Try renaming the Hardware device and save

My connection failes from time to time. Whenever I just change the name a bit, it seems to re-initialise the connection with growatts server
TIP: Just pressing the update button without a (small) change will also stop and (re)start a plugin.
:D really? Haha ever knew that
Custodes Septentrionum
vespino
Posts: 49
Joined: Tuesday 05 August 2014 14:41
Target OS: Linux
Domoticz version:

Re: Python Plugin: Growatt Inverter

Post by vespino »

No luck.
User avatar
waltervl
Posts: 5846
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Growatt Inverter

Post by waltervl »

vespino wrote: Wednesday 03 August 2022 9:25 This plugin worked for a decent amount of time, but I'm now getting the following errors:

Code: Select all

2022-08-03 09:24:20.647 Error: Growatt: Call to function 'onStart' failed, exception details:
2022-08-03 09:24:20.655 Error: Growatt: Traceback (most recent call last):
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 264, in onStart
2022-08-03 09:24:20.655 Error: Growatt: _plugin.onStart()
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 136, in onStart
2022-08-03 09:24:20.655 Error: Growatt: createDevices()
2022-08-03 09:24:20.655 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 353, in createDevices
2022-08-03 09:24:20.655 Error: Growatt: image = Images["Growatt"].ID # Get id from database
2022-08-03 09:24:20.655 Error: Growatt: KeyError: 'Growatt'
Any thoughts?
Seems to be related to a custom icon set? Try to upload the icon zip file from the plugin folder again. See wiki page https://www.domoticz.com/wiki/Custom_ic ... binterface
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
vespino
Posts: 49
Joined: Tuesday 05 August 2014 14:41
Target OS: Linux
Domoticz version:

Re: Python Plugin: Growatt Inverter

Post by vespino »

Thanks @waltervl that did indeed solve the issue for me!
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Re: Python Plugin: Growatt Inverter

Post by jacobsentertainment »

Hi all,

I currently have issues with the growatt plugin, see topic

Code: Select all

2022-10-15 11:45:00.625 Error: Growatt: Google returned a status: 502
2022-10-15 11:55:05.127 Error: Growatt: Google returned a Server Error
Sometimes the plugin freezes up and doesn't update anymore due to the above errors. So I tried setting a timeout but that crashes domoticz and my pi to (domoticz doesn't respond and the pi gets so slow it needs rebooting) Also when I manually switch of the plugin (what acts as a restart of the plugin) domoticz crashes as mentioned above.

If more info is needed about logs or so please let me know. The plugin is important to me :o
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests