BTW, there is now an easy install version of this available through Smart Setup. No more cut and paste!
See #25 and 26 under convenience. One uses a switch to change the mode and one uses a switch to run a Hello Home Action.