Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

growatt script does not work anymore #18

Open
ariankoster opened this issue Aug 19, 2023 · 32 comments
Open

growatt script does not work anymore #18

ariankoster opened this issue Aug 19, 2023 · 32 comments

Comments

@ariankoster
Copy link

Since some days no values get in any more

@sincze
Copy link
Owner

sincze commented Aug 19, 2023

Unfortunately Growatt changed their login mechanism. So needs work to fix.

In meantime I easily migrated to Node-Red and now I have even more devices to chose from.
image

@Cees2439867
Copy link

Unfortunately it is broken again as the data this morning show:
afbeelding
Wrote an email to Dutch branch of Growatt how to get data from their servers...... Have little hope but one can try!

@Achterhoeker
Copy link

Unfortunately it is broken again as the data this morning show: afbeelding Wrote an email to Dutch branch of Growatt how to get data from their servers...... Have little hope but one can try!

I can confirm it is indeed broken again :-(

@sincze
Copy link
Owner

sincze commented Aug 22, 2023

The Node-Red version is still working.
image

Any error messages in from the script??

I notice 3 login attempts.

  1. POST https://oss.growatt.com/login / Host: oss.growatt.com
    userName=xx&password=&lang=en&loginTime=2023-08-22+10%3A49%3A58&noRecord=true&type=1&passwordCrc=xx

{"result":0,"msg":"Username needs to be at least 8 digits long"}

  1. POST https://oss.growatt.com/login / Host: oss.growatt.com
    userName=xx&password=&lang=en&loginTime=2023-08-22+10%3A49%3A58&type=1&passwordCrc=xx

{"result":0,"msg":"Username needs to be at least 8 digits long"}

  1. POST https://server.growatt.com/login Host: server.growatt.com
    account=xx&password=&validateCode=&isReadPact=0&passwordCrc=xx

{"result":1}

Using the script we see an HTTP Response of 403. (Not Authorized)

@Achterhoeker
Copy link

the plugin on https://github.com/sincze/Domoticz-Growatt-Webserver-Plugin/ is working again, the php script isn't.

@sincze
Copy link
Owner

sincze commented Aug 22, 2023

that is interesting indeed

@sincze
Copy link
Owner

sincze commented Aug 22, 2023

Will need some minor config changes. I need to add a additional function to extract the plantID and use that to request for the data.

define('HEADER',array('Content-Type: application/x-www-form-urlencoded;charset=UTF-8',
					  'Connection: keep-alive',
					  'Host: server.growatt.com',
					  'User-Agent: Domoticz/1.0'));

@sincze
Copy link
Owner

sincze commented Aug 22, 2023

the plugin on https://github.com/sincze/Domoticz-Growatt-Webserver-Plugin/ is working again, the php script isn't.

can you try with the current version ???

2023-08-22 20:29:02.467 Status: --->> Growatt inverter: Analyze HTTP for function retrieve_data called with HTTP code: 200
2023-08-22 20:29:02.471 Status: --->> Growatt inverter: Expected HTTP code: 200
2023-08-22 20:29:02.476 Status: --->> Growatt inverter: Let have a look at the received data!
2023-08-22 20:29:02.478 Status: --->> Growatt inverter: I did find JSON data to work with!
2023-08-22 20:29:02.481 Status: --->> Growatt Inverter: 0 Watt. Today: 10.9 kWH and total inverter is: 13997700 Wh for domoticz: 0;13997700

@Achterhoeker
Copy link

@sincze It works again:

2023-08-22 21:00:46.936 Status: --->> Cookie File: /home/ronald/domoticz/scripts/pass2php/growatt.cookie exists!
2023-08-22 21:00:46.938 Status: --->> Cookie File: /home/ronald/domoticz/scripts/pass2php/growatt.cookie is writable!
2023-08-22 21:00:47.015 Status: --->> Growatt Inverter: 16.5 for domoticz: 16.5;9528600
2023-08-22 21:00:47.025 Status: --->> (udevice) | 1757 => 0,16.5;9528600

But first it didn't then i compared with the plugin. There i saw i was using http. In the script i changed the https calls into http and that did the job.
Thanks for changing the script so it works again. :-)

@Cees2439867
Copy link

Cees2439867 commented Aug 23, 2023

With me it does not work yet.
Yesterday I used the new growatt-inverter.php updated username/password, Idx and domotics url. Then executed the file with the following result:
Het gaat helemaal fout

Then, at night time I added a piece of code not to update if the counter is not above zero:
lg('Growatt Inverter: '. $nowpower.' for domoticz: '.$str);
IF ($todaypower > 0) {
ud(DOMOTICZDEVICE,0,$str,'GrowattInverter: Generation updated');
}
I have this because I used to have many times that the counter retrieved was zero. After fixing the database with the correct values for yesterday I kept up the hopes for this morning but no luck. I do not get data from Growatt.

Maybe you have a hint?

@sincze
Copy link
Owner

sincze commented Aug 23, 2023 via email

@Cees2439867
Copy link

Just now I took the file growatt-converter.php and carefully looked if I made any mistake. Searching the file for "debug" gave no hit. The output of the read out from Growatt shows the following:
2023-08-23 13:15:02.525 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists!
2023-08-23 13:15:02.526 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable!
2023-08-23 13:15:02.616 Status: --->> Growatt Inverter: 0 for domoticz: 0;0

What else can I look at?

@Achterhoeker
Copy link

@Cees2439867 For me only http is working, still no https from the growatt servers with data. So in the growatt-inverter.php i've changed all https calls in http.

@Cees2439867
Copy link

It is not working unfortunately. Thanks for your work to help me (and others). I will enter the data manually for a while. Just bought a KWh meter from Home Wizard ([Wi-Fi kWh meter 1-fase) which promise a API. Hope this works.

@sincze
Copy link
Owner

sincze commented Aug 24, 2023 via email

@Marinus48
Copy link

I am a newbee so do not kill me if I talk nonsense...
I changed my password , from 6 to 8 positions.
I changed line 116 in:

$url='https://server.growatt.com/newPlantAPI.do?action=getUserCenterEnertyData';
Now growatt-inverter.php works.....

I can not explain why....
Enjoy..

@sincze
Copy link
Owner

sincze commented Aug 24, 2023

Well the hint could as well been in the clue of Growatt themselves.

{"result":0,"msg":"Username needs to be at least 8 digits long"}

But then again ;-) who knows.

@Marinus48
Copy link

2023-08-24 15:16:01.717 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists!
2023-08-24 15:16:01.718 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable!
2023-08-24 15:16:01.781 Status: --->> Growatt Inverter: 1772.2 for domoticz: 1772.2;14647800
2023-08-24 15:16:01.786 Status: --->> (udevice) | 80 => 0,1772.2;14647800

@sincze
Copy link
Owner

sincze commented Aug 24, 2023

2023-08-24 15:16:01.717 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists! 2023-08-24 15:16:01.718 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable! 2023-08-24 15:16:01.781 Status: --->> Growatt Inverter: 1772.2 for domoticz: 1772.2;14647800 2023-08-24 15:16:01.786 Status: --->> (udevice) | 80 => 0,1772.2;14647800

This indeed shows how it should be indeed.

@ntpckr
Copy link

ntpckr commented Aug 29, 2023

I updated the file, but I get only 0.0 values:

2023-08-29 10:42:11.008 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists!
2023-08-29 10:42:11.010 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable!
2023-08-29 10:42:11.049 Status: --->> Growatt Inverter: 0 for domoticz: 0;0
2023-08-29 10:42:11.060 Status: --->> (udevice) | 367 => 0,0;0

@Cees2439867
Copy link

Cees2439867 commented Aug 29, 2023 via email

@sincze
Copy link
Owner

sincze commented Aug 29, 2023

I updated the file, but I get only 0.0 values:

2023-08-29 10:42:11.008 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists! 2023-08-29 10:42:11.010 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable! 2023-08-29 10:42:11.049 Status: --->> Growatt Inverter: 0 for domoticz: 0;0 2023-08-29 10:42:11.060 Status: --->> (udevice) | 367 => 0,0;0

That is annoying indeed. I just checked mine:

2023-08-29 20:08:31.674 Status: --->> Growatt inverter: 1. Cookie file Found: /var/tmp/growatt.cookies 2023-08-29 20:08:31.682 Status: --->> Growatt inverter: Retrieve Data function called! 2023-08-29 20:08:31.829 Status: --->> Growatt inverter: Analyze HTTP for function retrieve_data called with HTTP code: 200 2023-08-29 20:08:31.832 Status: --->> Growatt inverter: Expected HTTP code: 200 2023-08-29 20:08:31.836 Status: --->> Growatt inverter: Let have a look at the received data! 2023-08-29 20:08:31.838 Status: --->> Growatt inverter: I did find JSON data to work with! 2023-08-29 20:08:31.841 Status: --->> Growatt Inverter: 22 Watt. Today: 8.2 kWH and total inverter is: 14065300 Wh for domoticz: 22;14065300

Slightly modified the online version again can you check again ??

@sincze
Copy link
Owner

sincze commented Aug 29, 2023

Hi Sandor, You where so right about HomeWizard! Now I have a constant flow of data in house without interfering with the data from the supplier. Thanks for your work during the past three years. Regards, Cees. ⁣TypeApp voor Android downloaden ​Op 24 aug. 2023 12:05, om 12:05, Sandor @.> schreef:

Homewizard stuff works great. Is simple URL parsing to get it into Domoticz. There is already a Domoticz plugin (p1. Water, plug) hopefully for the Meter as well. On Thu, 24 Aug 2023, 11:46 Cees Bakker, @.
> wrote: > It is not working unfortunately. Thanks for your work to help me (and > others). I will enter the data manually for a while. Just bought a KWh > meter from Home Wizard ([Wi-Fi kWh meter 1-fase) which promise a API. Hope > this works. > > — > Reply to this email directly, view it on GitHub > <#18 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/ABMCHTIMIEOJNKBGOFHHXSDXW4PIRANCNFSM6AAAAAA3WTI7VM > . > You are receiving this because you were mentioned.Message ID: > @.> > -- Reply to this email directly or view it on GitHub: #18 (comment) You are receiving this because you were mentioned. Message ID: @.>

You are most welcome. Enjoy their hardware.

@Marinus48
Copy link

I chequed mine and it is still working.....

2023-08-29 20:12:01.743 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists!
2023-08-29 20:12:01.744 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable!
2023-08-29 20:12:01.968 Status: --->> Growatt Inverter: 4.4 for domoticz: 4.4;14728500
2023-08-29 20:12:01.972 Status: --->> (udevice) | 80 => 0,4.4;14728500
2023-08-29 20:14:02.206 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie exists!
2023-08-29 20:14:02.206 Status: --->> Cookie File: /home/pi/domoticz/scripts/pass2php/growatt.cookie is writable!
2023-08-29 20:14:02.277 Status: --->> Growatt Inverter: 4.4 for domoticz: 4.4;14728500
2023-08-29 20:14:02.280 Status: --->> (udevice) | 80 => 0,4.4;14728500

@ntpckr
Copy link

ntpckr commented Aug 30, 2023

Slightly modified the online version again can you check again ??

Now it works again, thanks! What did you change?

@sincze
Copy link
Owner

sincze commented Aug 31, 2023

Github allows you to track the changes between versions
Have a look ;-)

@ntpckr
Copy link

ntpckr commented Sep 4, 2023

Where is the data stored of the data of the Growatt readings? I want to alter the comparing usage, because it is not correct.

image

@sincze
Copy link
Owner

sincze commented Sep 4, 2023

I would say it is stored in Domoticz DB ;-)

@ntpckr
Copy link

ntpckr commented Sep 4, 2023

Yes, it is, but I cannot find the exact line or table. I know where the day values are stored. So I wonder where the years are stored. Or is it calculated when I load the page?

@sincze
Copy link
Owner

sincze commented Sep 4, 2023

Ok great.
Stop domoticz before changing something in the DB.

Check for a column named calendar_meter or meter_calendar.
Just go through the values and look for the idx of your device.

@Marinus48
Copy link

Since today the script works fine…
I do not know why…but enjoy!
IMG_1454

@ntpckr
Copy link

ntpckr commented Oct 26, 2023

Since today the script works fine… I do not know why…but enjoy! IMG_1454

Yes, mine too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants