Hello @Daro1003,
I looked to your both posts
Your MQTT configuration is okay. The "Prevent Loop" configuration has been set to "True".
The other pictures show exactly, what I had expected to see. Multiple identical messages means a loop.
However I have no idea, yet, where that loop will be introduced,
Is it the Shelly 2PM Gen 3 unit, that returns a message? I cannot test that, as I do not have one available here.
or
Is it "Dashticz" that causes the loop? I do not expect that, as I can't get an idea, how that should work.
I don't think that "Dashticz" interferes with MQTT.
But I cannot test that either, as I do not have "Dashticz" installed.
I have modified the "Function" node a little and I have introduced a "Filter" (RBE) node.
See:

- Screenshot_Shelly 2PM GEN3 and RBE.png (27.99 KiB) Viewed 121 times
I have added the flow for the "Function" node, called "Control Domoticz Switch" and the "Filter" node, called "Prevent Loop" , below:
Code: Select all
[
{
"id": "2a56e8a2ce739840",
"type": "function",
"z": "cfcf4d6d274167af",
"name": "Control Domoticz Switch",
"func": "let msg1 = {};\nlet msg2 = {};\nmsg1.topic = \"shellies/switches\";\nmsg2.topic = \"shellies/temperature\";\n\nlet sidx = (flow.get(msg.topic.split(\"/\")[0])).sidx;\nlet tidx = (flow.get(msg.topic.split(\"/\")[0])).tidx;\n\n//Open (for Reversed Position)\nif (msg.payload.current_pos === 100) {\n msg1.payload = { \"command\": \"udevice\", \"idx\": sidx, \"nvalue\": 1, \"svalue\": \"100\" }\n}\n\n//Closed (for Reversed Position)\nif (msg.payload.current_pos === 0) {\n msg1.payload = { \"command\": \"udevice\", \"idx\": sidx, \"nvalue\": 0, \"svalue\": \"0\" }\n}\n\n//Percentage (for Reversed Position)\nif ((msg.payload.current_pos > 0) && (msg.payload.current_pos < 100)) {\n msg1.payload = { \"command\": \"udevice\", \"idx\": sidx, \"nvalue\": 2, \"svalue\": msg.payload.current_pos.toString() }\n}\n\n//Temperature\nmsg2.payload = { \"command\": \"udevice\", \"idx\": tidx, \"nvalue\": 0, \"svalue\": msg.payload.temperature.tC.toString() }\n\nreturn [[msg1,msg2]];",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 480,
"wires": [
[
"7ae122c721d614e4",
"eb28f7bede650b97"
]
]
},
{
"id": "eb28f7bede650b97",
"type": "rbe",
"z": "cfcf4d6d274167af",
"name": "Prevent Loop",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 790,
"y": 480,
"wires": [
[
"f6cf694ec8750a8b",
"10f0146e2906fd36"
]
]
}
]
Can you replace the existing "Function" node with this new pair of nodes, as shown in the picture.
And test again. For the time being, leave the "Debug" node in place.
You said also:
But NOTE:
Although I turned off two nodes as in the post, in the morning the lighting no longer worked from the sensors, after turning off the entire flow, the lighting started working and has been working until today. The roller blind is controlled from the flow without temperature and everything is ok.
I do not understand that, as the "Function" node and the "MQTT Output" node were already disabled.
By disabling the whole flow, you disabled the stream from Domoticz to Shelly and the MQTT Input node in addition.
Or!
Do you have also flows with the Shelly nodes (http) active in some way. that those create the loop?
Let me know.
Regards