My project :
[
{
"id": "61e19b78ef64a3b5",
"type": "tab",
"label": "SMARTBAR",
"disabled": false,
"info": ""
},
{
"id": "b787b38a3357045c",
"type": "ui_slider",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "Dosage(ml) :",
"tooltip": "",
"group": "6b59a22e58b7fd02",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": 0,
"max": "500",
"step": "50",
"className": "",
"x": 470,
"y": 140,
"wires": [
[
"40009f74321bd978"
]
]
},
{
"id": "0161651d99f59223",
"type": "ui_text",
"z": "61e19b78ef64a3b5",
"group": "6b59a22e58b7fd02",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-left",
"className": "",
"x": 450,
"y": 100,
"wires": []
},
{
"id": "314adfebbf49060f",
"type": "ui_text_input",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "",
"tooltip": "",
"group": "9d715f5db270a4ef",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": 300,
"topic": "payload",
"sendOnBlur": true,
"topicType": "msg",
"x": 160,
"y": 100,
"wires": [
[
"0161651d99f59223"
]
]
},
{
"id": "345e47172f221bab",
"type": "ui_text_input",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "",
"tooltip": "",
"group": "3052f4e65209445c",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "300",
"topic": "payload",
"topicType": "msg",
"x": 160,
"y": 280,
"wires": [
[
"37c6134abb86ec92"
]
]
},
{
"id": "dd4fa6989bb62a19",
"type": "ui_text_input",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "",
"tooltip": "",
"group": "dfac3fa00578e810",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "300",
"topic": "payload",
"topicType": "msg",
"x": 160,
"y": 480,
"wires": [
[
"6f5a18c3d422967e"
]
]
},
{
"id": "b549c68ba4486d33",
"type": "ui_text_input",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "",
"tooltip": "",
"group": "be945b5b01e73039",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"mode": "text",
"delay": "300",
"topic": "payload",
"topicType": "msg",
"x": 160,
"y": 660,
"wires": [
[
"953d7dac6d286fe8"
]
]
},
{
"id": "880b5b52804e8ce9",
"type": "ui_slider",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "Dosage(ml) :",
"tooltip": "",
"group": "3249f6ba14234d0b",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": 0,
"max": "500",
"step": "50",
"className": "",
"x": 470,
"y": 320,
"wires": [
[
"af2325ce4f368146"
]
]
},
{
"id": "37c6134abb86ec92",
"type": "ui_text",
"z": "61e19b78ef64a3b5",
"group": "3249f6ba14234d0b",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "",
"format": "{{msg.topic}}",
"layout": "row-left",
"className": "",
"x": 450,
"y": 280,
"wires": []
},
{
"id": "f14c353f79bae43c",
"type": "ui_slider",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "Dosage(ml) :",
"tooltip": "",
"group": "2370014b9d0d6b45",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "topic",
"topicType": "msg",
"min": 0,
"max": "500",
"step": "50",
"className": "",
"x": 470,
"y": 520,
"wires": [
[
"b0a77cf014cc4abb"
]
]
},
{
"id": "6f5a18c3d422967e",
"type": "ui_text",
"z": "61e19b78ef64a3b5",
"group": "2370014b9d0d6b45",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-left",
"className": "",
"x": 450,
"y": 480,
"wires": []
},
{
"id": "fde1baebbe32ba2f",
"type": "comment",
"z": "61e19b78ef64a3b5",
"name": "Liquide 1",
"info": "",
"x": 160,
"y": 60,
"wires": []
},
{
"id": "bce11f3491edf0c2",
"type": "comment",
"z": "61e19b78ef64a3b5",
"name": "Liquide 4",
"info": "",
"x": 160,
"y": 620,
"wires": []
},
{
"id": "e868200e7fd869f3",
"type": "comment",
"z": "61e19b78ef64a3b5",
"name": "Liquide 3",
"info": "",
"x": 160,
"y": 440,
"wires": []
},
{
"id": "aaa0a30d47f1ac6e",
"type": "comment",
"z": "61e19b78ef64a3b5",
"name": "Liquide 2",
"info": "",
"x": 160,
"y": 240,
"wires": []
},
{
"id": "20560ceaba0b9171",
"type": "ui_slider",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "Dosage(ml) :",
"tooltip": "",
"group": "32773749ab4bc01c",
"order": 3,
"width": 0,
"height": 0,
"passthru": true,
"outs": "end",
"topic": "payload",
"topicType": "msg",
"min": 0,
"max": "500",
"step": "50",
"className": "",
"x": 470,
"y": 700,
"wires": [
[
"e350f373d75e9277"
]
]
},
{
"id": "953d7dac6d286fe8",
"type": "ui_text",
"z": "61e19b78ef64a3b5",
"group": "32773749ab4bc01c",
"order": 1,
"width": 0,
"height": 0,
"name": "",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-left",
"className": "",
"x": 450,
"y": 660,
"wires": []
},
{
"id": "fdf8e06c611d1a02",
"type": "comment",
"z": "61e19b78ef64a3b5",
"name": "Lancement de la commande",
"info": "",
"x": 220,
"y": 840,
"wires": []
},
{
"id": "df51de8ac88f7a5f",
"type": "ui_button",
"z": "61e19b78ef64a3b5",
"name": "",
"group": "2304c94f9fc3e4e6",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "mi-local_bar",
"payload": "true",
"payloadType": "bool",
"topic": "topic",
"topicType": "msg",
"x": 150,
"y": 960,
"wires": [
[
"1a3da4f9c9d1d315"
]
]
},
{
"id": "af2325ce4f368146",
"type": "function",
"z": "61e19b78ef64a3b5",
"name": "Set liquide 2",
"func": "flow.set('rDosageLiquide2',msg.payload)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 930,
"y": 320,
"wires": [
[]
]
},
{
"id": "b0a77cf014cc4abb",
"type": "function",
"z": "61e19b78ef64a3b5",
"name": "Set liquide 3",
"func": "flow.set('rDosageLiquide3',msg.payload)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 930,
"y": 520,
"wires": [
[]
]
},
{
"id": "40009f74321bd978",
"type": "function",
"z": "61e19b78ef64a3b5",
"name": "Set liquide 1",
"func": "flow.set('rDosageLiquide1',msg.payload)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 950,
"y": 140,
"wires": [
[]
]
},
{
"id": "9acee912f403e6eb",
"type": "hx711",
"z": "61e19b78ef64a3b5",
"name": "Cellule pesage",
"hx_data": "29",
"hx_sck": "31",
"hx_scale": "1",
"hx_offset": "0",
"hx_avrg": "5",
"x": 620,
"y": 1020,
"wires": [
[
"34ec2e0c0e5ab44c"
]
]
},
{
"id": "7ed93540b59c7061",
"type": "inject",
"z": "61e19b78ef64a3b5",
"name": "pesée",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "0.2",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payloadType": "date",
"x": 400,
"y": 1040,
"wires": [
[
"9acee912f403e6eb"
]
]
},
{
"id": "943cc83682e131eb",
"type": "inject",
"z": "61e19b78ef64a3b5",
"name": "tare",
"props": [
{
"p": "tare",
"v": "",
"vt": "date"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 410,
"y": 1080,
"wires": [
[
"9acee912f403e6eb"
]
]
},
{
"id": "dd7f5c50e7f13f31",
"type": "ui_gauge",
"z": "61e19b78ef64a3b5",
"name": "Affichage poids",
"group": "6ff8ee57fd2a96bb",
"order": 1,
"width": 0,
"height": 0,
"gtype": "gage",
"title": "",
"label": "ml",
"format": "{{msg.payload}}",
"min": 0,
"max": "1000",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"className": "",
"x": 1100,
"y": 1020,
"wires": []
},
{
"id": "34ec2e0c0e5ab44c",
"type": "function",
"z": "61e19b78ef64a3b5",
"name": "Calcul masse",
"func": "var buffer = msg.payload = Math.abs((msg.payload * 0.0005329949))\nmsg.payload = buffer.toFixed(1)\nflow.set(\"mesurepoids\", msg.payload)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 880,
"y": 1020,
"wires": [
[
"dd7f5c50e7f13f31"
]
]
},
{
"id": "e350f373d75e9277",
"type": "function",
"z": "61e19b78ef64a3b5",
"name": "Set liquide 4",
"func": "flow.set('rDosageLiquide4',msg.payload)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 930,
"y": 700,
"wires": [
[]
]
},
{
"id": "ab4c4eaf2aee5f30",
"type": "rpi-gpio out",
"z": "61e19b78ef64a3b5",
"name": "",
"pin": "40",
"set": true,
"level": "1",
"freq": "",
"out": "out",
"x": 560,
"y": 1360,
"wires": []
},
{
"id": "8dc7fc5918ec84a3",
"type": "ui_switch",
"z": "61e19b78ef64a3b5",
"name": "",
"label": "LED",
"tooltip": "",
"group": "caac32474324af48",
"order": 0,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "false",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "true",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"x": 310,
"y": 1360,
"wires": [
[
"ab4c4eaf2aee5f30"
]
]
},
{
"id": "1a3da4f9c9d1d315",
"type": "function",
"z": "61e19b78ef64a3b5",
"name": "GestionCycle",
"func": "//DĂ©claration variables\nvar xStartCycle = false\nconst recette = []\nvar poidsactuel = flow.get(\"mesurepoids\")\nvar EtapesCycle = 0\n\n//Lancement cycle + tare balance + chargement recette \nif (msg.payload == true && xStartCycle == false){\n xStartCycle = true\n msg.tare = 1\n recette[1] = flow.get('rDosageLiquide1')\n recette[2] = flow.get('rDosageLiquide2')\n recette[3] = flow.get('rDosageLiquide3')\n recette[4] = flow.get('rDosageLiquide4')\n \n} return msg\n\n//VĂ©rification balance = 0g et lancement des Ă©tapes du cycle\nif (xStartCycle == true && poidsactuel < 1 ){\n \n msg.tare = 0\n \n \n }return msg\n\n //Etapes cycle\n if(EtapesCycle == 1){\n if (poidsactuel < recette[EtapesCycle] && poidsactuel < 1){\n msg.result = 1\n \n } else if (poidsactuel >= recette[EtapesCycle]){\n msg.result = 0\n EtapesCycle = EtapesCycle +1\n msg.tare = 1\n \n } else if (recette[EtapesCycle] == 0){\n EtapesCycle = EtapesCycle +1\n \n }return msg\n \n }\n \n if(EtapesCycle == 2){\n if (poidsactuel < recette[EtapesCycle] && poidsactuel < 1){\n msg.result = 1\n \n } else if (poidsactuel >= recette[EtapesCycle]){\n msg.result = 0\n EtapesCycle = EtapesCycle +1\n msg.tare = 0\n \n } else if (recette[EtapesCycle] == 0){\n EtapesCycle = EtapesCycle +1\n \n }return msg\n \n }\n \n if(EtapesCycle == 3){\n if (poidsactuel < recette[EtapesCycle] && poidsactuel < 1){\n msg.result = 1\n \n } else if (poidsactuel >= recette[EtapesCycle]){\n msg.result = 0\n EtapesCycle = EtapesCycle +1\n msg.tare = 1\n \n } else if (recette[EtapesCycle] == 0){\n EtapesCycle = EtapesCycle +1\n \n }return msg\n \n }\n \n if(EtapesCycle == 4){\n if (poidsactuel < recette[EtapesCycle] && poidsactuel < 1){\n msg.result = 1\n \n } else if (poidsactuel >= recette[EtapesCycle]){\n msg.result = 0\n xStartCycle = false\n msg.tare = 0\n \n } else if (recette[EtapesCycle] == 0){\n xStartCycle = false\n }return msg\n \n }\n \n //Fin cycle\n if(EtapesCycle == 4 && xStartCycle == false){\n EtapesCycle = 0\n }\n \n \n ",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 960,
"wires": [
[
"9acee912f403e6eb",
"e6d0e4ad85025d04",
"27fe1f4b372b9991",
"db7ebfc3405a8f63"
]
]
},
{
"id": "e6d0e4ad85025d04",
"type": "debug",
"z": "61e19b78ef64a3b5",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "tare",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 610,
"y": 900,
"wires": []
},
{
"id": "27fe1f4b372b9991",
"type": "debug",
"z": "61e19b78ef64a3b5",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 620,
"y": 840,
"wires": []
},
{
"id": "16b16599fa1a1410",
"type": "ui_button",
"z": "61e19b78ef64a3b5",
"name": "Tare",
"group": "6ff8ee57fd2a96bb",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Tare",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "",
"payloadType": "date",
"topic": "topic",
"topicType": "msg",
"x": 150,
"y": 1140,
"wires": [
[
"e6984ec64b9ac543"
]
]
},
{
"id": "e6984ec64b9ac543",
"type": "function",
"z": "61e19b78ef64a3b5",
"name": "",
"func": "msg.tare = 1\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 1140,
"wires": [
[
"9acee912f403e6eb"
]
]
},
{
"id": "695e96b922da21e0",
"type": "comment",
"z": "61e19b78ef64a3b5",
"name": "Gestion LED",
"info": "",
"x": 150,
"y": 1240,
"wires": []
},
{
"id": "db7ebfc3405a8f63",
"type": "debug",
"z": "61e19b78ef64a3b5",
"name": "",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": true,
"complete": "result",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 610,
"y": 960,
"wires": []
},
{
"id": "6b59a22e58b7fd02",
"type": "ui_group",
"name": "Liquide1",
"tab": "d260e8fa5283fae3",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "9d715f5db270a4ef",
"type": "ui_group",
"name": "Liquide 1",
"tab": "d6360769c3bcc5e8",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "3052f4e65209445c",
"type": "ui_group",
"name": "Liquide 2",
"tab": "d6360769c3bcc5e8",
"order": 2,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "dfac3fa00578e810",
"type": "ui_group",
"name": "Liquide 3",
"tab": "d6360769c3bcc5e8",
"order": 3,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "be945b5b01e73039",
"type": "ui_group",
"name": "Liquide 4",
"tab": "d6360769c3bcc5e8",
"order": 4,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "3249f6ba14234d0b",
"type": "ui_group",
"name": "Liquide2",
"tab": "d260e8fa5283fae3",
"order": 2,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "2370014b9d0d6b45",
"type": "ui_group",
"name": "Liquide3",
"tab": "d260e8fa5283fae3",
"order": 3,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "32773749ab4bc01c",
"type": "ui_group",
"name": "Liquide4",
"tab": "d260e8fa5283fae3",
"order": 4,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "2304c94f9fc3e4e6",
"type": "ui_group",
"name": "Commande",
"tab": "d260e8fa5283fae3",
"order": 5,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "6ff8ee57fd2a96bb",
"type": "ui_group",
"name": "Balance",
"tab": "d6360769c3bcc5e8",
"order": 6,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "caac32474324af48",
"type": "ui_group",
"name": "Lumière",
"tab": "d6360769c3bcc5e8",
"order": 5,
"disp": false,
"width": "6",
"collapse": false
},
{
"id": "d260e8fa5283fae3",
"type": "ui_tab",
"name": "Commande",
"icon": "dashboard",
"disabled": false,
"hidden": false
},
{
"id": "d6360769c3bcc5e8",
"type": "ui_tab",
"name": "Param.",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]