Using generator setting with an ess configuration

Can you use generator conditions to trigger AUX1 to control general flag, ignore ac input while in an ess configuration?
I have set the generator triggers during quiet hours to charge the battery at cheap rate, this triggers the ac in relay on the mp2 to switch on via aux1, and i have also set the ess to start charging the battery at the same time. Once the battery is at 50%soc, the charging stops and the ac in ignore is triggered again making my system go back off grid.
I do have yet another problem…
I have a feed in tariff and i have set the inverter to stop ignoring ac in, once soc (from solar) goes over 80%, this would make me grid tied again and excess power would be fed into the grid once my batteries are full, to keep my generation meter running.
However, noting happens when the soc reaches the trigger point of 80%, it just continues to remaim off grid. Is this because i have the generator settings as active?
Is there a way tound this without using node red?

The 80% trigger to go on grid will be changed to 95% once i know the system is working perfectly.

I have since discovered that by manually turning relay1 aux1 on, the grid power flows into the inverter only positively, but if i manually turn relay 1 off, the ess becomes active with positive and negative wattage flowing to and from the grid.
When generator is configured, it also stops ess wrom working even when relay 1 is open. So basically not working for my configuration.

Can anyone please draw me a node red flow chart for what i want to do?