Get SEMS/GoodWe data with Powershell

Get SEMS/GoodWe data with Powershell: GoodWe has transferred everything over to the SEMS Portal, which finally comes with an API! In this article we’ll see how to grab data directly from SEMS’ API.

This is basically an update to Get GoodWe data with Powershell which is no longer working for some users (mainly people with a brand new Inverter that was never registered with the old portal).

Let me start by saying that even though there’s finally an API, with some documentation (in Chinese as far as I could find it), it’s still a bit messy, I noticed that this works with different URLs, but I tried to stick to what I normally use to login to the portal (https://www.semsportal.com).

The API works based on tokens, which means it requires two web requests, one to authenticate and grab the token data and another one to grab the actual output we’re after. It’s fairly simple and I’ll go through what I think it’s most important.

At the time of testing (20190613) the Inverter was pushing data to the SEMS Portal every 2.5 minutes circa, which it’s better than the old version of the script that could only see data every 5 minutes. It takes about 30 seconds to see the data: what I mean is, if it’s 9:00:00AM next refresh will occur at around 9:02:30AM, but the portal will have this data processed by around 9:03:00AM (sometimes earlier). An example for the last 4 entries I tried:

  • 06/13/2019 14:08:58
  • 06/13/2019 14:11:28
  • 06/13/2019 14:13:59
  • 06/13/2019 14:16:29

This is a basic script, please implement some error handling! (more…)

Read More

Add output to PVOutput with Powershell

In this article, we will see how to setup your PVOutput account in order to add output to PVOutput with Powershell.

I found a ton of info on how to add Ouput to PVOutput with curl, but nearly nothing (as I needed it) for Powershell. No wonder why I received a couple of questions on this.

If you’re the owner of a GoodWe inverter, take a look at Get GoodWe data with Powershell.

I don’t want to go too deep, so in this article I will just explain how to send data to your own system on PVOutput and how to set up the account to be able to do so.

Set your PVOutput account

In order to make API calls to PVOutput, against your system, you’ll need to enable API Access and generate a new API Key. You will also need the System Id you want to manage.

This is super easy as it’s all located in the same area of the account settings.

  • Login to PVOutput
  • Click Settings
  • Scroll at the bottom and:
    • Enable API Access
    • Click New Key to generate a new Key
    • Write down your system ID
    • Save

That’s it! We’re ready to send data to our system.

Note: Before proceeding, make sure your system is correctly set up. You need to ensure you’ve added the right amount of solar panels as well as the correct Watt hour or else you may end up receiving errors.

A very simple script

So, this script is very simple and will just show you how to send your system’s outputs to PVOutput. I strongly recommend adding a Try/Catch to make sure you Catch any error (so that you can also set up an alert, perhaps with Telegram: Automating Telegram Messages with Powershell) and, most importantly, you want to automatically get the date, time etc automatically (look at Get GoodWe data with Powershell to see how I grabbed these info from my inverter).

Super easy! You can add more functionalities, like I said above. One of them could also be checking for the Content (or Status/Description) that will be held in $PVOutputInvokeResult:

Have fun 🙂

Read More