Shelly-Adapter in ioBroker ist installiert und die einzelnen shellys (shellies??) werden im Objekt-Baum angezeigt.
In node-red funktioniert bei mir folgender flow für einen Shelly-Plug.
[
{
"id": "9a97022c.2e5d2",
"type": "ioBroker in",
"z": "c6b752e9.23414",
"name": "Steckdose Arbeitszimmer Status",
"topic": "shelly.0.SHPLG-S#F8C7F8#1.Relay0.Switch",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 170,
"y": 60,
"wires": [
[
"57c3062e.c299c8"
]
]
},
{
"id": "6fa2379e.100e68",
"type": "homeeDevice",
"z": "c6b752e9.23414",
"virtual-homee": "",
"name": "Stecker Arbeitszimmer",
"nodeId": "1500",
"showNodeId": true,
"profile": "13",
"icon": "nodeicon_plug",
"attributes": "[{\"id\":1501,\"node_id\":1500,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":1502,\"node_id\":1500,\"instance\":0,\"minimum\":0,\"maximum\":2500,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"W\",\"step_value\":1,\"editable\":0,\"type\":3,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":1503,\"node_id\":1500,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":4,\"state\":1,\"last_changed\":12345555,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"}]",
"x": 670,
"y": 60,
"wires": [
[
"6152364d.127818"
]
]
},
{
"id": "57c3062e.c299c8",
"type": "function",
"z": "c6b752e9.23414",
"name": "On/Off",
"func": "if (msg.payload === \"true\"){var status =1}\nif (msg.payload === \"false\"){var status =0}\n\nnode.send({payload:{\"attribute\":{\"id\":1501,\"value\":status}}})",
"outputs": 1,
"noerr": 0,
"x": 410,
"y": 60,
"wires": [
[
"6fa2379e.100e68"
]
]
},
{
"id": "fa20464e.9a73c8",
"type": "ioBroker in",
"z": "c6b752e9.23414",
"name": "Steckdose Arbeitszimmer Power",
"topic": "shelly.0.SHPLG-S#F8C7F8#1.Relay0.Power",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"x": 170,
"y": 120,
"wires": [
[
"fcf68b16.be90f8"
]
]
},
{
"id": "6152364d.127818",
"type": "function",
"z": "c6b752e9.23414",
"name": "",
"func": "if (msg.payload.attributeId === 1501 && msg.payload.targetValue === 1){node.send({payload:'true'})}\nif (msg.payload.attributeId === 1501 && msg.payload.targetValue === 0){node.send({payload:'false'})}",
"outputs": 1,
"noerr": 0,
"x": 870,
"y": 60,
"wires": [
[
"56a287e6.906c88",
"f323a2bb.de363"
]
]
},
{
"id": "56a287e6.906c88",
"type": "ioBroker out",
"z": "c6b752e9.23414",
"name": "Steckdose Arbeitszimmer Schalter",
"topic": "shelly.0.SHPLG-S#F8C7F8#1.Relay0.Switch",
"ack": "false",
"autoCreate": "false",
"x": 1240,
"y": 60,
"wires": []
},
{
"id": "2182ba95.efee06",
"type": "ioBroker in",
"z": "c6b752e9.23414",
"name": "Steckdose Arbeitszimmer Energy",
"topic": "shelly.0.SHPLG-S#F8C7F8#1.Relay0.Energy",
"payloadType": "value",
"onlyack": false,
"func": "all",
"gap": "",
"x": 170,
"y": 180,
"wires": [
[
"2de39341.552b2c"
]
]
},
{
"id": "f323a2bb.de363",
"type": "debug",
"z": "c6b752e9.23414",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"x": 1170,
"y": 160,
"wires": []
},
{
"id": "2de39341.552b2c",
"type": "function",
"z": "c6b752e9.23414",
"name": "Gesamt",
"func": "var energy = parseFloat(msg.payload);\nmsg.payload = {\"attribute\":{\"id\":1503, \"value\": energy}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 420,
"y": 180,
"wires": [
[
"6fa2379e.100e68"
]
]
},
{
"id": "fcf68b16.be90f8",
"type": "function",
"z": "c6b752e9.23414",
"name": "Verbrauch",
"func": "var power = parseFloat(msg.payload);\nmsg.payload = {\"attribute\":{\"id\":1502, \"value\": power}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 430,
"y": 120,
"wires": [
[
"6fa2379e.100e68"
]
]
}
]