je viens de me lancer dans node red et j'ai le controle des 2 boutons pour activer des interrupteurs distants sous domoticz
( au cas où ça intéresse du monde )
Code : Tout sélectionner
[{"id":"fdd0aacddc7906c2","type":"tab","label":"test commandes","disabled":false,"info":"","env":[]},{"id":"a76e299305a7b737","type":"mqtt in","z":"fdd0aacddc7906c2","name":"mqtt-nspanel-RESULT","topic":"nspanel/NsPanel_C72008/stat/RESULT/#","qos":"2","datatype":"auto-detect","broker":"7f2127f22c7f0e11","nl":false,"rap":true,"rh":0,"inputs":0,"x":340,"y":580,"wires":[["82ed6202c6b0c45c","16daf4d58ec4ebce"]]},{"id":"82ed6202c6b0c45c","type":"debug","z":"fdd0aacddc7906c2","name":"sortie","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.POWER1","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":480,"wires":[]},{"id":"b1f4b53ea20105a5","type":"debug","z":"fdd0aacddc7906c2","name":"sortie","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":620,"wires":[]},{"id":"16daf4d58ec4ebce","type":"function","z":"fdd0aacddc7906c2","name":"function 1","func":"if (msg.payload.POWER1) { msg.payload.idx = 67\n if (msg.payload.POWER1 == \"ON\") {\n msg.payload.switchcmd = \"On\"\n }\n else {\n msg.payload.switchcmd = \"Off\"\n }\n}\nif (msg.payload.POWER2) { msg.payload.idx = 68 \n if (msg.payload.POWER2 == \"ON\") {\n msg.payload.switchcmd = \"On\"\n }\n else {\n msg.payload.switchcmd = \"Off\"\n }\n}\n\n \nmsg.payload.command =\"switchlight\"\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":620,"wires":[["abf52436c7ebe2c5"]]},{"id":"abf52436c7ebe2c5","type":"mqtt out","z":"fdd0aacddc7906c2","name":"domoticz in","topic":"domoticz/in","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"7f2127f22c7f0e11","x":1070,"y":700,"wires":[]},{"id":"7f2127f22c7f0e11","type":"mqtt-broker","name":"mosquitto","broker":"192.168.1.20","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
et même si c'est pas forcément utile vu que tasmota peut directement envoyer l'info des interrupteurs à domoticz
par contre pour la correction du bug des outlets qui se désactive, le rappel mqtt fonctionne:
Code : Tout sélectionner
[
{
"id": "45c012a0a03942ac",
"type": "tab",
"label": "gestion boutons",
"disabled": false,
"info": "",
"env": []
},
{
"id": "73f55a916c332953",
"type": "mqtt in",
"z": "45c012a0a03942ac",
"name": "mqtt-nspanel-RESULT",
"topic": "nspanel/NsPanel_C72008/tele/RESULT/#",
"qos": "2",
"datatype": "auto-detect",
"broker": "7f2127f22c7f0e11",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 220,
"y": 180,
"wires": [
[
"eef7b294daa2de53",
"cb23cbaea461b354"
]
]
},
{
"id": "eef7b294daa2de53",
"type": "debug",
"z": "45c012a0a03942ac",
"name": "sortie",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 450,
"y": 80,
"wires": []
},
{
"id": "cb23cbaea461b354",
"type": "mqtt out",
"z": "45c012a0a03942ac",
"name": "nspanel command",
"topic": "nspanel/NsPanel_C72008/cmnd/NSPsend",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "7f2127f22c7f0e11",
"x": 270,
"y": 320,
"wires": []
},
{
"id": "7f2127f22c7f0e11",
"type": "mqtt-broker",
"name": "mosquitto",
"broker": "192.168.1.20",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]