Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mike_C

Members
  • Joined

  • Last visited

  1.    Juha reacted to a post in a topic: Raw access to Growatt Inverter Data
  2.    maptin reacted to a post in a topic: Raw access to Growatt Inverter Data
  3. Despite continued timeouts via the ios app, this implementation seems rocksolid. I run this every 5 minutes with a crontab in a docker container built on alpine:3.12.4 I honestly found that the "Simple Implementation" section of the github page was all that i needed to get up and running. Whereas the python script needed multiple calls, this seems to pull everything back in a single call. This does make it a little trickier to find the data you're after but a bit of 'jq' processing is all it takes to find the path of data you are after. As requested, I attach the file that i now run. I've commented it where i think it needs it and added some retry logic for the login and api call. I don't suggest this is perfect coding as its still rough and ready but working. I find that calling this every 5 minutes is enough for me to graph in near realtime. The git page details the configuration changes that could be applied; if you are after more historical data, you can change the options={} with options={historyAll:true}.runSolarUpdate_mike.js
  4. The success rate with the python script has recently (since mid Sep 2023) degraded significantly. I also notice that the iOS app and the website are both rather slow or have a high failure rate - at login and/or to display data. I have migrated to a node / javascript implementation I found. It's one login, one method call and one logout. It can be found here: https://github.com/PLCHome/growatt/tree/master I've created a simple docker container from alpine (utilising this to isolate from all other things on my server), wrapped some json parsing functionality around the calls (which i've learnt on the go) to perform the same data processing as with the python script. For me, this appears to be FAR more stable and reliable that the python version and funnily enough the iOS app. Whilst the iOS app was presening network timeouts, I found this script happily returning the data I needed. Thought I would mention this in this thread if others are still struggling with the python version (which I have stopped using myself).
  5.    WinstonG reacted to a post in a topic: Raw access to Growatt Inverter Data
  6. Yes. It’s the same via the app though. Logins (mainly timeouts I feel) are a problem. There are definitely times in the day when it’s more common to have timeouts. perhaps there is a timeout configuration for the api client (and / or some error handling) that can be added. I’ve not checked
  7.    Mike_C reacted to a post in a topic: Raw access to Growatt Inverter Data
  8. Attached processToFiles.py
  9. I don’t believe running as sudo is actually needed hence worth removing that. Keen to understand steps that 0xEF did to get working. I’m unsure from here. Clearly the username / password combo via the scripts should work as well as per the API. I have found that the app has been a bit hit and miss today - with timeouts. Perhaps retrying the API at another time??
  10. Hurrah - glad to help! Main issues were therefore around permissions / paths in Linux rather than the script itself. Do bear in mind that /tmp (as a temporary directory) gets wiped each time the server restarts. Enjoy
  11. let's try setting the outFolder to "/tmp/"
  12. hmmm ... the error that concerns me is : ppvToday_dayAPI = mix_detail_day['chartData']['ppv'][DayOfMonth_i] This suggests that one of the calls made is not returning any data and/or.in the right format. I vaguely understand the error but have not seen it myself and unable to diagnose (after all I'm calling someone else's code). Looking at your original post, and what you are looking to achieve, I have removed the second half of the script (that does much of the calculations) to create a light version (and attached to this post). I propose two options from here 1. growatt-mix_detail-YYYY-MM-DD.json should contain the data you are after. It is in JSON format as returned via the API call, and will need some reformatting, e.g. with the 'jq' command. 2. assuming there are now no errors in this light script version, you should find I have undertaken this reformatting and created growatt-mix_detail_chartData-YYYY-MM-DD.csv. hope this gets you closer to the goal. processToFiles_light.py
  13. You shouldn’t need to run as sudo. Either run as normal user, or try re-running the pip install growattServer command as sudo as well. (My Ubuntu is a bit rusty but there seems to be permissions / who you are running commands as that is causing some issues here). the server.growatt url IS in the package that I’m using. I don’t call it specifically.
  14. The username and password in the script need to be those used to login to the growatt server - https://server.growatt.com/login (and NOT those used to connect / ssh to the ubuntu server). Relative paths can also be used, so try outFolder = "./" # ensure this folder exists and this will create files wherever you run the script from. (to answer your specific question, there is nothing preceding the ~mike in my path. The ~ (tilda) means the user's home directory. You are connecting exactly as I was to the AWS VM (i.e. ubuntu with pem cert file and no password).
  15. I suspect you don’t have permission to write to that folder. If the script fails, at line 91, all files written before that will still be in the folder.
  16. Will be in the output folder (ie created by the script execution)
  17. My cron expression is : */5 23 * * * /opt/homebrew/bin/python3 ~mike/bin/solar/processToFiles.py I'd expect all calls to work for all inverters (and may give inaccurate data rather than throwing an error). If you can send me a copy of your growatt-mix_detail_day-YYYY-MM-DD.json file (it doesn't contain any of your login details), I can see if I can work out the error; it's not one that I've seen in my testing. The alternative is just to comment it out - and all downstream, dependent calls or calculations.
  18. What type of inverter do you have? I believe some of the API calls only work for certain inverter types (I’m more comfortable with coding than inverter types tbh).
  19. Ubuntu and windows installs both work - instruction overview below. I should add that I run this script every 5 minutes via cron between 23:00 and 23:55. This ensures that I get the full day's data and provides some protection in case a single execution times out (which the script does not currently handle very well). With AWS of course, you would not likely need the VM running 24x7, but just when you needed the script to run. Ubuntu: I created an AWS VM this am (based on Ubuntu Server 22.04 LTS (HVM), 64-bit (x86). AMI ID : ami-00c90dbdc12232b58. From ssh session: sudo apt-get update sudo apt-get upgrade // python3 was already installed sudo apt-get install python3-pip pip install growattServer Windows - standard win10 under virtual box: Install python via https://www.python.org/downloads/windows/ ( I went for 3.10.4. Selected options to include pip and add python3.10 to path). From the command line: pip install growattserver Common (Ubuntu and Windows): Make config changes, create output directory, and run...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.