PIRSwitch functions