pmihairo/FroniusSymoGEN24Data

MeterBucket DB not populating

morphias2004 opened this issue ยท 6 comments

Hi,

I've got a Primo GEN24 (single phase) with a single phase smart meter.

I've got your script working, but only the SiteBucket DB is being populated.

Out of that, the only meaningful data I can find is P_Grid, P_Load and P_PV.

I can't see array voltages, etc.

Are you able to assist?

Thanks in advance!

Hey, Based on what I remember from the development, and the description of the issue It would seem that the most important of the API calls to your inverter is failing.

The values you describe are returned by /solar_api/v1/GetPowerFlowRealtimeData.fcgi , while the values you are looking for (most of the data returned) is from /solar_api/v1/GetMeterRealtimeData.cgi?Scope=System. I tend to remember that there were different APIs that my script did not need to consume.

Question: Do you see that data (Grid Voltages, Grid Power, PV voltages, PV Power, etc) in Fronius Solarweb? If yes, then it means your inverter and meter at least have some access to that data, but the script is just not collecting it. Further on, this would mean that enhancements are needed to the script to collect them.
If you do not see that data in the Fronius Solarweb, then it means your inverter does not have access to that data and changes to your system configuration maybe even physical setup would be needed.

Hi,

Thanks for coming back to me! :)

If I go to History on Solarweb, I can view the data as follows:

Inverter:

image
image

Smart Meter:

image

If I hit the web interface of the inverter, I can watch the following data in real time (it was dark when I did this, so there was no output, but all fields do populate ๐Ÿ‘ ):

image
image

image

Any assistance is greatly appreciate. ๐Ÿ‘

Forgive my low level of understanding as pulling this data is new to me.

I see if I drop the calls directly into a browser, I can see what is returned. So, these screen captures will probably help you out?

My basic understanding means the calls work and return the required data?

GetInverterRealtimeData.cgi I can't see this used in the .py script.

image

GetPowerFlowRealtimeData.fcgi

image

GetMeterRealtimeData.cgi?Scope=System as GetMeterRealtimeData.fcgi returns a 404 Not Found

image

I also saw some test code in the script and uncommented it to see what it does.

It appears to create and sqlite file with the output.

I've attached it for you.

Fronius.zip

OK.

I've progressed further - I'm learning as I go.

I worked out a lot of the data being called isn't relevant to the single phase Smart Meter I have.

Using the API calls, I've edited the script to pull the data that is actually available.

I also found a couple of minor typos that probably resulted from cutting and pasting lines of code. e.g. There wasn't a Meters = MetersRealtimeData(GetMetersRealtimeData()) in def InitPowerFlowRealtimeData(cn): so there wasn't a dataframe to capture the data,

I'm still not getting any data into my MeterBucket Influx DB though.

I've worked out the debugging that was built into the script and think I have narrowed down the issue to only one row ever being written to the "Meters" table in the SQL database.

When I run the TestPowerFlowRealtimeData with it printing the Meters data to the screen, I can see the data is successfully being collected via the API.

I then used the mainDB part of the script to create the sqlite file to see what data is being written into the SQL DB.

When I cancel the script after letting it run for a bit to accumulate some data, I see the following exception in from the script:

image

I believe the lines with (row.keys()) are the issue, but I don't have the knowledge to resolve it.

def writeSQL(cn,cur,table,row):
    columns = ', '.join(row.keys())
    placeholders = ':'+', :'.join(row.keys())
    query = 'INSERT INTO %s (%s) VALUES (%s)' % (table, columns, placeholders)
    cur.execute(query, row)

    cn.commit()

@pmihairo any assistance is greatly appreciated as I would really like to get this working. ๐Ÿ‘

My updated script is attached.

collecter.zip

OK.

I've worked it all out now and have done a MASSIVE clean-up of the code.

Given it's specific to the single phase inverter and smart meter, I'll do a new release.

https://github.com/morphias2004/FroniusGEN24toInfluxDB