Here you can see the topics with their respective scripts that will read and set values ​​from and to the device. Topic Response Topic: shellies/shellyplug-s-/relay/0/status Script: var data = JSON.parse(payload); return data.ison ? 1 : 0; Topic Write Topic: shellies/shellyplug-s-/relay/0/command Script: return payload == 0 ? "off" : "on"; Topic Event Topic: shellies/shellyplug-s-040967/relay/0 Script: return payload == "off" ? 0 : 1;