Most usp are modified sine wave, there are a few very few that are pure (what is needed for a triac) there are a few old threads on this same issue. Dion Brewington and I corrisponded a number of times about a power back up. More generators are not pure sine wave either (the notable exception are Honda they are pure sine wave)
UPS even with the correct inverter are not designed to run heaters and a normal personal use one would not run very long at all. (many only run computers for 20-40 min so figure less than half that time)
The solution I came up with is a 3 cell bank of deep cycle marine batteries with a pure sine wave inverter, a Ranco t-stat (80º set point) on a separate heat system all together (heat cable on the backs and side of enclosures) installed with a transfer switch. If the power fails the transfer switch kicks over and the ranco takes over from the primary. The problem is cost, I have not set it up as it is well over 2500$ to install. A honda gen is cheaper.