Openhab Shelly Pro 4PM MQTT State Topic

Hi !

Has anyone found out the Openhab MQTT State Topic for the new Shelly Pro 4PM?
I just can’t get it.
Switching ON/OFF per switch works via MQTT.
The only thing that bothers me is the feedback whether the switch is ON/OFF.

Thank you!

I am also searching for the correct State Topic for Shelly Plus/Pro.

My Thing so far:

label: Stallgasse-1
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:f1323ff450
location: Stallgasse
channels:
  - id: Stallgasse_1_0
    channelTypeUID: mqtt:switch
    label: Lichtschiene Bar
    description: ""
    configuration:
      commandTopic: shellies/stallgasse-1/rpc
      stateTopic: shellies/stallgasse-1/relay/0
      off: '{"method":"Switch.Set","params":{"id":0,"on":false}}'
      on: '{"method":"Switch.Set","params":{"id":0,"on":true}}'
  - id: Stallgasse_1_1
    channelTypeUID: mqtt:switch
    label: Lichtschiene Stallgasse
    description: ""
    configuration:
      commandTopic: shellies/stallgasse-1/rpc
      stateTopic: shellies/stallgasse-1/relay/1
      off: '{"method":"Switch.Set","params":{"id":1,"on":false}}'
      on: '{"method":"Switch.Set","params":{"id":1,"on":true}}'
  - id: Stallgasse_1_2
    channelTypeUID: mqtt:switch
    label: Schotterweg
    description: Aussen Schotterweg
    configuration:
      commandTopic: shellies/stallgasse-1/rpc
      stateTopic: shellies/stallgasse-1/relay/2
      off: '{"method":"Switch.Set","params":{"id":2,"on":false}}'
      on: '{"method":"Switch.Set","params":{"id":2,"on":true}}'
  - id: Stallgasse_1_3
    channelTypeUID: mqtt:switch
    label: Pferdebox
    description: Pferdebox
    configuration:
      commandTopic: shellies/stallgasse-1/rpc
      stateTopic: shellies/stallgasse-1/relay/3
      off: '{"method":"Switch.Set","params":{"id":3,"on":false}}'
      on: '{"method":"Switch.Set","params":{"id":3,"on":true}}'

Hi! My solution:
Hope it helps anybody :slight_smile:

- id: Relay3
    channelTypeUID: mqtt:switch
    label: Relay3
    description: ""
    configuration:
      commandTopic: shellies/shellypro4pm-84cca87d86bc/rpc
      formatBeforePublish: '{"src":"MQTT","method":"Switch.Set", "params":{"id":3,"on":%s}}'
      stateTopic: shellies/shellypro4pm-84cca87d86bc/events/rpc
      transformationPattern: JSONPATH:$.params.switch:3.output
      off: "false"
      on: "true"

Now the complete Solution

1 Like