Not via Fronius’ SolarAPI (Json API) which the Fronius integration uses. Maybe via Modbus - see the according documentation.
I have a similar setup and connected the Fronius pins to a Knx binary sensor to transport the signal via KNX to a different location. Works flawlessly.
There are some configuration options in the Fronius UI that are tailored especially for these things (at least on Symo SnapInverter devices, don’t know about Gen24).
Priority system for multiple loads
different turn-on and turn-off triggers (when a load is turned on your %-more-than-used will drop)
minimum runtime per cycle
maximum runtime per day
target runtime (minimum) per day until configurable time
So nothing you couldn’t do in one or more HA automations, but I personally like to keep this as an independent system (apart from the KNX stuff I’m running, but this is decentralized in itself).
For “x% more energy provided then used” you will have to install a Fronius Smartmeter (~200€).
I’ll install the smart meter anyway as I want to track the power consumption from grid. Beside that, I get the parts pretty cheap as I own a electrical appliances wholesale.
Is you KNX sendor just a sensor or is it also the relais?
I’m thinking about putting an ESP with GPIO binary sensor in parallel to the relais.
Its just a sensor. It has to work with the 10,7V the Inverter provides on its Out-Pins.
I think I used this: https://new.abb.com/products/de/2CDG110093R0011/be-s8-230-2-1 - the actuator (relais) is in a different part of the house. KNX was already there when I installed the inverter so I used it as transport instead of pulling new cables.
Since I don’t want to add KNX, I guess I’ll use an ESP with it’s GPIO pins, adding some resistors to decrease volts (voltage divider) down to 3.3v.
I can also trigger a relais via esp then.