Controlling Shelly using MQTT

To control a Shelly (in this example Shelly Plus 1) using MQTT simply use these files:

shelly.things:

Thing mqtt:topic:m25entrancelight (mqtt:broker:mosquitto) {
    Channels:
        Type switch : switch "M25EntranceLight" [
          stateTopic="bridge/m25/wifi/m25entrancelight/status/switch:0", 
          transformationPattern="JSONPATH:$.output", 
          commandTopic="bridge/m25/wifi/m25entrancelight/rpc", 
          formatBeforePublish="{\"src\":\"MQTT\",\"method\":\"Switch.Set\", \"params\":{\"id\":0,\"on\":%s}}", 
          on="true", 
          off="false" 
        ]
}

shelly.items:

Switch M25EntranceLightSwitch "M25 Entrance Light Switch" <switch> { channel="mqtt:topic:m25entrancelight:switch" }
1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.