Combined Heat and Power idea ..... would it work?

I had an idea for a simple combined heat and power system I could build from mostly scrap materials. (To keep it as simple as possible, this one *doesn't* feed back into the grid.) The idea was to use a small water-cooled diesel engine, powered from
It may work, but the cost of fuel for the diesel would be high, unless you spend a lot of time collecting and filtering used cooking oil, and you get it free.
But the whole thing is very complicated. How will you switch between 230 volts
