I made a game about this a couple years ago, which made it to front page of HN! https://smarthome.steviep.xyz