Note that the simplest solution may be net metering.Where permitted, this uses inverters that monitor and synch with the power lines, and therefore can be connected in parallel with the grid. At the same time, your meter is replaced with one that can count both forward and backward; if you are producing more power than you need the excess gets sold to the grid, and when the balance goes the other way (eg at night), or when clouds cut your production) you buy power.
Major advantages include continuous aitomatic balancing of the two sources, no need to maintain a battery bank, and the joy of the midsummer bill when the power company may owe you money. (I haven't quite gotten a negative bill yet -- I've gotten negative grid usage, but not enough to overcome the $6/month account fee.)
Disadvantage is that, for safety reasons, these systems are designed to shut down when power is lost on the grid to avoid the risk of electrocuting someone who would have expected the downstream end of the break not to have voltage on it.
Theoretically it would be possible to run disconnected (in "island" mode"), but them you'd need to re-introduce transfer switches for safety, and you'd need a 60Hz 240-split reference for the inverters to sync to. I can imagine a setup where you'd disconnect from the grid and connect instead to a generator as "local grid reference", with the solar panels and the generator sharing the load... but that has complications in protecting the generator from reverse current, and it isn't a approved/supported configuration for any manufacturer I'm aware of. Maybe someday...
Anyway, I just wanted to toss the out as an alternative to explicitly switching between solar and grid. Depending on your goals and needs, it may or may not be the best answer.
If your hollow walls do not have wooden studs, the studs are most likely steel (at least in the US).
You are right to be concerned about the extensive wiring near an electrical panel. Numerous wires may be exiting in virtually any direction. You could check out where wires exit by turning off the main power switch and then removing the panel face plate. You will be able to see the directions most of the wires follow. Caution! There is still live power coming into the main breaker, even when that breaker is off.
If the wiring is up to code, cables are supposed to be recessed from the front edge of the metal stud by at least 1.25 inches (NEC 303.4(D)). This leaves you some room to drill and install anchors in the drywall, although I would avoid drilling very close to the panel (as you suggest).
For extra safety, you may wish to turn off the power when you are drilling on that wall, take care not to allow the drill to penetrate much beyond the drywall and, if you seem to hit anything other than drywall, check to make sure it is not a cable before progressing.
You can mount things on steel studs, but you need special screws, not wood screws. Also, if mounting on steel studs, be sure the screws are not so long that they penetrate the steel more than about 1/2 inch at most (longer provide no additional holding power in steel studs).
While steel toggles and expanding anchors should not hit wiring if it has been properly spaced, consider the plastic expanding type if you want additional safety.
I would avoid the tubular type plastic anchors except for the lightest of loads. And do not use the steel hammer-in type anchors!
Note: If you think you might have hit a cable, be sure the power is off and call an electrician to check it out before proceeding!
Images and links are illustrative only, not an endorsement of goods or sources.
Best Answer
Closest thing to what you ask for that would be legal and safe is a simple interlock. Happens to be my preferred method - it's cheap, and it lets me choose what to power without any sudden need for creative rewiring in the dark.
Depending on what you have for a panel, this may or may not be easy or even possible, or it may be quite easy, cheap and possible. Typically one double-wide (240V) breaker next to the main breaker is designated as the backfeed (generator in) breaker, and then there is a metal interlock device that lets both the main and the backfeed be off at the same time, but which prevents both from being on at the same time. This will be a UL listed device from the maker of the panel.
You are aiming absurdly low on generator size for backfeeding a house panel - a 2200 watt almost certainly does not even have a 220V outlet, for one thing. If that's all you are going to get, use extension cords and don't connect to the house wiring at all.
You have to manage the loads yourself with this system, but any circuit can be connected. If too much power is drawn, a breaker (most likely the one on the generator, or the backfeed) will trip.
The alternate system as per Wolf's answer is to set everything you want to power up on a sub-panel that is the only thing that can be powered in an outage. If you want to power other things, there is a regrettable temptation to do it the wrong way with such a setup (which is one reason I don't like them.) That system is also typical of autostart generators, though of course in that case the generator has to be quite large to enable powering all the loads on the sub-panel at the same time if it's going to autostart, and there's no load management taking place.
Which system is right for you will vary with you.