I realized this task with special hardware relay after generator output before inverter input. It monitors power and current through it and disconnect generator from inverter when the power overcome it's maximum. There are no problem for load as inverter momentally switch to offline mode and continue supply power from sun/battery. Then after timeout this relay connect generator back thus generator don't cut out. As you know, Solar Assistant temporary disable automation rule if it switches more than twice for 10 minutes. So your automation won't work even if they realize your issue.