Bon alors bonne nouvelle enfin presque (now j’ai plus de cheveux ! )
J’ai enfin réussi à avoir le fonctionnement dans les deux sens (relais IPX800V5 <=> Gladys) en utilisant des “commutateur” (ajouter le relais serait bien car pour moi commutateur=interrupteur )
et pareil coté IPX800V5
les suscribe MQTT coté IPX800V5
les publish MQTT coté IPX800V5
le flow graphique
et le debug dans l’ordre :
Relais 1 “On” depuis l’IPX800V5
Relais 1 “Off” depuis l’IPX800V5
Relais 1 “On” depuis Gladys
Relais 1 “Off” depuis Gladys
Et le flux au format json
[{"id":"cf6dc2aae7c8ab92","type":"tab","label":"Flow 3","disabled":false,"info":"","env":[]},{"id":"91ee9c360eac6d43","type":"mqtt out","z":"cf6dc2aae7c8ab92","name":"IPX800_V5-1","topic":"IPX800_V5-1","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"291914c5c9c68f02","x":1230,"y":100,"wires":[]},{"id":"c2659b7b2ff21d6e","type":"function","z":"cf6dc2aae7c8ab92","name":"selon payload \"[IPX]Relay state x\" true/false => 0/1","func":"var msg1,msg2;\n\nswitch (msg.payload) {\n \n case \"{\\\"[IPX]Relay state 1\\\":true}\":\n msg1 = {payload:\"1\" };\n break;\n case \"{\\\"[IPX]Relay state 1\\\":false}\":\n msg1 = {payload:\"0\" };\n break;\n \n case \"{\\\"[IPX]Relay state 2\\\":true}\":\n msg2 = {payload:\"1\" };\n break;\n case \"{\\\"[IPX]Relay state 2\\\":false}\":\n msg2 = {payload:\"0\" };\n break; \n \n default:\n break;\n}\n\nreturn[msg1,msg2];\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":220,"wires":[["d7e02d71312aa03e"],["6ea07d03df94f62e"]]},{"id":"d9a7d3602448c88a","type":"mqtt in","z":"cf6dc2aae7c8ab92","name":"IPX800_V5-1","topic":"IPX800_V5-1","qos":"1","datatype":"auto","broker":"291914c5c9c68f02","nl":false,"rap":true,"rh":0,"inputs":0,"x":150,"y":220,"wires":[["c2659b7b2ff21d6e"]]},{"id":"d7e02d71312aa03e","type":"mqtt out","z":"cf6dc2aae7c8ab92","name":"gladys/master/device/mqtt:IPX800_5-1_Relais1/feature/mqtt:IPX800_5-1_Relais1/state","topic":"gladys/master/device/mqtt:IPX800_5-1_Relais1/feature/mqtt:IPX800_5-1_Relais1/state","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"291914c5c9c68f02","x":1000,"y":180,"wires":[]},{"id":"6ea07d03df94f62e","type":"mqtt out","z":"cf6dc2aae7c8ab92","name":"gladys/master/device/mqtt:IPX800_5-1_Relais2/feature/mqtt:IPX800_5-1_Relais2/state","topic":"gladys/master/device/mqtt:IPX800_5-1_Relais2/feature/mqtt:IPX800_5-1_Relais2/state","qos":"1","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"291914c5c9c68f02","x":1000,"y":260,"wires":[]},{"id":"4dc3520e0af08d51","type":"mqtt in","z":"cf6dc2aae7c8ab92","name":"gladys/device/mqtt:IPX800_5-1_Relais1/feature/mqtt:IPX800_5-1_Relais1/state .","topic":"gladys/device/mqtt:IPX800_5-1_Relais1/feature/mqtt:IPX800_5-1_Relais1/state","qos":"1","datatype":"auto","broker":"291914c5c9c68f02","nl":false,"rap":true,"rh":0,"inputs":0,"x":350,"y":80,"wires":[["1bedbf53cbd0b7c2"]]},{"id":"e51228ced7b818c2","type":"mqtt in","z":"cf6dc2aae7c8ab92","name":"gladys/device/mqtt:IPX800_5-1_Relais2/feature/mqtt:IPX800_5-1_Relais2/state","topic":"gladys/device/mqtt:IPX800_5-1_Relais2/feature/mqtt:IPX800_5-1_Relais2/state","qos":"1","datatype":"auto","broker":"291914c5c9c68f02","nl":false,"rap":true,"rh":0,"inputs":0,"x":360,"y":140,"wires":[["1bedbf53cbd0b7c2"]]},{"id":"658e6d08a9bfa70c","type":"mqtt in","z":"cf6dc2aae7c8ab92","name":"#","topic":"#","qos":"2","datatype":"auto","broker":"291914c5c9c68f02","nl":false,"rap":true,"rh":0,"inputs":0,"x":130,"y":300,"wires":[["0b066345aae7ddb9"]]},{"id":"0b066345aae7ddb9","type":"debug","z":"cf6dc2aae7c8ab92","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":340,"y":300,"wires":[]},{"id":"1bedbf53cbd0b7c2","type":"function","z":"cf6dc2aae7c8ab92","name":"selon topic => [IPX]Relay cmd x : true/false","func":"var msg1,msg2;\n\nswitch (msg.topic) {\n case \"gladys/device/mqtt:IPX800_5-1_Relais1/feature/mqtt:IPX800_5-1_Relais1/state\":\n \n switch (msg.payload) {\n case \"0\":\n msg1 = {payload:\"{\\\"[IPX]Relay cmd 1\\\":false}\" };\n break;\n case \"1\":\n msg1 = {payload:\"{\\\"[IPX]Relay cmd 1\\\":true}\" };\n break;\n default:\n break;\n }\n break;\n \n case \"gladys/device/mqtt:IPX800_5-1_Relais2/feature/mqtt:IPX800_5-1_Relais2/state\":\n\n switch (msg.payload) {\n case \"0\":\n msg1 = {payload:\"{\\\"[IPX]Relay cmd 2\\\":false}\" };\n break;\n case \"1\":\n msg1 = {payload:\"{\\\"[IPX]Relay cmd 2\\\":true}\" };\n break;\n default:\n break;\n }\n break;\n \n default:\n break;\n}\n\nreturn[msg1,msg2];","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":860,"y":100,"wires":[["91ee9c360eac6d43"]]},{"id":"291914c5c9c68f02","type":"mqtt-broker","name":"mqtt://localhost","broker":"mqtt://localhost","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":{},"sessionExpiry":""}]
J’ai des latences voire des non prise en compte si les ordres sont fait trop rapidement mais si on attend pas de souci cela fonctionnes très bien par contre depuis un node red dans home assistant donc homea assistant <=> IPX800V5 pas de latence !
Par contre depuis Gladys cela génère 4 message sur le debug au lieu de 2 quand c’est depuis l’IPX800V5