SwitchMode1 1 SwitchTopic 0 Rule1 on Switch1#state=1 do publish tasmota/%topic%/PIR1 ON endon on Switch1#state=0 do Publish tasmota/%topic%/PIR1 OFF endon Rule1 1