How to upload export/import data with a time resolution that differs from the generation's?

I use my own sma2pvoutput script for uploading generation data from my SMA inverter every 5 minutes. This works well and gives me a live view of the generation.

Unfortunately I don’t have a way to upload export/import or consumption in the same way. Instead I use yet another script to get the export and import data from the company that I sell/buy energy from. This data is available with two days delay and with one hour resolution.

Up until now I have used the add output API to add the export and import data, and this mostly works. The import is split into peak/off-peak/etc. What doesn’t work is the time of use graph which only shows the energy imported and doesn’t include the energy generated and used directly. I.e. the sum of all TOU periods doesn’t equal the consumption.

To get this to work I assume I should instead use the add status API to report export/import. But how will this work when the export/import data is reported by the hour and the generation every 5th minute? If I report the same export value for the whole hour, the system could potentially export more energy that it is generating at a specific 5 minute mark.

The 1hr intervals would need to be split out into 5-minute minute intervals to match that of the generation.

If this is net data then you need to make sure export does not exceed generation.