sincze / Domoticz-Growatt-Webserver-Plugin

16 stars 10 forks source link

Changed Heartbeat call, not working on synology. #38

Closed fgerrits closed 1 year ago

fgerrits commented 1 year ago
          > I have had a lot of mail contact with the service line of growatt, it appears that they have problems with the growatt servers, the server-api.growatt.com is an old server and it will be out soon, the server.growatt.com server can now not responding to the many requests and will therefore block the IP addresses. I also have the problem that the IP address is released again at 4 o'clock at night and blocked again around 3 p.m. The solution they propose is to make a request every minute instead of domoticz, to do this every 5 minutes, which reduces the number of requests by 400% so that the servers continue to work.

So if an adjustment can be made to the script that makes a request for data every 5 minutes, that would be a nice solution.

Have a look at this post (by me): https://www.domoticz.com/forum/viewtopic.php?p=299171#p299171 It's fairly trivial to adjust the script to make it fetch data at different intervals (e.g. 5 minutes), the gist is this:

"After a successful API call, the plugin does 12 heartbeats (10 seconds per beat = 2 minutes). After these hardcoded heartbeats the plugin uses the runAgain variable to determine after how many EXTRA beats it should do another API call. The default is 6 (6 x 10 = 1 minute). So effectively you get an API call every 3 minutes (2+1).

I changed the runAgain variable on line 83 and line 227 to 18 (=3 minutes): so now I get an API call every 5 minutes (2+3)."

Originally posted by @jan-vandenberg in https://github.com/sincze/Domoticz-Growatt-Webserver-Plugin/issues/37#issuecomment-1460756368

fgerrits commented 1 year ago

Sorry wrong commit.