I think that in a comment I explained as check that switch is active reading through PHP State of the GPIO.
Nadhani kwamba katika maoni nilivyoeleza kama kuangalia swichi kwamba ni kusoma amilifu kupitia PHP hali ya GPIO ya.