Hi folkes,
I am a bit inpatient and cannot waiting for the Shelly binding to cover the new devices and I read that due to the new ESP32 and new API, Shelly devices can now run cloud and MQTT in parallel. So if you start controlling your new devices (e.g. the Shelly Plus 1PM) via MQTT, you are not missing out on anything else. So here is my thing code for the Shelly Plus 1PM:
UID: mqtt:topic:5d0f79cab1:b0df524d88
label: MQTT Shelly Plus 1PM
thingTypeUID: mqtt:topic
configuration:
payloadNotAvailable: off
payloadAvailable: on
bridgeUID: mqtt:broker:5d0f79cab1
location: MQTT
channels:
- id: id
channelTypeUID: mqtt:number
label: ID
description: ""
configuration:
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.id
- id: source
channelTypeUID: mqtt:string
label: Quelle
description: ""
configuration:
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.source
- id: output
channelTypeUID: mqtt:string
label: Ausgang
description: ""
configuration:
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.output
- id: apower
channelTypeUID: mqtt:number
label: Leistung
description: ""
configuration:
unit: W
formatBeforePublish: "%.2f"
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.apower
- id: voltage
channelTypeUID: mqtt:number
label: Spannung
description: null
configuration:
unit: V
formatBeforePublish: "%.2f"
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.voltage
- id: current
channelTypeUID: mqtt:number
label: Strom
description: null
configuration:
unit: A
formatBeforePublish: "%.2f"
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.current
- id: aenergy
channelTypeUID: mqtt:number
label: Energie
description: null
configuration:
unit: Wh
formatBeforePublish: "%.2f"
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.aenergy.total
- id: temperature
channelTypeUID: mqtt:number
label: Temperatur
description: null
configuration:
unit: °C
formatBeforePublish: "%.2f"
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.temperature.tC
- id: input
channelTypeUID: mqtt:switch
label: Input
description: ""
configuration:
stateTopic: shellyplus1pm-44179393f8d0/status/input:0
transformationPattern: JSONPATH:$.state
off: "false"
on: "true"
- id: control
channelTypeUID: mqtt:switch
label: Schalter
description: null
configuration:
commandTopic: shellyplus1pm-44179393f8d0/rpc
formatBeforePublish: '{"src":"openhab", "method":"Switch.Set", "params":{"id":0,"on":%s}}'
stateTopic: shellyplus1pm-44179393f8d0/status/switch:0
transformationPattern: JSONPATH:$.output
off: "false"
on: "true"
- id: online
channelTypeUID: mqtt:switch
label: Verbunden
description: ""
configuration:
stateTopic: shellyplus1pm-44179393f8d0/online
off: "false"
on: "true"
- id: cloud
channelTypeUID: mqtt:switch
label: Cloud
description: ""
configuration:
stateTopic: shellyplus1pm-44179393f8d0/status/cloud
transformationPattern: JSONPATH:$.connected
off: flase
on: "true"
- id: mqtt
channelTypeUID: mqtt:switch
label: MQTT
description: ""
configuration:
stateTopic: shellyplus1pm-44179393f8d0/status/cloud
transformationPattern: JSONPATH:$.connected
off: "false"
on: "true"
- id: kvs1
channelTypeUID: mqtt:string
label: KVS1
description: null
configuration:
commandTopic: shellyplus1pm-44179393f8d0/rpc
postCommand: true
formatBeforePublish: '{"src":"openhab","method":"KVS.Get","params":{"id":1,"key":"admin"}}'
stateTopic: shellyplus1pm-44179393f8d0/openhab/rpc
transformationPattern: JSONPATH:$.params.value
You will need the MQTT binding of course and an MQTT broker like mosquitto (but that is a quite easy thing to get installed)