Hello everyone
I'm trying to load data in a "form" when the buttons are clicked.
Simulate sending data through a serial node using a random number generator.
Practically I needed that at the moment of selecting the left button, take the generated data and place it in the "Left Weight" box.
I would appreciate your help please
Thank you
Next I leave a screenshot of my flow and the code that I am doing.
[
{
"id": "b9860b4b9de8c8da",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "ccfc19e16e3b1ab3",
"type": "debug",
"z": "b9860b4b9de8c8da",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 720,
"y": 240,
"wires": []
},
{
"id": "0a517f025b74c1bc",
"type": "ui_form",
"z": "b9860b4b9de8c8da",
"name": "",
"label": "",
"group": "39608c8009062eb4",
"order": 0,
"width": 0,
"height": 0,
"options": [
{
"label": "Peso Izquierdo",
"value": "pesoIz",
"type": "number",
"required": true,
"rows": null
},
{
"label": "Peso Derecho",
"value": "pesoDer",
"type": "number",
"required": true,
"rows": null
},
{
"label": "Codigo",
"value": "codigo",
"type": "text",
"required": false,
"rows": null
}
],
"formValue": {
"pesoIz": "",
"pesoDer": "",
"codigo": ""
},
"payload": "",
"submit": "submit",
"cancel": "cancel",
"topic": "topic",
"topicType": "msg",
"splitLayout": "",
"x": 590,
"y": 240,
"wires": [
[
"ccfc19e16e3b1ab3"
]
]
},
{
"id": "6c563470a0aa3605",
"type": "ui_button",
"z": "b9860b4b9de8c8da",
"name": "",
"group": "61241346eee7b574",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "Izquierdo",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "refresh",
"payload": "",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 620,
"y": 160,
"wires": [
[]
]
},
{
"id": "577ba779ab59b544",
"type": "Number",
"z": "b9860b4b9de8c8da",
"name": "serial",
"minimum": "0",
"maximum": "10",
"roundTo": "1",
"Floor": false,
"x": 190,
"y": 180,
"wires": [
[
"c5783a55c2383752"
]
]
},
{
"id": "334010747171ec43",
"type": "Number",
"z": "b9860b4b9de8c8da",
"name": "serial",
"minimum": "0",
"maximum": "10",
"roundTo": "1",
"Floor": false,
"x": 190,
"y": 320,
"wires": [
[
"04738d0d48c4daea"
]
]
},
{
"id": "c5783a55c2383752",
"type": "change",
"z": "b9860b4b9de8c8da",
"name": "",
"rules": [
{
"t": "set",
"p": "msg",
"pt": "flow",
"to": "payload",
"tot": "msg"
},
{
"t": "delete",
"p": "payload",
"pt": "msg"
},
{
"t": "set",
"p": "payload.pesoIz",
"pt": "msg",
"to": "msg",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 180,
"wires": [
[
"0a517f025b74c1bc"
]
]
},
{
"id": "04738d0d48c4daea",
"type": "change",
"z": "b9860b4b9de8c8da",
"name": "",
"rules": [
{
"t": "set",
"p": "msg",
"pt": "flow",
"to": "payload",
"tot": "msg"
},
{
"t": "delete",
"p": "payload",
"pt": "msg"
},
{
"t": "set",
"p": "payload.pesoDer",
"pt": "msg",
"to": "msg",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 320,
"wires": [
[
"0a517f025b74c1bc"
]
]
},
{
"id": "786cc52009ec82da",
"type": "ui_button",
"z": "b9860b4b9de8c8da",
"name": "",
"group": "61241346eee7b574",
"order": 1,
"width": 0,
"height": 0,
"passthru": false,
"label": "Derecho",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "refresh",
"payload": "",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 600,
"y": 380,
"wires": [
[]
]
},
{
"id": "062f1d54dd044b4b",
"type": "inject",
"z": "b9860b4b9de8c8da",
"name": "SERIAL",
"props": [
{
"p": "payload"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 60,
"y": 240,
"wires": [
[
"577ba779ab59b544",
"334010747171ec43"
]
]
},
{
"id": "39608c8009062eb4",
"type": "ui_group",
"name": "Default",
"tab": "39e436e1db47faa2",
"order": 1,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "61241346eee7b574",
"type": "ui_group",
"name": "Actualizar",
"tab": "39e436e1db47faa2",
"order": 2,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "39e436e1db47faa2",
"type": "ui_tab",
"name": "Home",
"icon": "dashboard",
"disabled": false,
"hidden": false
}
]