My old generator is rated at 5,000 watts AC with both a 240 volt split phase and a pair of 120 volt outlets. The more expensive version at the time also had a 12 volt outlet, but it was rated at just 7 amps max (about 84 watts). It just didn't seem worth it. I have a 600 watt charger for my 48 volt (58.8 volt full charge) battery bank. That is far more power, but still nothing compared to what the generator can handle. For a 24 volt system, look at something like this.
I have thought about using up to 3 of the 600 watt chargers to keep the generator isolated from the inverter AC buss. I know it would be more effective to just connect the generator to the AC input of an inverter charger, but the fact my generator is an old direct AC alternator, and the frequency floats around from 55 to 63 Hz as the load varies. And I absolutely don't want any chance of the inverter or solar array back feeding into it. If I am without power for a long time and solar production is weak, I would move my refrigerator and furnace over to the AC outlets on the generator, and use my 600 watt charger to bring the battery bank back up. Once the battery bank is near full, I can shut the noisey generator down and run off the batteries again.
Honestly though, we so rarely have a power failure here, I have no need to make this an auto switchover. For a true off grid system, I would want an auto start system and transfer switch to keep power flowing.