Hi There,
unfortunately the standard shelly binding does not support shelly pro devices. Three Years ago htttito already posted a solution for generic MQTT Binding .
UID: mqtt:topic:7d3c004212:Shelly4_Heizpatrone
label: Shelly4_Heizpatrone
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:7d3c004212
channels:
- id: Relay0
channelTypeUID: mqtt:switch
label: Relay0
description: ""
configuration:
commandTopic: shellies/shellypro4pm-84cca87d86bc/rpc
formatBeforePublish: '{"src":"MQTT","method":"Switch.Set", "params":{"id":0,"on":%s}}'
stateTopic: shellies/shellypro4pm-84cca87d86bc/status/switch:0
transformationPattern: JSONPATH:$.output
off: "false"
on: "true"
- id: Relay0_Volt
channelTypeUID: mqtt:number
label: Relay0_Volt
description: null
configuration:
unit: V
formatBeforePublish: "%.4f"
stateTopic: shellies/shellypro4pm-84cca87d86bc/status/switch:0
transformationPattern: JSONPATH:$.voltage
- id: Relay0_Watt
channelTypeUID: mqtt:number
label: Relay0_Watt
description: ""
configuration:
unit: W
formatBeforePublish: "%.4f"
stateTopic: shellies/shellypro4pm-84cca87d86bc/status/switch:0
transformationPattern: JSONPATH:$.apower
- id: Relay0_Ampere
channelTypeUID: mqtt:number
label: Relay0_Ampere
description: null
configuration:
unit: A
formatBeforePublish: "%.4f"
stateTopic: shellies/shellypro4pm-84cca87d86bc/status/switch:0
transformationPattern: JSONPATH:$.current
unfortunately it seems that the MQTT code is not any longer the same.
By monitoring the signals of the Shelly pro 3PM via MQTT Explorer i couldn’t find the signal in root like shellies.… as discribed by htttito.
my PRO devices show a green payload if adresses like this
UID: mqtt:topic:synologyMQTTmosquitobroker:b5e5c9c274
label: DGF Flur Shelly pro Dimmer 1 pm
final-shellyprodm1pm-34987aa8e914-192.168.178.130
thingTypeUID: mqtt:topic
configuration:
payloadNotAvailable: "false"
availabilityTopic: shellyprodm1pm-34987aa8e914/online
payloadAvailable: "true"
bridgeUID: mqtt:broker:synologyMQTTmosquitobroker
channels:
- id: ch1Dim
channelTypeUID: mqtt:dimmer
label: Channel 1 Dimmer
configuration:
postCommand: false
retained: false
formatBeforePublish: '{"id":0, "src":"user_1", "method":"Light.Set",
"params":{"id":0, "brightness": %d}}'
commandTopic: shellyprodm1pm-34987aa8e914/rpc
step: 1
stateTopic: shellyprodm1pm-34987aa8e914/events/rpc
transformationPattern: REGEX:(.*light:0.*brightness.*)∩JSONPATH:$.params["light:0"]brightness
- id: ch1Sw
channelTypeUID: mqtt:switch
label: Channel 1 Switch
configuration:
postCommand: false
retained: false
formatBeforePublish: '{"id":0, "src":"user_1", "method":"Light.Set",
"params":{"id":0, "on": %s}}'
commandTopic: shellyprodm1pm-34987aa8e914/rpc
stateTopic: shellyprodm1pm-34987aa8e914/rpc
transformationPattern: REGEX:(.*light:0.*output.*)∩JSONPATH:$.params.["light:0"]output
off: "false"
on: "true"
- id: ch1In
channelTypeUID: mqtt:switch
label: Channel 1 Input
configuration:
stateTopic: shellyprodm1pm-34987aa8e914/events/rpc
transformationPattern: REGEX:(.*input:0.*event.*)∩JSONPATH:$.params.events[0]event
off: btn_up
on: btn_down
- id: ch2In
channelTypeUID: mqtt:switch
label: Channel 2 Input
configuration:
stateTopic: shellyprodm1pm-34987aa8e914/events/rpc
transformationPattern: REGEX:(.*input:1.*event.*)∩JSONPATH:$.params.events[0]event
off: btn_up
on: btn_down
- id: ch1InStr
channelTypeUID: mqtt:string
label: Channel 1 Input String
configuration:
stateTopic: shellyprodm1pm-34987aa8e914/events/rpc
transformationPattern: REGEX:(.*input:0.*event.*)∩JSONPATH:$.params.events[0]event
- id: ch2InStr
channelTypeUID: mqtt:string
label: Channel 2 Input String
configuration:
stateTopic: shellyprodm1pm-34987aa8e914/events/rpc
transformationPattern: REGEX:(.*input:1.*event.*)∩JSONPATH:$.params.events[0]event
- id: ch1Power
channelTypeUID: mqtt:number
label: Channel 1 Power
configuration:
stateTopic: shellyprodm1pm-34987aa8e914/events/rpc
transformationPattern: REGEX:(.*light:0.*apower.*)∩JSONPATH:$.params["light:0"]apower
unit: W
addons like regex and jasonpath are installed addionally.
But all trials to adjust the code from htttito to my Shelly Pro Dimmer code went wrong.
This is what i tied so far without being able to communicate with the PRO 3 PM device even if the code shoes a “green” payload"
UID: mqtt:topic:synologyMQTTmosquitobroker:9e5cd7a60f
label: OGB Bad Deckenstrahler weiss 192.168.178.160
thingTypeUID: mqtt:topic
configuration:
payloadNotAvailable: "false"
availabilityTopic: shellypro3-fce8c0db4794/online
payloadAvailable: "true"
bridgeUID: mqtt:broker:synologyMQTTmosquitobroker
location: Shelly
channels:
- id: Relay0
channelTypeUID: mqtt:switch
label: Relay0
configuration:
commandTopic: shellypro3-fce8c0db4794/rpc
formatBeforePublish: '{"src":"MQTT","method":"Switch.Set", "params":{"id":0,"on":%s}}'
stateTopic: shellypro3-fce8c0db4794/status/switch:0
transformationPattern: JSONPATH:$.output
off: "false"
on: "true"
- id: Relay0_Volt
channelTypeUID: mqtt:number
label: Relay0_Volt
configuration:
unit: V
formatBeforePublish: "%.4f"
stateTopic: shellypro3-fce8c0db4794/status/switch:0
transformationPattern: JSONPATH:$.voltage
- id: Relay0_Watt
channelTypeUID: mqtt:number
label: Relay0_Watt
configuration:
unit: W
formatBeforePublish: "%.4f"
stateTopic: shellypro3-fce8c0db4794/status/switch:0
transformationPattern: JSONPATH:$.apower
- id: Relay0_Ampere
channelTypeUID: mqtt:number
label: Relay0_Ampere
configuration:
unit: A
formatBeforePublish: "%.4f"
stateTopic: shellies/shellypro3-fce8c0db4794/status/switch:0
transformationPattern: JSONPATH:$.current
- id: ch1In
channelTypeUID: mqtt:switch
label: Channel 1 Input
configuration:
stateTopic: shellypro3-fce8c0db4794events/rpc
transformationPattern: REGEX:(.*input:0.*event.*)∩JSONPATH:$.params.events[0]event
off: btn_up
on: btn_down
- id: ch1Sw
channelTypeUID: mqtt:switch
label: Channel 0 Switch
configuration:
postCommand: false
retained: false
formatBeforePublish: '{"src":"User_1","method":"Switch.Set", "params":{"id":0,"on":%s}}'
commandTopic: shellypro3-fce8c0db4794/rpc
stateTopic: shellypro3-fce8c0db4794/rpc
transformationPattern: REGEX:(.*switch:0.*output.*)∩JSONPATH:$.params.["switch:0"]output
off: "false"
on: "true"
- id: ch1Power
channelTypeUID: mqtt:number
label: Channel 1 Power
configuration:
stateTopic: shellypro3-fce8c0db4794/events/rpc
transformationPattern: REGEX:(.*switch:0.*apower.*)∩JSONPATH:$.params["switch:0"]apower
unit: W
looking forward getting suggestions from advanced MQTT cracks. Unfortunately Im a beginner and don’t realy understand the MQTT code
best regards Runa