(Take this whole answer with caution as I'm not a solar professional or electrical engineer.)
1. Proposal: House on UPS, fed by solar charger and current-controlled AC charger
This is an experimental proposal as I have not tried it yet. If it works, it would be nice though as it uses nearly exclusively off-the-shelf, standard products.
The idea is to always run the house from the UPS (means, don't connect the grid input to the UPS, so it will always "think" that the grid is down). Instead, AC electricity will be mixed in (when available and solar is not enough) with an AC based battery charger connected to the UPS's battery, in parallel to a solar charge controller connected to the same battery. The UPS now always runs "on battery", but the battery is fed from solar and grid at the same time. Thus, if the momentary power draw of the inverter is matched by the output of the two battery chargers, there is no cycling and thus no degrading of the battery involved.
For lead-acid batteries, two chargers connected in parallel can usually work together without interfering with each other. What you'll need to prioritize the input of the solar charger over that of the grid-based charger is a kind of current limiter in one wire of the connected AC-fed charger. It would only permit as much current as needed to maintain the float charging voltage of the lead-acid battery – which can be zero ampere if the solar panel output alone can cover the house's power draw. That current limiter is the only non-standard device. But since it deals with 12 V or 24 V DC electricity only, it is relatively safe to create it in a DIY manner, for example from a PWM controller for DC motors, a battery voltage sensor and an Arduino microcontroller. Using a PWM controller to pulse-charge the battery will not harm it as current and voltage of the pulses are kept within spec by the battery charger itself (see).
Disadvantages:
It might limit the maximum power available in the house, as it's now limited to the maximum power output of the UPS even when the grid is available.
There is a wasteful AC → DC → AC conversion involved. But if you have enough solar panels and low power needs overnight, that wastage is quite low as the house will mostly operate on solar.
When the AC-fed charger is not as powerful as the UPS, during peak loads some slight battery cycling can happen (example: UPS draws 2000 W for powertool usage, while the AC-fed charger provides a maximum of 750 W and there is no sun). That's probably no issue as peak loads are generally short and a lead-acid battery can cope with very shallow cycling for years (see: use as automotive batteries).
2. Alternative: UPS plus grid-connected inverter without feed-in
There is an alternative where you'd have a grid-tied setup but without feed-in and when the grid goes down, your UPS takes over as it usually does. The solar panels would feed into the grid-tied inverter and in parallel into the battery of the UPS (by connecting a battery charger to it). It avoids the wasteful AC → DC → AC conversion of the solution proposed above, however there are other issues so that I don't think this solution would work:
Disadvantages:
It can take a few minutes for grid-tied inverters to detect that the grid is down and to stop producing AC (so-called "anti-islanding feature"), and in that period the UPS could repeatedly switch back and forth as it "sees" some AC electricity on its grid side. It will depend on the inverter's switching behaviour.
You'd need both a grid-tied inverter and a UPS, which includes another inverter. And grid-tied inverters are much more expensive than those in a UPS.