Fronius Gen24 upload to PVOutput

I will be having an additional 6.5kw system installed soon to compliment my current 6.3kw system. The current system uses a Fronius Primo 5kw snap inverter. What I liked about it that is was very easy to setup to push data to PVOutput.

The new system will have the Fronius GEN24 5 kw inverter and Fronius have removed the Push to PVOutput feature in these new inverters. Bit annoyed when I found this out.

I have read on the these forums that people have done it, but seems quite complicated as I don’t have much idea when it comes to coding etc.

I understand a computer will need to be running 24/7. I have an iMac that runs 24/7 for a weather station and a few other things.

I am hoping someone has written some software that’s simple to set up.

Ive just got a GN24 installed and ran into the same problem So Ive just put together a Python script to do it.

I can post the code as is but it needs a bit of tweaking to get it to work on your system. If you are game to have a play Ill stick it up but hopefully Ill get it cleaned up a bit over the next couple of days to make it a bit easier to use. Ive got it running on my Mac.

Once you have tweaked the code, I would like a copy thanks.

Ive had some PM requests for it as is so I might as well post it here for others to get started it is Python3 and requires the PVoutput module from https://github.com/yaleman/pvoutput I think you can install it with PIP… please NOTE this is just my first working hack at making it work from modifying the sample code from the above link and probably includes stuff you dont need and is probably missing stuff you do need please use at your own risk and is intended for people with some python experience. it just gets data from the Gen24 primo and dumps it on PVOUTPUT every 10 minutes just to see if the concept works. if you tweak the parameters it should work for the Fronius smart meter and multiple connected inverters that use the V1 API

You will need to change the ip address of the inverter, your API, and system ID
the lines you need to alter look like this

                    apikey="YOUR API KEY",
                    systemid=YOUR SYSTEM ID,

                    response = json.loads(requests.get("http://192.168.1.21/solar_api/v1/GetInverterRealtimeData.cgi").text)
import requests
import json
import asyncio
import aiohttp
import datetime
import asyncio
from pvoutput.asyncio import PVOutput
y = 0
response1 = json.loads(requests.get("http://192.168.1.21/solar_api/v1/GetInverterRealtimeData.cgi").text)
print(response1)
async def postPVoutput() -> None:
    """main function"""
    # configuration = await get_apikey_systemid()
    testdate = datetime.date.today()
    #global CONSUMPTION
    #if CONSUMPTION == 0:
    #    print("only just started dont send yet")
    #    return
    response = json.loads(requests.get("http://192.168.1.21/solar_api/v1/GetInverterRealtimeData.cgi").text)
    print(response)
    energyGeneration = int(response["Body"]["Data"]["PAC"]["Values"]["1"])
    print("Energy Generated: ", int(energyGeneration),"W")
    data = {
        "d": testdate.strftime("%Y%m%d"),
        "v2": energyGeneration,  # power consumption
        # "m1": "Testing",  # custom message

    }
    # print(CONSUMPTION)
    # print(testdate.strftime("%Y%m%d"))

    for attempt in range(10):
        try:
            async with aiohttp.ClientSession() as session:
                pvo = PVOutput(
                    apikey="YOUR API KEY",
                    systemid=YOUR SYSTEM ID,
                    session=session,
                    donation_made="false",
                )
                response = await pvo.addstatus(data)
            print("data")
            print(data)
            print(f"{response=}")

        except:
            print(response)
            print("network issue")
            continue
        else:
            break
    else:
        print("upload Failed")



#response = json.loads(requests.get("http://192.168.1.21/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DataCollection=CommonInverterData").text)


while True:
    #print(datetime.datetime.now())
    now = datetime.datetime.now()
# print(y)
    t = (int(now.strftime('%M')))
    #print(t)
    if (t % 10) == 0 and t >= y + 1 or y > t:
        y = int(now.strftime('%M'))
        print("send data")
        asyncio.run(postPVoutput())

I will continue to work tidying and testing

Just should point out the python script I posted only posts the current power output. at the time the sample is taken. working on fixing that up at the moment

1 Like