Generalized solution in HomeAidPi.py