Here you can see how the topic Event has been set up with the device topic and the correct script. Topic Event Topic: shellies/shellyix3-/input/0 Script: return payload == "0" ? 0 : 1;