How to edit a function node for telegram

Hello, I'm fighting for weeks and I did find no solution since my Java script knowledge is less than basic. :exploding_head:
I collect 2 temperature values via the serial port. I'm able to get the first on-demand via telegram. Could someone suggest how to modify the function node so I can collect 2 values with the proper topic?
I tried some different msg types without results.


My flow

[{"id":"6ecd5ed5.624c9","type":"debug","z":"d93d62e5.76b86","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":832,"y":336,"wires":[]},{"id":"369ae647.d181ca","type":"telegram command","z":"d93d62e5.76b86","d":true,"name":"","command":"Temp","bot":"5896bb49.2b8254","strict":false,"hasresponse":true,"useregex":false,"removeregexcommand":false,"outputs":2,"x":122,"y":304,"wires":[["38109f52.30921"],[]]},{"id":"a398b1de.00022","type":"function","z":"d93d62e5.76b86","name":"","func":"//var msg5 = msg.payload.col7;\n//var msg2 =  msg.payload;\n//var msg3 = \"°C\";\n//var date = new Date(msg.payload4)\n//var msg4 = \"Temp Pannelli TK\";\n\n//var msg6 = \"°C\";\n\n//return [{payload:msg3+msg2+msg5}]\n//return msg;\nvar msg1 = \"TK - TEMP. PANNELLI, \";\nvar msg2 = msg.payload;\nvar msg3 = \" C°\";\n\nreturn [{payload:msg1+msg2+msg3}]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":492,"y":192,"wires":[["ee505d58.56427"]]},{"id":"e1ea84e9.ef4928","type":"telegram sender","z":"d93d62e5.76b86","d":true,"name":"","bot":"5896bb49.2b8254","haserroroutput":true,"outputs":2,"x":962,"y":204,"wires":[[],[]]},{"id":"ee505d58.56427","type":"function","z":"d93d62e5.76b86","name":"","func":"var msg1 = msg.payload;\nmsg.payload = {}\n\nmsg.payload.chatId = \"my chat ID\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":684,"y":256,"wires":[["6ecd5ed5.624c9","e1ea84e9.ef4928"]]},{"id":"47b01090.cded7","type":"link in","z":"d93d62e5.76b86","d":true,"name":"","links":["fd34e4cb.408068"],"x":79,"y":208,"wires":[["d71496fe.120b08"]]},{"id":"d71496fe.120b08","type":"trigger","z":"d93d62e5.76b86","name":"","op1":"","op2":"","op1type":"pay","op2type":"pay","duration":"0","extend":false,"overrideDelay":false,"units":"hr","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":272,"y":208,"wires":[["a398b1de.00022"]]},{"id":"38109f52.30921","type":"change","z":"d93d62e5.76b86","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":292,"y":304,"wires":[["d71496fe.120b08"]]},{"id":"5aa9bb6c.00e0d4","type":"ui_button","z":"d93d62e5.76b86","name":"","group":"2e0e750e.824afa","order":28,"width":2,"height":2,"passthru":false,"label":"Temp","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":130,"y":384,"wires":[["38109f52.30921"]]},{"id":"5896bb49.2b8254","type":"telegram bot","botname":"Chris100_bot","usernames":"","chatids":"mychatID","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"2e0e750e.824afa","type":"ui_group","name":"Rotex ","tab":"ebb1ed1c.5ebe2","order":1,"disp":true,"width":"28","collapse":true},{"id":"ebb1ed1c.5ebe2","type":"ui_tab","name":"CBU Power Plant","icon":"Comandi ","order":1,"disabled":false,"hidden":false}]

Thanks in advance

Did you try Join Node ?
set different topic for different incoming message and use a key/value object with manual mode in join node. change the below example suitably

[{"id":"42020feb6695b1f5","type":"join","z":"c683350141044a66","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":660,"wires":[["39a65ddc9b3587e7","1bb525368eaffa3b"]]},{"id":"490d038b2e8d5df1","type":"inject","z":"c683350141044a66","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"one","payload":"50","payloadType":"num","x":170,"y":660,"wires":[["42020feb6695b1f5"]]},{"id":"7d36124aa6abea62","type":"inject","z":"c683350141044a66","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"two","payload":"100","payloadType":"num","x":170,"y":700,"wires":[["42020feb6695b1f5"]]},{"id":"39a65ddc9b3587e7","type":"function","z":"c683350141044a66","name":"","func":"//var msg5 = msg.payload.col7;\n//var msg2 =  msg.payload;\n//var msg3 = \"°C\";\n//var date = new Date(msg.payload4)\n//var msg4 = \"Temp Pannelli TK\";\n\n//var msg6 = \"°C\";\n\n//return [{payload:msg3+msg2+msg5}]\n//return msg;\nvar msg1 = \"TK - TEMP. PANNELLI, \";\nvar msg2 = msg.payload.one;\nvar msg3 = msg.payload.two;\nvar msg4 = \" C°\";\n\nreturn [{ payload: msg1 + msg2 + msg4 + msg3 + msg4}]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":660,"wires":[["3481995455469888"]]},{"id":"1bb525368eaffa3b","type":"debug","z":"c683350141044a66","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":480,"y":620,"wires":[]},{"id":"3481995455469888","type":"function","z":"c683350141044a66","name":"","func":"var msg1 = msg.payload;\nmsg.payload = {}\n\nmsg.payload.chatId = \"my chat id\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":660,"wires":[["a006d4a78bc1daf8"]]},{"id":"a006d4a78bc1daf8","type":"debug","z":"c683350141044a66","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":820,"y":660,"wires":[]}]

Hello, as per the screenshot the join node was already used, how to manage properly the function is my issue. The debug message shows twice undefined. Any idea why it happens?
Thanks in advance

My flow modified based on your input.

[{"id":"b68e76c0.382808","type":"debug","z":"36ed6d21.1b3dd2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":848,"y":1056,"wires":[]},{"id":"6c43d1d9.40cbf","type":"debug","z":"36ed6d21.1b3dd2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":706,"y":912,"wires":[]},{"id":"ee8a8d5b.e33af","type":"telegram command","z":"36ed6d21.1b3dd2","name":"","command":"Out ","bot":"5896bb49.2b8254","strict":false,"hasresponse":true,"useregex":false,"removeregexcommand":false,"outputs":2,"x":138,"y":1024,"wires":[["f335ac61.ad7cf"],[]]},{"id":"58745bb9.1c1af4","type":"function","z":"36ed6d21.1b3dd2","d":true,"name":"","func":"//var msg5 = msg.payload.col7;\n//var msg2 =  msg.payload;\n//var msg3 = \"°C\";\n//var date = new Date(msg.payload4)\n//var msg4 = \"Temp Pannelli TK\";\n\n//var msg6 = \"°C\";\n\n//return [{payload:msg3+msg2+msg5}]\n//return msg;\nvar msg1 = \"TK - TEMP. PANNELLI, \";\nvar msg2 = msg.payload;\nvar msg3 = \" C°\";\n\nreturn [{payload:msg1+msg2+msg3}]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":508,"y":912,"wires":[["f0c5b6c8.42a338"]]},{"id":"31fd57fd.c122c8","type":"telegram sender","z":"36ed6d21.1b3dd2","name":"","bot":"5896bb49.2b8254","haserroroutput":true,"outputs":2,"x":978,"y":924,"wires":[[],[]]},{"id":"f0c5b6c8.42a338","type":"function","z":"36ed6d21.1b3dd2","name":"","func":"var msg1 = msg.payload;\nmsg.payload = {}\n\nmsg.payload.chatId = \"Mychatid\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":976,"wires":[["b68e76c0.382808","31fd57fd.c122c8"]]},{"id":"db7cc7da.d53ba8","type":"link in","z":"36ed6d21.1b3dd2","name":"","links":["14a6d8ae.670447","5ad2676f.a540a8","fd34e4cb.408068"],"x":95,"y":928,"wires":[["41a19a93.9a0a54"]]},{"id":"41a19a93.9a0a54","type":"trigger","z":"36ed6d21.1b3dd2","name":"","op1":"","op2":"","op1type":"pay","op2type":"pay","duration":"0","extend":false,"overrideDelay":false,"units":"hr","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":288,"y":928,"wires":[["58745bb9.1c1af4","a3e6976a.bee078"]]},{"id":"f335ac61.ad7cf","type":"change","z":"36ed6d21.1b3dd2","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":308,"y":1024,"wires":[["41a19a93.9a0a54"]]},{"id":"87601bbb.6092d8","type":"ui_button","z":"36ed6d21.1b3dd2","name":"","group":"2e0e750e.824afa","order":28,"width":2,"height":2,"passthru":false,"label":"Temp","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":146,"y":1104,"wires":[["f335ac61.ad7cf"]]},{"id":"a3e6976a.bee078","type":"function","z":"36ed6d21.1b3dd2","name":"","func":"//var msg5 = msg.payload.col7;\n//var msg2 =  msg.payload;\n//var msg3 = \"°C\";\n//var date = new Date(msg.payload4)\n//var msg4 = \"Temp Pannelli TK\";\n\n//return [{payload:msg3+msg2+msg5}]\n//return msg;\nvar msg1 =\"TK - TEMP. PANNELLI, \";\n            \nvar msg2 = msg.payload.one;\nvar msg3 = msg.payload.two;\nvar msg4 = \" C°\";\n\nreturn [{ payload: msg1 + msg2 + msg4 + msg3 + msg4}]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":524,"y":976,"wires":[["f0c5b6c8.42a338","6c43d1d9.40cbf"]]},{"id":"5896bb49.2b8254","type":"telegram bot","botname":"Chris100_bot","usernames":"","chatids":"mychatID","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"2e0e750e.824afa","type":"ui_group","name":"Rotex ","tab":"ebb1ed1c.5ebe2","order":1,"disp":true,"width":"28","collapse":true},{"id":"ebb1ed1c.5ebe2","type":"ui_tab","name":"CBU Power Plant","icon":"Comandi ","order":1,"disabled":false,"hidden":false}]

can you show how the join node is configured ?

there is no join node in this flow

I guess this is the same as per your input.

[{"id":"51ce77ef.3124a8","type":"join","z":"36ed6d21.1b3dd2","g":"8d8afaec.d3a588","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":290,"y":576,"wires":[["1ec2ac68.098584"]]},{"id":"1ec2ac68.098584","type":"debug","z":"36ed6d21.1b3dd2","g":"8d8afaec.d3a588","name":"","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":304,"y":672,"wires":[]}]

did you solve the issue ?

your shared flow doesnot have the join node, so i cannot see how the join node is configured.

Hello, I'm not able to import the complete flow, the join node only has been uploaded in the flow above.

what are the inputs to the join node ? i can see only one connection into the join node

Currently, it is connected to numbers, but I have also converted as an object.
I'm able to send only one number, not two.
For this reason, I think the problem is in the function node.

I am sorry, this is beyond my comprehension, i will let experts pitch in. thanks

@298christian Let's start over.

  1. in you first post you provide your flow but it does not show the serial port node.
  2. please put a debug node on the output of the serial port node and copy/paste* (see below) the results to show what the data actually is
  3. which function node are you talking about? It is a good idea to name your nodes so you can easily refer to them.
  4. Show us what you want the combined data to look like.
  5. are the temperature values you collect in the same msg or different msgs?

Let's see if I can help you with this. Also, if you haven't yet, you should watch this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.


* There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi


The target was to send two temperature values via telegram. I'm able to send only one if it is a number. I guess that by managing the two numbers as objects, I may add more information easily.


Debug serial node
payload
0;0;88;0;34;26;32;29;2,6;;736
Below is my target, to send these two values and descriptions via telegram
payload
{"TK - Temp. Pannelli":35,"TS - Temp. bollitore":32}

Find below the called "Change topic" node in the picture.

[{"id":"86863cfc.e02b2","type":"change","z":"36ed6d21.1b3dd2","g":"8d8afaec.d3a588","name":"Change description","rules":[{"t":"set","p":"paylod.col5","pt":"msg","to":"TK-Temp. Pannelli","tot":"msg"},{"t":"set","p":"payload.col7","pt":"msg","to":"TS-Temp. Bollitore","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":378,"y":624,"wires":[["fd34e4cb.408068","1ec2ac68.098584"]]}]
[{"id":"b68e76c0.382808","type":"debug","z":"36ed6d21.1b3dd2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":848,"y":1056,"wires":[]},{"id":"6c43d1d9.40cbf","type":"debug","z":"36ed6d21.1b3dd2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":706,"y":912,"wires":[]},{"id":"ee8a8d5b.e33af","type":"telegram command","z":"36ed6d21.1b3dd2","name":"","command":"temp","bot":"5896bb49.2b8254","strict":false,"hasresponse":true,"useregex":false,"removeregexcommand":false,"outputs":2,"x":138,"y":1024,"wires":[["f335ac61.ad7cf"],[]]},{"id":"31fd57fd.c122c8","type":"telegram sender","z":"36ed6d21.1b3dd2","name":"","bot":"5896bb49.2b8254","haserroroutput":true,"outputs":2,"x":978,"y":924,"wires":[[],[]]},{"id":"f0c5b6c8.42a338","type":"function","z":"36ed6d21.1b3dd2","name":"chat Id","func":"var msg1 = msg.payload;\nmsg.payload = {}\n\nmsg.payload.chatId = \"myIDchat\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":976,"wires":[["b68e76c0.382808","31fd57fd.c122c8"]]},{"id":"db7cc7da.d53ba8","type":"link in","z":"36ed6d21.1b3dd2","name":"","links":["14a6d8ae.670447","5ad2676f.a540a8","fd34e4cb.408068"],"x":95,"y":928,"wires":[["41a19a93.9a0a54"]]},{"id":"41a19a93.9a0a54","type":"trigger","z":"36ed6d21.1b3dd2","name":"","op1":"","op2":"","op1type":"pay","op2type":"pay","duration":"0","extend":false,"overrideDelay":false,"units":"hr","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":288,"y":928,"wires":[["a3e6976a.bee078"]]},{"id":"f335ac61.ad7cf","type":"change","z":"36ed6d21.1b3dd2","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":308,"y":1024,"wires":[["41a19a93.9a0a54"]]},{"id":"87601bbb.6092d8","type":"ui_button","z":"36ed6d21.1b3dd2","name":"","group":"2e0e750e.824afa","order":28,"width":2,"height":2,"passthru":false,"label":"Temp","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":146,"y":1104,"wires":[["f335ac61.ad7cf"]]},{"id":"a3e6976a.bee078","type":"function","z":"36ed6d21.1b3dd2","name":"Temperature","func":"//var msg5 = msg.payload.col7;\n//var msg2 =  msg.payload;\n//var msg3 = \"°C\";\n//var date = new Date(msg.payload4)\n//var msg4 = \"Temp Pannelli TK\";\n\n//return [{payload:msg3+msg2+msg5}]\n//return msg;\nvar msg1 =\"TK - Temp. Pannelli, \";\n//var msg2 =\"TS - Temp. bollitore, \";   \nvar msg3 = msg.payload.one;\nvar msg4 = msg.payload.two;\nvar msg5 = \" C°\";\n\nreturn [{ payload: msg1 + msg4 + msg3 + msg4 + msg5}]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":534,"y":976,"wires":[["f0c5b6c8.42a338","6c43d1d9.40cbf"]]},{"id":"5896bb49.2b8254","type":"telegram bot","botname":"Chris100_bot","usernames":"","chatids":"mychatID","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"2e0e750e.824afa","type":"ui_group","name":"Rotex ","tab":"ebb1ed1c.5ebe2","order":1,"disp":true,"width":"28","collapse":true},{"id":"ebb1ed1c.5ebe2","type":"ui_tab","name":"CBU Power Plant","icon":"Comandi ","order":1,"disabled":false,"hidden":false}]

I don't know how to manage the function node called Temperature, I think that it could solve everything. I did not find any other solution. I hope to have clarify better now.
Thanks in advance for your efforts.

The "Change topic" node that you posted above can't be the one in your screen capture since it is invalid. You have a space between TK-Temp. and Pannelli

Looking at the screen capture I assume that your "Change topic" node outputs

{
"TK - Temp. Pannelli":52,
"TS - Temp. bollitore":32
}

But your "Temperature" node contains

var msg1 ="TK - Temp. Pannelli, ";
//var msg2 ="TS - Temp. bollitore, ";   
var msg3 = msg.payload.one;
var msg4 = msg.payload.two;
var msg5 = " C°";

return [{ payload: msg1 + msg4 + msg3 + msg4 + msg5}]
  • You have msg.payload["TK - Temp. Pannelli"] and msg.payload["TS - Temp. bollitore"] but you are trying to concatenate msg.payload.one and msg.payload.two.

I think you are making life unnecessarily difficult by having spaces and dots in element names.
Your msg1 through to msg5 are confusing to me since they are simple (and unnecessary) variables, not messages.

1 Like

In addition to what @jbudd has poined out, your change node has an error
Screen Shot 2022-12-12 at 9.08.26 AM

in the first rule you are setting msg.paylod.col5 - you want msg.payload.col5

1 Like

Hello, finally I reached my goal as per the telegram picture.
I didn't notice some errors pointed out by other members, normally the errors have the red triangle on the top.
I have modified the function node as follows and it works well.
On the debug you can see the input and the output of function nodes.

[{"id":"b68e76c0.382808","type":"debug","z":"36ed6d21.1b3dd2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":848,"y":1056,"wires":[]},{"id":"6c43d1d9.40cbf","type":"debug","z":"36ed6d21.1b3dd2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":578,"y":1056,"wires":[]},{"id":"31fd57fd.c122c8","type":"telegram sender","z":"36ed6d21.1b3dd2","name":"","bot":"ed491692.79e3f8","haserroroutput":true,"outputs":2,"x":978,"y":924,"wires":[[],[]]},{"id":"f0c5b6c8.42a338","type":"function","z":"36ed6d21.1b3dd2","name":"chat Id","func":"var msg1 = msg.payload;\nmsg.payload = {}\n\nmsg.payload.chatId = \"xxxxx\"\nmsg.payload.type = \"message\"\nmsg.payload.content = msg1\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":976,"wires":[["b68e76c0.382808","31fd57fd.c122c8"]]},{"id":"db7cc7da.d53ba8","type":"link in","z":"36ed6d21.1b3dd2","name":"","links":["14a6d8ae.670447","5ad2676f.a540a8","fd34e4cb.408068"],"x":95,"y":928,"wires":[["41a19a93.9a0a54"]]},{"id":"41a19a93.9a0a54","type":"trigger","z":"36ed6d21.1b3dd2","name":"","op1":"","op2":"","op1type":"pay","op2type":"pay","duration":"0","extend":false,"overrideDelay":false,"units":"hr","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":288,"y":928,"wires":[["a3e6976a.bee078"]]},{"id":"f335ac61.ad7cf","type":"change","z":"36ed6d21.1b3dd2","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":308,"y":1024,"wires":[["41a19a93.9a0a54"]]},{"id":"87601bbb.6092d8","type":"ui_button","z":"36ed6d21.1b3dd2","name":"","group":"2e0e750e.824afa","order":28,"width":2,"height":2,"passthru":false,"label":"Temp","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":146,"y":1104,"wires":[["f335ac61.ad7cf"]]},{"id":"a3e6976a.bee078","type":"function","z":"36ed6d21.1b3dd2","name":"Temperature","func":"\n//var msg2 = msg.payload.one;\n//var msg3 = msg.payload.two;\n//var msg4 = \" C°\";\n\n//return [{ payload: msg1 + msg3 }]\n//return msg;\n\n//copy in the description\n\nvar msg1 =\"TK-Pannelli, \";\nvar msg2 = msg.payload.col5;\nvar msg3 = \"C°\"\nvar msg4 = \"TS-Bollitore, \";\nvar msg5 = msg.payload.col7;\nvar msg6 = \"C°\";\nreturn [{ payload: msg1 + msg2 + msg3 + msg4 + msg5 + msg6 }]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":534,"y":976,"wires":[["f0c5b6c8.42a338","6c43d1d9.40cbf"]],"info":"var msg1 =\"TKTemp Pannelli, \";\nvar msg2 = msg.payload.col5;\nvar msg3 = \"TSTemp Bollitore, \";\nvar msg4 = msg.payload.col7;\nvar msg5 = \"C°\";\nreturn [{ payload: msg1 + msg2 + msg3 + msg4 + msg5 }]\nreturn msg;"},{"id":"3ebda4b3.bf841c","type":"telegram command","z":"36ed6d21.1b3dd2","name":"","command":"temp","bot":"ed491692.79e3f8","strict":false,"hasresponse":true,"useregex":false,"removeregexcommand":false,"outputs":2,"x":98,"y":1008,"wires":[["f335ac61.ad7cf"],[]]},{"id":"ed491692.79e3f8","type":"telegram bot","botname":"Chris100_bot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","botpath":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false},{"id":"2e0e750e.824afa","type":"ui_group","name":"Rotex ","tab":"ebb1ed1c.5ebe2","order":1,"disp":true,"width":"28","collapse":true},{"id":"ebb1ed1c.5ebe2","type":"ui_tab","name":"CBU Power Plant","icon":"Comandi ","order":1,"disabled":false,"hidden":false}]


Many thanks all for the tips.

1 Like

Glad to hear you got your flow working.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.