Get GoodWe data with Powershell

Get GoodWe data with Powershell

I recently had a few solar panels installed over the roof of my house and right after that I thought, how can I get GoodWe data with Powershell?

Edit 20190613: GoodWe has switched over to the SEMS Portal and ever since the script stopped working. Thankfully, SEMS has an API available, have a look at this post on how to get started, it’s very simple: Get SEMS/GoodWe data with Powershell. Also, you may still be able to use the method shown in this article, if your inverter is still registered with goodwe’s old portal. In my case it started working right after I logged on to (but I kept in the $url). I also tested by replacing in the url with and it worked as well.

GoodWe is the brand of the inverter installed, which connects to my home wifi and sends data automatically to the GoodWe Portal. The model I have is the GW4200D-NS.

I have to say that I wasn’t happy with the app I was provided with, neither was I happy with the portal, which refreshes the Real Time Data every 15 minutes! What kind of real time is that? However, to be fairly honest, why would you want to see actual Read Time readings? Well, because I want to. 🙂

Before looking for a solution on my own, I always search online, I don’t want to re-invent the wheel, so I found a post where I got the main idea: . This post describes a way of grabbing the data from a non-Windows environment.

Important: I am not (nor is the post above) grabbing the data directly from the inverter, but I am leveraging the GoodWe portal information. An idea I have is to sniff the traffic the inverter sends to goodwe, capture it and re-utilise it, however I’m not too interested in that yet as the solution I have works fine.

Edit 20180605: GoodWe has started using HTTPS, so the previous script got broken because of this. I’ve updated it (just changed the URL from http to https) and the script is working as usual.

Dirty Notes

I’ll try to make it quick as the guy from the post above and myself have done most of the dirty work, I will just say that this required testing and some in-html reading. Thanks to the builtin Chrome Developer functions (F12), I was able to see quiet a few information, including the URL powershell had to grab its data from.

Two ways we can do this

  1. Grabbing the xls file for the current month.
    • GoodWe has an “Historic Data” tab that you can Export as well. I did find a way to get it exported it and then I grabbed the info from there. Unfortunately it required Excel for me to leverage the powershell cmdlets and also the DLL out there to work with XLS files (not xlsx) won’t work after a certain file size, so after the first half of the month (14MB or so), it would have stopped working giving errors. As I was not interested in getting Excel installed just for this, and I wanted a better way (than downloading 14+MB every minute), I went for option 2.
  2. Grab the data from the loaded Graph in the webpage, which contains updated data every 5 minutes.
    • goodwe-graph


The post on says to use the URL “” which updates every 10 minutes or so. However, after some digging, I found another URL that would refresh the data every 5:



What we need

  • The Inverter SN, something like 913100PQS071Z0112 (I made that up)
  • The Power Station ID, something like 33nn3332-4c19-232b-9h14-gbh0c2w490q1 (I made also this one up)

We also need other info, which don’t need to be provided by you, I’ll go through them later on.

How to get the Inverter SN and the Power Station ID

I suggest you to use Chrome or Firefox.

Inverter SN

The easy way to get this is by going to the Inverter and looking at the label and look for the S/N. Or else, you can do the following:

  • Log on the GoodWe Portal (
  • Under Overview, you’ll find the SN there at the bottom.
Power Station ID

For this one, we will just need to view the GoodWe Portal source code.

  • Log on the GoodWe Portal (
  • Right click and “View Source Page”
    • goodwe-view-page-source
  • Search the page for <input id=”ID” name=”ID”
    • There it is, you’re interested in what’ within “value” (the part I obfuscated in the screenshot).
    • goodwe-powerstationID-page-source

The Script

Just change the InvertSN and the PowerStationID from the script below and you should be good.

Basically the script will grab the data from the website for you and also format it in a way that gets 4 arrays of data:

  • PGrid(W) >> It’s the current production in Watt/h
  • Temperature (C) >> The temperature in Celsius
  • ETotal (kWh) >> The total amount of energy in KWh produced so far by the system.
  • EDay (kWh) >> The amount of energy in KWh produced today by the system

I’ve added a little check in the script: let’s say the script is running and it’s midnight, so when the inverter is off, the script will notice that PGrid(W) returns only zeros, so it reports everything to 0, except for the Time, which is set to “Yesterday” and except for ETotal (kWh) which the script will grab from the previous day.

The time in the script is taken from the number of minute passed: The amount of data reported by the web interface is every 5 minutes, which means we will have 289 entries in 24 hours (including 00:00 and 24:00). The script uses a counter to see which one is the last value, let’s say it’s the entry number 100, multiplies by 5 minutes and converts it in time we understand. That is done by this bit:

It’s important to notice that the PGrid changes way more often than just once every 5 minutes, here’s an example:


As you can see, for the past 5 times, the time is stuck at 13:40, however the PGrid(W) changes every 1 minute circa (the script runs every 30 seconds or so).

Now, the script just displays the information on screen and it’s adjusted for anybody who wants to grab the data, however I made another script (very similar) which I won’t show you (at least not today) that basically will drop all of the info in a php file that is integrated in the index.php of an IIS website and that will show me a simple output. Something very primitive for now (that is displayed very well on a mobile):


I hope this was informative and will help you building your own monitoring, in Windows 🙂 I didn’t want to go too deep into the details, if not this post would’ve became an e-book.


comments user

Great work, and the update rate is perfect. Any chance you have since modified the script to push the data to PVoutput? I’ve been searching for some time for a Windows based solution to get my GoodWe data to PVoutput.

    comments user

    Thanks Brad. I think I’ll write a quick article on that, but haven’t done it yet as I don’t use PVOutput. However, I had a very quick look at this and it seems pretty easy. First of all, in your PVOutput settings, enable the API Access and Generate a new key. After that have a look at the API Documentation: .
    Basically you’ll need to use Powershell and Invoke-WebRequest to push the data. In the examples in the API page, they use curl.

    I wrote the article, check the link on the comment below.

    comments user

    Hi Brad,
    I just went through this to see how it was, and it’s pretty simple, have a look at how to do it here:

comments user


Thank you for posting this useful script. Just wondering if there has been any update to this. I have tried the script but I get {“result”:”error”} returned by the Invoke-WebRequest. I used the Developer Tools in Chrome and the query looks identical, just doesn’t work from Powershell. I’ve tried invoking get request on some public urls which works fine.

Thank you

    comments user

    Hi Steve,

    Did you try with https rather than http in the url?
    Goodwe recently started using https.


      comments user


      Thank you for the quick response to this. Yes I am using https in the url. I used Fiddler to grab the request when navigating the via the portal and compared it with that produced by Powershell. Mostly header differences.

      This is what I tried and it always returns {“result”:”error”} in the request content. The status code is 200 so the request does complete.

      $url = “”
      $InverterSN = “myserialno”
      $PowerStationID = “mypowerid”
      $DateFrom = Get-Date -Format yyy-MM-dd
      # Build the Post parameters
      $postparams = @{InventerSN=$InverterSN; DateFrom=$DateFrom; PowerStationID=$PowerStationID; QueryType=$QueryType}
      $content = (Invoke-WebRequest -Uri $url -Method Post -Body $postparams).content

        comments user

        So, I copied and pasted the script you posted and changed just the SN and the ID, and worked. It did give me the same error when I changed $PowerStationID to something random. Sorry for the stupid question, but.. are you sure you haven’t mixed up the PowerStationID with the SN? 😀

          comments user

          Thank you! That was it – I had the SN/PoweStationID mixed up. Sometimes it just takes another pair of eyes. Sorry for the waste of time.

          comments user

          Awesome!No problem at all!

comments user

Good work, works fine with me with my Goodwe inverter.
I use jSunnyReports for my other set of panels to produce an overview via a website ( For this I use an SMA Inverter that creates csv files per day, which is then read every 5 minutes by jSunnyReport.
How nice would it be if there is the possibility that the script can be modified to create a csv (or txt) file every day that could be provided with the data that is retrieved with your script.
The output could then be: dd.MM.yyyy HH: mm: ss; Kwh; kw (power (w)).
The csv file should then be named: Goodwe_yyyyMMdd. Goodwe should be a variable given.
I do not have enough knowledge to do this. You may see a challenge in this.
If that does not work, can you help me on my way?

    comments user

    Hey Jan,

    When you say “How nice would it be if there is the possibility that the script can be modified to create a csv (or txt) file every day..” do you mean “every 5 minutes”? Generating a csv file daily, would be sort of useless, unless you’re only interested in the previous’ day output?
    It should be fairly simple to make this change on the script that generates the PHP file and instead of generating the file, it could just generate the csv file with the format you want.
    Have you got any experience at all with Powershell, at least I can see more or less how much technical I can get.. 🙂

comments user
Daniel Comrie

Thanks for the great script! Really awesome!

I’ve just had a GoodWe GD5048D-ES installed, and I’m trying this out.

I was initially getting this returned: {“result”:”error”}

But I’ve realised it’s down to GoodWe changing their portal. They now use:

I’ve tried a URL along the lines of:

but just getting a DOCTYPE response (which doesn’t seem to change, regardless of the URL).

Do you know whether the new portal still provides this interface?

Thanks very much!
I’ve gone through the comments, checked the issues other people were having (Station ID & SN mixed up, etc.) and everything seemed correct.

I have been that goodwe

comments user
Daniel Comrie

Thanks very much for this script – awesome work!

I’ve just installed a GoodWe GW5048D-ES, and have tried to imeplement the script.

I hit a few issues, which I think come down to GoodWe shutting down the old portal – they now use

I’ve been trying to see if they have a similar API, but I can’t seem to find anything that works. Do you know whether this is available? Have you got this working on the new portal?


    comments user

    Hi Daniel,

    Recently I noticed errors, but didn’t have time to look at it. However, I just did, it’s working again for me. Try to login with your account over to and then try to run the script. Once you login, check if you have any station registered over there.
    Also, try to replace $url with
    I’m not sure whether your inverter is actually registered with the old portal as well though.

    Finally, as soon as I have a second, I want to review the new SEMS Portal, because I believe there’s an actual API for it which would make things way easier:


      comments user
      Daniel Comrie

      Thanks for your reply (apologies for the double-post, wasn’t sure if it had gone through).

      I’ve tried logging into to old portal, but is says my account doesn’t exist. It also won’t let me register, pushing me to the new portal. I suspect that the old portal will now only work with accounts created before the cutover.

      I saw the swagger API, which looks really great – it’s just a little beyond my expertise at this point. No time like the present to learn though, I suppose!

        comments user

        No worries about the double post (just an extra level of security against spam.. :)).
        Anyway, I think I worked it out, I’m gonna wrap a very basic script and post it today. It’s actually awesome because finally all data comes in a decent format and the script will end up being way shorter.

        comments user

        Hey Daniel,

        Here it’s the first release of the post I was talking about:

        Let me know if it works for you. I didn’t have much time to play with that API yet.

          comments user
          Daniel Comrie

          Excellent – thanks very much! Taking a look now

          comments user

          Cool, let me know how that goes. It’s very basic but I think it’s all there to start.

Leave a Reply

Your email address will not be published. Required fields are marked *

IT Droplets

IT Droplets