THanks to your reply Steve-MCL,
You are right. my values come from 2 different wires into the function.
So if i understand well, I use a join node. I pluged my 2 wires, and I've only one message, so this step is okay. i've short 70 in my debug node.
So now, how to make a message if this condition is not true ? I need to use a split node ?
I tried this
[
{
"id": "9497ea9b98f7eb97",
"type": "debug",
"z": "3deae33dc9a74eba",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 3470,
"y": 440,
"wires": []
},
{
"id": "00c4d5806c177d1b",
"type": "ui_text",
"z": "3deae33dc9a74eba",
"group": "0c820bec3540b682",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "Mode",
"format": "{{msg.payload}}",
"layout": "row-center",
"className": "",
"x": 3450,
"y": 380,
"wires": []
},
{
"id": "69019889fcbf03d7",
"type": "link out",
"z": "3deae33dc9a74eba",
"name": "Etat switch long court",
"mode": "link",
"links": [
"4e40e81e2203af73"
],
"x": 3575,
"y": 260,
"wires": []
},
{
"id": "c7b97f8cc3c2620a",
"type": "change",
"z": "3deae33dc9a74eba",
"name": "Conversion 0/1 en COURT/LONG",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "0",
"fromt": "num",
"to": "COURT",
"tot": "str"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "1",
"fromt": "num",
"to": "LONG",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 3220,
"y": 380,
"wires": [
[
"00c4d5806c177d1b",
"9497ea9b98f7eb97",
"69019889fcbf03d7"
]
]
},
{
"id": "97e5d26215d0f36f",
"type": "function",
"z": "3deae33dc9a74eba",
"name": "MODE SWITCH",
"func": "if (msg.payload==0){\n global.set(\"MODE\",\"COURT\");\n}\nif (msg.payload==1){\n global.set(\"MODE\",\"LONG\");\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 2970,
"y": 380,
"wires": [
[
"c7b97f8cc3c2620a"
]
]
},
{
"id": "a4a6641b24d46114",
"type": "rpi-gpio in",
"z": "3deae33dc9a74eba",
"name": "Mode LONG/COURT",
"pin": "5",
"intype": "up",
"debounce": "25",
"read": true,
"bcm": true,
"x": 2720,
"y": 380,
"wires": [
[
"97e5d26215d0f36f"
]
]
},
{
"id": "b5d99d33329f3d8b",
"type": "inject",
"z": "3deae33dc9a74eba",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "LONG",
"payloadType": "str",
"x": 2770,
"y": 280,
"wires": [
[
"97e5d26215d0f36f"
]
]
},
{
"id": "be2049c240f4cd84",
"type": "inject",
"z": "3deae33dc9a74eba",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "COURT",
"payloadType": "str",
"x": 2770,
"y": 220,
"wires": [
[
"97e5d26215d0f36f"
]
]
},
{
"id": "803f565b0df49aa4",
"type": "group",
"z": "3deae33dc9a74eba",
"name": "lancement éclipse + décompte",
"style": {
"stroke": "#c8e7a7",
"fill": "#c8e7a7",
"label": true,
"label-position": "n",
"color": "#000000"
},
"nodes": [
"7100f65700c52fd1",
"69b855249ca4873f",
"892634c7713b3c24",
"362ea86b498bedd7",
"8490dc0cd54b9b97",
"910992f7c3892425",
"773a707bbfa94aa4",
"63d4f2ee65ee6dc7",
"4ffe6ee35282efc0",
"97e21392efe117a3",
"75f467b3e0f3aa90",
"7f8181e8e8d21082",
"1dc14908c65914c3",
"8579eb28057290d5",
"a385086ee4703330",
"ed19ceee17086cb8",
"d610874920df585b",
"48f1dbc77249a868",
"358346d5a7a56d20",
"4e40e81e2203af73",
"62c34bb009b99a29",
"e67374793e8eabdc",
"5a4a021d9b4e3037",
"426e57dc36c36558",
"efb141e14dcf2f06",
"19eb288b7240e75f",
"2b53786c0f9af926",
"14b71cbcca63f9a8"
],
"x": 334,
"y": 1779,
"w": 1672,
"h": 622
},
{
"id": "7100f65700c52fd1",
"type": "ui_button",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Eclipse 70 mn",
"group": "0c820bec3540b682",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Eclipse 70 minutes",
"tooltip": "",
"color": "white",
"bgcolor": "{{background}}",
"className": "",
"icon": "",
"payload": "Es-tu sur de lancer l'éclipse 70 minutes ?",
"payloadType": "str",
"topic": "dash",
"topicType": "msg",
"x": 500,
"y": 1820,
"wires": [
[
"efb141e14dcf2f06"
]
]
},
{
"id": "69b855249ca4873f",
"type": "exec",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"command": "DISPLAY=:0 gnome-terminal --geometry=80x30+1950+100 -- cvlc --fullscreen /home/timoxy/Desktop/ECLIPSE70.mp4",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "0",
"winHide": false,
"oldrc": false,
"name": "Video eclipse 70",
"x": 1700,
"y": 1880,
"wires": [
[],
[],
[]
]
},
{
"id": "892634c7713b3c24",
"type": "ui_button",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Eclipse 100 mn",
"group": "0c820bec3540b682",
"order": 3,
"width": 0,
"height": 0,
"passthru": false,
"label": "Eclipse 100 minutes",
"tooltip": "",
"color": "",
"bgcolor": "{{background}}",
"className": "",
"icon": "",
"payload": "Es-tu sur de lancer l'éclipse 100 minutes ?",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 660,
"y": 2220,
"wires": [
[
"48f1dbc77249a868",
"b672a2bf2d98bdf9"
]
]
},
{
"id": "362ea86b498bedd7",
"type": "exec",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"command": "DISPLAY=:0 gnome-terminal --geometry=80x30+1950+100 -- cvlc --fullscreen /home/timoxy/Desktop/ECLIPSE100.mp4",
"addpay": "payload",
"append": "",
"useSpawn": "false",
"timer": "0",
"winHide": false,
"oldrc": false,
"name": "Video eclipse 100",
"x": 1310,
"y": 2260,
"wires": [
[],
[],
[]
]
},
{
"id": "8490dc0cd54b9b97",
"type": "change",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "sec to hh:mm:ss",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$moment(\t $moment()\t .add($$.payload, 'seconds')\t .diff($moment())\t).utc().format('HH:mm:ss')",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1900,
"y": 1820,
"wires": [
[
"4ffe6ee35282efc0"
]
]
},
{
"id": "910992f7c3892425",
"type": "countdown",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Décompte 4200 s",
"topic": "",
"payloadTimerStart": "true",
"payloadTimerStartType": "bool",
"payloadTimerStop": "false",
"payloadTimerStopType": "bool",
"timer": "4200",
"resetWhileRunning": false,
"outputOnReset": true,
"setTimeToNewWhileRunning": true,
"startCountdownOnControlMessage": false,
"x": 1710,
"y": 1820,
"wires": [
[],
[
"8490dc0cd54b9b97"
]
]
},
{
"id": "773a707bbfa94aa4",
"type": "change",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "sec to hh:mm:ss",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$moment(\t $moment()\t .add($$.payload, 'seconds')\t .diff($moment())\t).utc().format('HH:mm:ss')",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1500,
"y": 2200,
"wires": [
[
"4ffe6ee35282efc0"
]
]
},
{
"id": "63d4f2ee65ee6dc7",
"type": "countdown",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Décompte 6000 s",
"topic": "",
"payloadTimerStart": "true",
"payloadTimerStartType": "bool",
"payloadTimerStop": "false",
"payloadTimerStopType": "bool",
"timer": "6000",
"resetWhileRunning": false,
"outputOnReset": true,
"setTimeToNewWhileRunning": true,
"startCountdownOnControlMessage": false,
"x": 1310,
"y": 2200,
"wires": [
[],
[
"773a707bbfa94aa4"
]
]
},
{
"id": "4ffe6ee35282efc0",
"type": "ui_text",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"group": "0c820bec3540b682",
"order": 4,
"width": 0,
"height": 0,
"name": "Décompte",
"label": "Fin de la partie dans",
"format": "{{msg.payload}}",
"layout": "row-spread",
"className": "",
"x": 1790,
"y": 2020,
"wires": []
},
{
"id": "97e21392efe117a3",
"type": "change",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Rouge",
"rules": [
{
"t": "set",
"p": "background",
"pt": "msg",
"to": "red",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 890,
"y": 2000,
"wires": [
[
"7100f65700c52fd1"
]
]
},
{
"id": "75f467b3e0f3aa90",
"type": "delay",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Délai rouge",
"pauseType": "delay",
"timeout": "4190",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 890,
"y": 2060,
"wires": [
[
"97e21392efe117a3"
]
]
},
{
"id": "7f8181e8e8d21082",
"type": "delay",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Delai passage vert",
"pauseType": "delay",
"timeout": "0.5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 650,
"y": 2060,
"wires": [
[
"75f467b3e0f3aa90",
"1dc14908c65914c3"
]
]
},
{
"id": "1dc14908c65914c3",
"type": "change",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Vert",
"rules": [
{
"t": "set",
"p": "background",
"pt": "msg",
"to": "Green",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 650,
"y": 2000,
"wires": [
[
"7100f65700c52fd1"
]
]
},
{
"id": "8579eb28057290d5",
"type": "change",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Rouge",
"rules": [
{
"t": "set",
"p": "background",
"pt": "msg",
"to": "red",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 750,
"y": 2300,
"wires": [
[
"892634c7713b3c24"
]
]
},
{
"id": "a385086ee4703330",
"type": "delay",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Délai rouge",
"pauseType": "delay",
"timeout": "5990",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 730,
"y": 2360,
"wires": [
[
"8579eb28057290d5"
]
]
},
{
"id": "ed19ceee17086cb8",
"type": "delay",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Delai passage vert",
"pauseType": "delay",
"timeout": "0.5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 490,
"y": 2360,
"wires": [
[
"a385086ee4703330",
"d610874920df585b"
]
]
},
{
"id": "d610874920df585b",
"type": "change",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Vert",
"rules": [
{
"t": "set",
"p": "background",
"pt": "msg",
"to": "Green",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 490,
"y": 2300,
"wires": [
[
"892634c7713b3c24"
]
]
},
{
"id": "48f1dbc77249a868",
"type": "junction",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"x": 360,
"y": 2160,
"wires": [
[
"ed19ceee17086cb8"
]
]
},
{
"id": "358346d5a7a56d20",
"type": "function",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Confirm",
"func": "//only accept OK msg's\nif (msg.payload == 'OK') {\n msg.payload = \"Stop\";\n node.send(msg);\n}\nreturn null;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1100,
"y": 2220,
"wires": [
[
"362ea86b498bedd7",
"63d4f2ee65ee6dc7"
]
]
},
{
"id": "4e40e81e2203af73",
"type": "link in",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "link in 2",
"links": [
"69019889fcbf03d7"
],
"x": 555,
"y": 1860,
"wires": [
[
"19eb288b7240e75f"
]
]
},
{
"id": "62c34bb009b99a29",
"type": "debug",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1380,
"y": 1880,
"wires": []
},
{
"id": "e67374793e8eabdc",
"type": "ui_toast",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"position": "dialog",
"displayTime": "3",
"highlight": "",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "Non",
"raw": false,
"className": "",
"topic": "",
"name": "Eclipse 70",
"x": 1170,
"y": 1820,
"wires": [
[
"5a4a021d9b4e3037"
]
]
},
{
"id": "5a4a021d9b4e3037",
"type": "function",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Confirm",
"func": "//only accept OK msg's\nif (msg.payload == 'OK') {\n msg.payload = \"70\";\n node.send(msg);\n}\nreturn null;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1340,
"y": 1820,
"wires": [
[
"426e57dc36c36558"
]
]
},
{
"id": "426e57dc36c36558",
"type": "switch",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "filtre info",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "Veuillez activer la vidéo 70",
"vt": "str"
},
{
"t": "eq",
"v": "Mauvais mode selectionné",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1500,
"y": 1820,
"wires": [
[],
[]
]
},
{
"id": "efb141e14dcf2f06",
"type": "change",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "70",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 1820,
"wires": [
[
"19eb288b7240e75f"
]
]
},
{
"id": "19eb288b7240e75f",
"type": "join",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "Verification des 2 etats 70",
"mode": "custom",
"build": "string",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 910,
"y": 1880,
"wires": [
[
"2b53786c0f9af926"
]
]
},
{
"id": "2b53786c0f9af926",
"type": "switch",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "filtre",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "COURT 70",
"vt": "str"
},
{
"t": "neq",
"v": "COURT 70",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1170,
"y": 1900,
"wires": [
[
"62c34bb009b99a29"
],
[
"14b71cbcca63f9a8"
]
]
},
{
"id": "14b71cbcca63f9a8",
"type": "debug",
"z": "3deae33dc9a74eba",
"g": "803f565b0df49aa4",
"name": "debug 4",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1380,
"y": 1940,
"wires": []
},
{
"id": "0c820bec3540b682",
"type": "ui_group",
"name": "Paramétrages",
"tab": "cb8fc504867904ea",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "cb8fc504867904ea",
"type": "ui_tab",
"name": "Salle INDIANA",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]
But my message go again in output 2...