I don’t see that as bad. I personally use a string that gets updated with “Home” or “Away” by the iphone detection script: iPhone Presence Detection with hping3 and ARP
I then check if the string equals what I’m looking for in my rules. Basically the same, you just check if the switch is on or off instead.