In the case of Spain, at least, they own the grid, so all solar energy that you sell to distributors because you have no use for it yourself, they’ll only pay you peanuts for it and they will still make a devious profit.
The two solar panels companies that I got in contact with weren’t interested in selling me a quantity small enough that was coherent with my needs, and they’d charge me a premium if I wasn’t willing to make a contract with them to sell them specifically the excess energy.
But if you have batteries at home you almost don’t need the grid. Add an EV and you hit two birds with one stone.
It’s certainly possible, but is it worth it?
EV batteries tend to use some of the best technology available in order to get power density and energy density where they need to be. A house battery can be much bigger and heavier if that makes it cheaper.
Somebody at work was just telling me about some efforts to reuse e.g. Tesla battery packs for home or grid storage rather than recycling them. Even if the pack can only hold 80% of its original charge, that’s fine if you can just buy a few of those cheaply.