This was not the intended use of the flow and I can assume that it sometimes works as you described.
Actually my flow acts as a trigger to the "Open" and "Closed" test nodes, that you used before.
So this is not the way to go. Delete everything, what you created so far.
I looked to your first posts again and I concluded that we should use 4 "Blinds Percentage"Switches as shown on the next picture.
I translated the Polish text as good as possible to English, except one, as Google Translate could not help me with that
As the other Switch with the STOP button does not work, we skip that one.
As you have shown me 4 switches, I assume you have 4 different Shelly 2PM Gen 3 units.
In my example the Bathroom Bedroom has IDX 12, the Shrinkage Middle has IDX 13, the Terace Door 14 and the Kamil Roleta has IDX 15.
1. MQTT input node, called "From Domoticz" >> Insert you own MQTT configuration (as you did before)
2. "Switch" node, called "Filter Switch Type" >> No action required. so do not touch.
3. "Change"node, called "Set Topic" >> No action required. so do not touch.
4. "Function"node, called "Blinds + Percentage" >> No action required. so do not touch.
5. "Switch" node, called "Switch" >> Insert your own Domoticz IDX's numbers, instead of my number 12, 13, 14 and 15.
6. "Shelly" nodes >> Insert your own IP address of your Shelly devices, so that they show "Connected".
The everything should work.
Code: Select all
[
{
"id": "f3bd0c45c36754fb",
"type": "mqtt in",
"z": "f55ebfe97fab5883",
"name": "From Domoticz",
"topic": "domoticz/out",
"qos": "2",
"datatype": "auto-detect",
"broker": "38b35487299a036d",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 280,
"y": 980,
"wires": [
[
"87f8021838582002"
]
]
},
{
"id": "87f8021838582002",
"type": "switch",
"z": "f55ebfe97fab5883",
"name": "Filter Switch Type",
"property": "payload.switchType",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Blinds Percentage",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 510,
"y": 980,
"wires": [
[
"666f104da4e89fa5"
]
]
},
{
"id": "666f104da4e89fa5",
"type": "change",
"z": "f55ebfe97fab5883",
"name": "Set Topic",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "payload.idx",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 720,
"y": 980,
"wires": [
[
"14b9d673107d3767"
]
]
},
{
"id": "14b9d673107d3767",
"type": "function",
"z": "f55ebfe97fab5883",
"name": "Blinds + Percentage ",
"func": "// Function Blinds and Percentage\n\n//Closed\n\nif (msg.payload.nvalue === 0) {\n\n msg.payload = {\n method: \"Cover.Close\",\n parameters : {\n id : 0,\n // duration : 1, // optional time in seconds\n }\n }\n\n}\n\n//Open\n\nif (msg.payload.nvalue === 1) {\n\n msg.payload = {\n method: \"Cover.Open\",\n parameters : {\n id : 0,\n // duration : 1, // optional time in seconds\n }\n }\n\n}\n\n//Percentage\n\nif (msg.payload.nvalue === 2) {\n\n msg.payload = {\n method: \"Cover.GoToPosition\",\n parameters : {\n id : 0,\n pos : msg.payload.svalue1, \n // rel : -10, // as an alternative to pos you can pass rel in %\n }\n }\n\n}\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 940,
"y": 980,
"wires": [
[
"e0498efaff3877b0"
]
]
},
{
"id": "e0498efaff3877b0",
"type": "switch",
"z": "f55ebfe97fab5883",
"name": "Switch",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "12",
"vt": "num"
},
{
"t": "eq",
"v": "13",
"vt": "num"
},
{
"t": "eq",
"v": "14",
"vt": "num"
},
{
"t": "eq",
"v": "15",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 1150,
"y": 980,
"wires": [
[
"f8da7a7048255fb3"
],
[
"441586f8d647d874"
],
[
"4cc16a088494d958"
],
[
"06521e1bf7401e8b"
]
]
},
{
"id": "f8da7a7048255fb3",
"type": "shelly-gen2",
"z": "f55ebfe97fab5883",
"hostname": "192.168.1.73",
"description": "",
"mode": "polling",
"verbose": false,
"server": "04263f2d054cc2a1",
"uploadretryinterval": "5000",
"pollinginterval": 5000,
"pollstatus": false,
"getstatusoncommand": false,
"devicetype": "S3SW-002P16EU",
"devicetypemustmatchexactly": false,
"captureblutooth": false,
"outputs": 1,
"x": 1340,
"y": 860,
"wires": [
[]
]
},
{
"id": "441586f8d647d874",
"type": "shelly-gen2",
"z": "f55ebfe97fab5883",
"hostname": "192.168.1.74",
"description": "",
"mode": "polling",
"verbose": false,
"server": "04263f2d054cc2a1",
"uploadretryinterval": "5000",
"pollinginterval": 5000,
"pollstatus": false,
"getstatusoncommand": false,
"devicetype": "S3SW-002P16EU",
"devicetypemustmatchexactly": false,
"captureblutooth": false,
"outputs": 1,
"x": 1340,
"y": 940,
"wires": [
[]
]
},
{
"id": "4cc16a088494d958",
"type": "shelly-gen2",
"z": "f55ebfe97fab5883",
"hostname": "192.168.1.75",
"description": "",
"mode": "polling",
"verbose": false,
"server": "04263f2d054cc2a1",
"uploadretryinterval": "5000",
"pollinginterval": 5000,
"pollstatus": false,
"getstatusoncommand": false,
"devicetype": "S3SW-002P16EU",
"devicetypemustmatchexactly": false,
"captureblutooth": false,
"outputs": 1,
"x": 1340,
"y": 1020,
"wires": [
[]
]
},
{
"id": "06521e1bf7401e8b",
"type": "shelly-gen2",
"z": "f55ebfe97fab5883",
"hostname": "192.168.1.76",
"description": "",
"mode": "polling",
"verbose": false,
"server": "04263f2d054cc2a1",
"uploadretryinterval": "5000",
"pollinginterval": 5000,
"pollstatus": false,
"getstatusoncommand": false,
"devicetype": "S3SW-002P16EU",
"devicetypemustmatchexactly": false,
"captureblutooth": false,
"outputs": 1,
"x": 1340,
"y": 1100,
"wires": [
[]
]
},
{
"id": "38b35487299a036d",
"type": "mqtt-broker",
"name": "Raspberry Pi 1",
"broker": "192.168.10.51",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "04263f2d054cc2a1",
"type": "shelly-gen2-server",
"port": "10001",
"hostname": "unimatrix"
}
]