Hallo zusammen,
nachdem ich hier schon das Auslesen und Verarbeiten des Schaltstatus des Shelly Plus 1 und Plus 1PM mittels eines Workarounds beschrieben habe, geht es hier nun um die Werte des Shelly Plus 1 PM.
Es ist mir wichtig, mich an dieser Stelle beim User mickym aus dem ioBroker Forum zu bedanken. Er hat mir den Lösungsweg aufgezeigt und wichtige Hinweise und Erklärungen gegeben.
Im Flow endet dies in der Ausgabe der 3 Debug-Nodes ganz rechts. Stattdessen kann man natürlich einfach z.B. einen eMail-Node oder einen "ioBroker-out"-Node setzen, um weitere Aktionen auszuführen.
Hier nun der neue Flow zum Parsen der Werte Schaltzustand des Ausgangs, Spannungswert und Leistungswert.
Bildschirmfoto vom 2021-09-25 14-38-20.png
der Flow zum Importieren:
Spoiler anzeigen
[
{
"id": "c423f322.c4806",
"type": "tab",
"label": "MQTT Test Shelly Plus 1PM",
"disabled": false,
"info": ""
},
{
"id": "61a23899.cef4f",
"type": "mqtt in",
"z": "c423f322.c4806",
"name": "",
"topic": "shellyplus1pm-000000000000/events/rpc",
"qos": "0",
"datatype": "auto",
"broker": "f56dd7d5.a4df",
"nl": false,
"rap": true,
"rh": 0,
"x": 260,
"y": 400,
"wires": [
[
"4e7d2b9c.0d0e7c",
"b5b3af45.611e58"
]
]
},
{
"id": "4e7d2b9c.0d0e7c",
"type": "json",
"z": "c423f322.c4806",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 550,
"y": 400,
"wires": [
[
"8742e4e8.808ff8",
"6642339a.48223c",
"de019655.b36f1",
"7fda335c.d93144"
]
]
},
{
"id": "8742e4e8.808ff8",
"type": "debug",
"z": "c423f322.c4806",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 770,
"y": 300,
"wires": []
},
{
"id": "5fa6995e.2ec57",
"type": "debug",
"z": "c423f322.c4806",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 400,
"wires": []
},
{
"id": "6642339a.48223c",
"type": "change",
"z": "c423f322.c4806",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.params[\"switch:0\"].output",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 400,
"wires": [
[
"5fa6995e.2ec57"
]
]
},
{
"id": "b5b3af45.611e58",
"type": "debug",
"z": "c423f322.c4806",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 550,
"y": 300,
"wires": []
},
{
"id": "de019655.b36f1",
"type": "change",
"z": "c423f322.c4806",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.params[\"switch:0\"].apower",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 790,
"y": 540,
"wires": [
[
"7b0e25d7.36a7fc"
]
]
},
{
"id": "33c470a3.c1785",
"type": "comment",
"z": "c423f322.c4806",
"name": "Schaltstatus",
"info": "",
"x": 1010,
"y": 360,
"wires": []
},
{
"id": "857691ed.988cd",
"type": "comment",
"z": "c423f322.c4806",
"name": "Spannung",
"info": "",
"x": 1000,
"y": 620,
"wires": []
},
{
"id": "92173f3c.c3c92",
"type": "comment",
"z": "c423f322.c4806",
"name": "Leistung",
"info": "",
"x": 1000,
"y": 500,
"wires": []
},
{
"id": "7b0e25d7.36a7fc",
"type": "debug",
"z": "c423f322.c4806",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 540,
"wires": []
},
{
"id": "d3a0222c.5d24c",
"type": "debug",
"z": "c423f322.c4806",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 660,
"wires": []
},
{
"id": "7fda335c.d93144",
"type": "change",
"z": "c423f322.c4806",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.params[\"switch:0\"].voltage",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 770,
"y": 660,
"wires": [
[
"d3a0222c.5d24c"
]
]
},
{
"id": "f56dd7d5.a4df",
"type": "mqtt-broker",
"name": "MQTT-Broker ioB",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "*",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"sessionExpiry": ""
}
]
Anmerkung
Der nachfolgend abgebildeteTeil des Flows kann 1:1 für den Shelly Plus 1 übernommen werden.
Bildschirmfoto vom 2021-09-25 14-55-25.png
(restl. Nodes einfach entfernen. )