sincze / Domoticz-Growatt-Webserver-Plugin

16 stars 10 forks source link

Growatt Webserver Plug in stopped working #40

Closed Cees2439867 closed 1 year ago

Cees2439867 commented 1 year ago

Hello All, Just the last two days I am struggling getting the readout of my Growall inverter working again as it shows on the following picture:

afbeelding Anyone have an idea or maybe a solution?

bmjvannunen commented 1 year ago

I am experiencing the same error since around 8:00 (GMT+2) on Tuesday August 15. The plugin exits with: Error: Growatt: Growatt returned a status: 405

It seems Growatt has changed the api (login) again.

sincze commented 1 year ago

Mmm indeed 15-08-2023 07:55 indeed. Needs investigation guys.

I see similar results for Omnik and Solis Inverters.

tonbor commented 1 year ago

Fine if the updates are minimized so accounts will not be locked anymore.

sincze commented 1 year ago

Fine if the updates are minimized so accounts will not be locked anymore.

Lock outs?? Mmm never experienced that with pass2php those run exactly every 5 minutes.

tonbor commented 1 year ago

Fine if the updates are minimized so accounts will not be locked anymore.

Lock outs?? Mmm never experienced that with pass2php those run exactly every 5 minutes.

This is the Plug in!

sincze commented 1 year ago

Fine if the updates are minimized so accounts will not be locked anymore.

Lock outs?? Mmm never experienced that with pass2php those run exactly every 5 minutes.

This is the Plug in!

I got that, hence I use Pass2PhP ;-) , both came from the same guy that has limited amount of time ;-) and both are experiencing the same issue. First up on the list is fix Pass2PHP

HarryVerjans commented 1 year ago

Fine if the updates are minimized so accounts will not be locked anymore.

Lock outs?? Mmm never experienced that with pass2php those run exactly every 5 minutes.

I am also having the same issue, but is there an php for Growatt to fetch the data? Where can i find the source?

jan-vandenberg commented 1 year ago

I also had this problem, see here: https://www.domoticz.com/forum/viewtopic.php?p=299171#p299171

sincze commented 1 year ago

Looked at the APP and did not want to work with me using a proxy in between. So felt a bit lazy today. image

image

Solves the issue if you are able to run node-red.

Cees2439867 commented 1 year ago

Just found out I am writing on the wrong software package, I use growatt-inverter.php. Hoping a lot you will update it? Would be much obliged. Thanks for helping us.

sincze commented 1 year ago

For the moment I have the data flowing in via Node-Red. Now I can have a look at their login mechanism as that was changed.

image

HarryVerjans commented 1 year ago

image The Growatt Plugin at my brother is not working 100% but much better than my own implementation. I installed his version on 18 december 2022. I do not know if the 1061,8 Watt over a longer period is actual correct data.

sincze commented 1 year ago

The problem is that recently they disabled the old entrypoints for data collection. Now even the app seems more secure ;-) than before.

HarryVerjans commented 1 year ago

My own current implementation is accessing too frequently de Api server, that causes a lock out of the web account. As this happens access via Shine Phone is also blocked. Access via webbrowser is in this case no problem. Is there a possibility to limit the access of the plugin to less connections. Is the runagain parameter an option to do this.?

sincze commented 1 year ago

My own current implementation is accessing too frequently de Api server, that causes a lock out of the web account. As this happens access via Shine Phone is also blocked. Access via webbrowser is in this case no problem. Is there a possibility to limit the access of the plugin to less connections. Is the runagain parameter an option to do this.?

published on github so i can have a look?

HarryVerjans commented 1 year ago

image

At this moment my own implementation of the plugin, that is updated yesterday from github, is running oké. My brothers is stuck, I better did nog mention it was running better. I changed the parameter runagain from 6 to 18 if this is the solution I do not know. In the morning the plugin is struggling in starting up. I wil look in the morning how it is running and report here.

oepi-loepi commented 1 year ago

I am developer of a Growatt plugin for the toon thermostat (rooted). This also did stop working some days ago.

Odd thing is that the plugin still works in my qml debugger (Windows) without any problem. Only when i put it in Postman, a curl request or an xml request from a linux device it does give the 405 error.

oepi-loepi commented 1 year ago

https://github.com/ToonSoftwareCollective/solarpanel-plugins/blob/main/GROW1.plugin.txt

Deze werkt dus wel in mijn qml debugger maar niet meer op de toon sinds een paar dagen.

oepi-loepi commented 1 year ago

GOT IT WORKING ! I now changed my scripts for toon and is working: First check server server-api.growatt.com. If this gives a 405 error try again but now server.growatt.com

https://github.com/ToonSoftwareCollective/solarpanel-plugins/blob/main/GROW1.plugin.txt

HarryVerjans commented 1 year ago

image

image

At this moment I am getting data every 5 minutes. But as I look at the graphs online and in Domoticz they do not match. Access looks oké but the data from the API is not so accurate. Entrypoint 08:00 08:05 and 08:10 are having the same power value. But for the moment I am happy that there is a working data connection. But changing parameter runagain from 6 to 18 is not the solution, I guess.

Cees2439867 commented 1 year ago

Yes, just changed three instances of server-api.growatt.com to server.growatt.com in the file growatt-inverter.php and yes it works again: afbeelding The values are terrible now. I will change that in the database tomorrow. So Happy! Thanks to you all, certainly "oepi-loepi" and Sandor of course.

sincze commented 1 year ago

Haha Cees, no PR ;-) Let me change to server-api.growatt.com to server.growatt.com

13:35 Updated the Pass2PHP file, changes needed on 3 locations.

sincze commented 1 year ago

Updated the plugin to 1.0.3 according to the Pass2PHP urls provided by "oepi-loepi" and @Cees2439867

tonbor commented 1 year ago

And less updates so no more locks?

oepi-loepi commented 1 year ago

@sincze maybe do the double check since they might change server again in future.

tonbor commented 1 year ago

Error: Growatt Inverter: (GrowattWeb) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Growatt-Webserver-Plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'. 2023-08-20 15:57:25.786 Error: Growatt Inverter: Exception: 'SyntaxError'. No traceback available.

tonbor commented 1 year ago

after git pull and rename growatt server, not working the latest was working in the evening, not working anymore......

HarryVerjans commented 1 year ago

What about the runAgain at line 227 should this also be changed in to 227? AND The // in line 84 results in a syntax error # should be used for comments in python ;-)

sincze commented 1 year ago

What about the runAgain at line 227 should this also be changed in to 227? AND The // in line 84 results in a syntax error # should be used for comments in python ;-)

Crap mixed up python and php.

tonbor commented 1 year ago

back to version 1.0.2

sincze commented 1 year ago

back to version 1.0.2

relax 1 typo and no errors as mentioned by @HarryVerjans Now have to wait and see what happens tomorrow. Maybe the response changed as well but at least the login is working again.

>'Data':'b'{"yearStr":"0kWh","weatherMap":...........,"eToday":0.0,"eTotal":13972.1,"energyMonth":0.0,"energyYear":0.0,"irradiance":0.0,"envTemp":0.0,"panelTemp":0.0,"windSpeed":0.0,"windAngle":0.0,"storage_TodayToUser":0.0,"storage_TotalToUser":0.0,"storage_TodayToGrid":0.0,"storage_TotalToGrid":0.0,"storage_eChargeToday":0.0,"storage_eDisChargeToday":0.0,"storage_BattoryPercentage":0,"hasDeviceOnLine":0,"hasStorage":0,"createDateText":"....

2023-08-20 22:05:43.588 Growatt: Currently producing: 0.0 Watt. Total produced: 13972.1 kWh in Wh that is: 13972100.0

sincze commented 1 year ago

Issue should be solved with latest 1.0.3

tonbor commented 1 year ago

2023-08-23 20:19:56.153 Status: Growatt: Initialized version 1.0.4, author 'sincze' 2023-08-23 20:19:56.158 Error: Growatt: Call to function 'onStart' failed, exception details: 2023-08-23 20:19:56.166 Error: Growatt: Traceback (most recent call last): 2023-08-23 20:19:56.166 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 262, in onStart 2023-08-23 20:19:56.166 Error: Growatt: _plugin.onStart() 2023-08-23 20:19:56.166 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 138, in onStart 2023-08-23 20:19:56.166 Error: Growatt: createDevices() 2023-08-23 20:19:56.166 Error: Growatt: File "/opt/domoticz/userdata/plugins/Domoticz-Growatt-Webserver-Plugin/plugin.py", line 351, in createDevices 2023-08-23 20:19:56.166 Error: Growatt: image = Images["Growatt"].ID # Get id from database 2023-08-23 20:19:56.166 Error: Growatt: KeyError: 'Growatt'

tonbor commented 1 year ago

no it is not

sincze commented 1 year ago

Remove your Growatt icons, that is what the error is all about!

tonbor commented 1 year ago

Ok, I did, indeed the plug in is working BUT still a locked Growatt account because of to often access by the plug in.

sincze commented 1 year ago

Ok, I did, indeed the plug in is working BUT still a locked Growatt account because of to often access by the plug in.

mmmm that is interesting... you clocked the five minutes ??? it should trigger every five minutes. else the 'run again' statement need to be modified twice with higher values.

tonbor commented 1 year ago

lockduration 24 2023-08-24 15:39:16.420 Growatt ***6;Path=/"] 2023-08-24 15:39:16.420 Growatt Inverter: Data':'b'f"back": ("msg":"507", "lockDuration":"24" success";false]]' 2023-08-24 15:39:16.421 Growatt Inverter: Retrieved following json: ("back": ("msg": "507" "lockDuration": "24", "success": false)> 2023-08-24 15:39:16.421 Growatt Inverter: Not received anything useful! 2023-08-24 15:39:16.421 Growatt Inverter: Acquiring GIL for 'onMessageCallback'

oepi-loepi commented 1 year ago

I have the same if i run multiple instances. E.g 2 toons, domoticz and the app. If i only run 1 instance i do not have this problem.

tonbor commented 1 year ago

Would be fine if the update interval could be chosen by the user himself

oepi-loepi commented 1 year ago

Not for my toon app since the database runs at 5 minute interval

oepi-loepi commented 1 year ago

And you can choose allready in the domoticz plugin if you change the interval in your cron action? So why you need such option?

sincze commented 1 year ago

WIth the php file it indeed it is easy to do it in cron (*/5) the others use the plugin. But PR's are more than welcome.

tonbor commented 1 year ago

php is not a plugin