Dynamic residential power system
Not sure how things are right now, but I think you will pretty much lose money mining any well-stablished crypto currency.

Second, the proper way to do it would be to have the mining rig know the current solar power and house consumption and properly size how much energy it could use at that time, since turning it on and off might hurt performance or reduce the life of the rig.
Lastly, it might be possible to use the simple approach you suggested, turning the device on/off based on some controller connected to the inverter (since most of them nowadays have apps you should be able to have some "computer" read those info). But that seems flawed, since it would only work for some fixed amount of surplus energy and would probably shutdown the rig all the time unless you have a huge safety margin for the power consumed by the rig.