Dashboard input

How can I change the value of the UI Text input to pass a IP Address with out the double quotes.

If you feed it into a debug node and it shows double quotes round it and those are the quotes you mean then they are not part of the string. They are just displayed to show you that it is a string. If that is not what you mean then please provide more information. Feed the text node into a debug node and show us what you are getting.

Hello Colin,

Thank you for replying. Below is a sample of the flow with screen shots. in the debug screen shot where you see payload: "192.168.1.41" i need it to be just 192.168.1.41 for the rest of my flow to work.


image

[{"id":"e8df9337.081d1","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"db2fd725.dae478","type":"ui_text_input","z":"e8df9337.081d1","name":"IP Address of Controller","label":"IP Address of Controller2","tooltip":"","group":"3487420a.cf479e","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"","x":310,"y":360,"wires":[["2755a42a.249e3c","9b6b1476.bd2e28"]]},{"id":"2755a42a.249e3c","type":"trigger","z":"e8df9337.081d1","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"-1","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":560,"y":360,"wires":[["cb50046e.88c298"]]},{"id":"cb50046e.88c298","type":"change","z":"e8df9337.081d1","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":360,"wires":[["2422bb91.2ab904"]]},{"id":"2422bb91.2ab904","type":"join","z":"e8df9337.081d1","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":970,"y":360,"wires":[["e70f2811.14b188","78ec9178.09da2","72dec9f7.893928"]]},{"id":"e70f2811.14b188","type":"ui_text","z":"e8df9337.081d1","group":"998b684b.3b4e88","order":2,"width":0,"height":0,"name":"","label":"IP Address","format":"{{ip}}","layout":"col-center","x":1170,"y":320,"wires":[]},{"id":"78ec9178.09da2","type":"function","z":"e8df9337.081d1","name":"Data Capture","func":"var d = new Date();\nvar t = d.getTime();\nvar n = d.getTimezoneOffset();\npayload={\"date/time\": d,\"Time Zone Diffrence in minutes\": n,\"IP\": msg.ip,\"Bacnet\": msg.Bacnet, \"Function\": msg.Function, \"type\": msg.ObjectID,\"App Tag\": msg.Apptag, \"Property ID\": msg.PropertyID, \"Write Value\": msg.Wvalue, \"payload\":msg.payload};\nmsg.payload=payload;\nreturn msg;","outputs":1,"noerr":0,"x":1170,"y":360,"wires":[["58abc58f.37ba3c"]]},{"id":"58abc58f.37ba3c","type":"json","z":"e8df9337.081d1","name":"","property":"payload","action":"","pretty":false,"x":1330,"y":360,"wires":[["a2b79f06.3efff"]]},{"id":"a2b79f06.3efff","type":"file","z":"e8df9337.081d1","name":"Add Device file location","filename":"/home/pi/hvac/NewDevice.log","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":1530,"y":360,"wires":[[]]},{"id":"9b6b1476.bd2e28","type":"debug","z":"e8df9337.081d1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":530,"y":320,"wires":[]},{"id":"72dec9f7.893928","type":"debug","z":"e8df9337.081d1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1150,"y":280,"wires":[]},{"id":"3487420a.cf479e","type":"ui_group","z":"","name":"Manual Device check","tab":"99082a6.ab01ed8","order":2,"disp":true,"width":"10","collapse":true},{"id":"998b684b.3b4e88","type":"ui_group","z":"","name":"Verify Data","tab":"99082a6.ab01ed8","order":3,"disp":true,"width":"6","collapse":true},{"id":"99082a6.ab01ed8","type":"ui_tab","z":"","name":"Testing","icon":"dashboard","order":12,"disabled":false,"hidden":false}]

As Colin says - they are not part of the actual string that is passed on - they are there in the debug to indicate it IS of type string... (rather than number or something else)

As Colin says it has the quotes around as it’s a string.
It can’t be a number as numbers are by default decimal.

You can test this if you want with the following code in a function node which will return the first character

msg.payload=msg.payload.charAt(0);
return msg

@ukmoose
I will upload the the rest of the code. The issues is when it is imported from the file i now have double quotes in the end.
image

[{"id":"4d9bb02d.3c221","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"d5e4329a.34dcc","type":"file","z":"4d9bb02d.3c221","name":"Add Device file location","filename":"/home/pi/hvac/NewDevicet.log","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":1330,"y":160,"wires":[[]]},{"id":"fda39a59.9492e8","type":"json","z":"4d9bb02d.3c221","name":"","property":"payload","action":"","pretty":false,"x":1130,"y":160,"wires":[["d5e4329a.34dcc"]]},{"id":"999c8364.1ce2f","type":"function","z":"4d9bb02d.3c221","name":"Data Capture","func":"var d = new Date();\nvar t = d.getTime();\nvar n = d.getTimezoneOffset();\npayload={\"date/time\": d,\"Time Zone Diffrence in minutes\": n,\"IP\": msg.ip,\"payload\":msg.payload};\nmsg.payload=payload;\nreturn msg;","outputs":1,"noerr":0,"x":970,"y":160,"wires":[["fda39a59.9492e8"]]},{"id":"d5b1df63.4836e","type":"ui_text","z":"4d9bb02d.3c221","group":"998b684b.3b4e88","order":2,"width":0,"height":0,"name":"","label":"IP Address t","format":"{{ip}}","layout":"col-center","x":970,"y":120,"wires":[]},{"id":"2ad642ce.cb9b8e","type":"join","z":"4d9bb02d.3c221","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":810,"y":140,"wires":[["d5b1df63.4836e","999c8364.1ce2f"]]},{"id":"6aaca32c.2bd5cc","type":"ui_text_input","z":"4d9bb02d.3c221","name":"IP Address of Controller","label":"IP Address of Controller t","tooltip":"","group":"3487420a.cf479e","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"","x":190,"y":140,"wires":[["4e2bdc1d.540fd4"]]},{"id":"4e2bdc1d.540fd4","type":"trigger","z":"4d9bb02d.3c221","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"-1","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":420,"y":140,"wires":[["c74ed3c7.cc2e7"]]},{"id":"c74ed3c7.cc2e7","type":"change","z":"4d9bb02d.3c221","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":140,"wires":[["2ad642ce.cb9b8e"]]},{"id":"360d39b.9e670c6","type":"ui_button","z":"4d9bb02d.3c221","name":"","group":"3487420a.cf479e","order":10,"width":0,"height":0,"passthru":false,"label":"Check Device t (can take up to 2 mins)","tooltip":"","color":"red","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"","x":230,"y":340,"wires":[["1b60118b.13a3de"]]},{"id":"1b60118b.13a3de","type":"file in","z":"4d9bb02d.3c221","name":"","filename":"/home/pi/hvac/NewDevicet.log","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":550,"y":340,"wires":[["4895820f.cbcb3c"]]},{"id":"4895820f.cbcb3c","type":"split","z":"4d9bb02d.3c221","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":770,"y":340,"wires":[["33aaa0c1.8a8ab"]]},{"id":"33aaa0c1.8a8ab","type":"switch","z":"4d9bb02d.3c221","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"\"IP\":","vt":"str"},{"t":"cont","v":"\"Bacnet\":","vt":"str"},{"t":"cont","v":"\"Function\":","vt":"str"},{"t":"cont","v":"\"type\":","vt":"str"},{"t":"cont","v":"\"App Tag\":","vt":"str"},{"t":"cont","v":"\"Property ID\":","vt":"str"},{"t":"cont","v":"\"Write Value\":","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":940,"y":340,"wires":[["260bf6bb.43c7ca"],[],[],[],[],[],[]]},{"id":"260bf6bb.43c7ca","type":"change","z":"4d9bb02d.3c221","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1170,"y":280,"wires":[["f57ef9c1.c9cbc8"]]},{"id":"f57ef9c1.c9cbc8","type":"join","z":"4d9bb02d.3c221","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"7","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1350,"y":280,"wires":[["f449ca4e.850f98"]]},{"id":"f449ca4e.850f98","type":"switch","z":"4d9bb02d.3c221","name":"","property":"Function","propertyType":"jsonata","rules":[{"t":"cont","v":"\"Function\":\"Read Function\"","vt":"str"},{"t":"cont","v":"\"Function\":\"Write Function\"","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1490,"y":280,"wires":[["f0cb49e4.082a48"],[]]},{"id":"f0cb49e4.082a48","type":"change","z":"4d9bb02d.3c221","name":"","rules":[{"t":"move","p":"ip","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1650,"y":280,"wires":[["50cd0aa9.4e49e4"]]},{"id":"50cd0aa9.4e49e4","type":"split","z":"4d9bb02d.3c221","name":"","splt":":","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1810,"y":280,"wires":[["f66c54ac.de2388"]]},{"id":"f66c54ac.de2388","type":"switch","z":"4d9bb02d.3c221","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"\"192.168","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1950,"y":280,"wires":[["3672d122.7145be"],[]]},{"id":"3672d122.7145be","type":"change","z":"4d9bb02d.3c221","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2130,"y":280,"wires":[["3a5e87f5.466668"]]},{"id":"3a5e87f5.466668","type":"function","z":"4d9bb02d.3c221","name":"","func":"var I = msg.ip\nvar newMsg1 = {payload:I};\nreturn newMsg1;","outputs":1,"noerr":0,"x":2310,"y":280,"wires":[["bf494d67.0af2"]]},{"id":"bf494d67.0af2","type":"change","z":"4d9bb02d.3c221","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2490,"y":280,"wires":[["6be413de.7b53bc"]]},{"id":"6be413de.7b53bc","type":"join","z":"4d9bb02d.3c221","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":2670,"y":280,"wires":[["5b6e8d20.2c0544"]]},{"id":"5b6e8d20.2c0544","type":"debug","z":"4d9bb02d.3c221","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":2810,"y":240,"wires":[]},{"id":"998b684b.3b4e88","type":"ui_group","z":"","name":"Verify Data","tab":"99082a6.ab01ed8","order":3,"disp":true,"width":"6","collapse":true},{"id":"3487420a.cf479e","type":"ui_group","z":"","name":"Manual Device check","tab":"99082a6.ab01ed8","order":2,"disp":true,"width":"10","collapse":true},{"id":"99082a6.ab01ed8","type":"ui_tab","z":"","name":"Testing","icon":"dashboard","order":12,"disabled":false,"hidden":false}]

Your pasted flow contains two distinct flows. No need to include flows not needed.

One thing is you have no debug flows along your flow, so how do you know what messages are actually being passed?
Place debug nodes along your flow, configure them to display the entire message and check on what messages are being sent.
Pay particular attention to your join nodes

The flows are related. I fixed this issue last time by changing the UI text input to number and the double quotes did not occur later in the 2nd flow.

Also maybe a few too many json nodes - the output to file will write the incoming json just fine. the top flow should maybe be a bit like this... - (though I changed the file name to suit my laptop)...

[{"id":"812abd61.6b823","type":"file","z":"1f7ee0df.a51cef","name":"Add Device file location","filename":"/tmp/NewDevicet.log","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":1330,"y":160,"wires":[[]]},{"id":"b3df034b.1efe8","type":"function","z":"1f7ee0df.a51cef","name":"Data Capture","func":"var d = new Date();\nvar t = d.getTime();\nvar n = d.getTimezoneOffset();\npayload={\"date/time\": d,\"Time Zone Difference in minutes\": n,\"IP\": msg.ip,\"payload\":msg.payload};\nmsg.payload=payload;\nreturn msg;","outputs":1,"noerr":0,"x":970,"y":160,"wires":[["812abd61.6b823","7085dbc0.ae7634"]]},{"id":"47c0ea0e.f6ff54","type":"change","z":"1f7ee0df.a51cef","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"ip","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":140,"wires":[["c0f931c9.b4fd","b3df034b.1efe8"]]},{"id":"7085dbc0.ae7634","type":"debug","z":"1f7ee0df.a51cef","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1290,"y":120,"wires":[]},{"id":"fcd66883.2931b8","type":"trigger","z":"1f7ee0df.a51cef","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"-1","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":420,"y":140,"wires":[["47c0ea0e.f6ff54"]]},{"id":"c0f931c9.b4fd","type":"ui_text","z":"1f7ee0df.a51cef","group":"9ed1920c.67ae4","order":2,"width":0,"height":0,"name":"","label":"IP Address t","format":"{{ip}}","layout":"col-center","x":970,"y":120,"wires":[]},{"id":"bc09c2fb.bcbc5","type":"ui_text_input","z":"1f7ee0df.a51cef","name":"IP Address of Controller","label":"IP Address of Controller t","tooltip":"","group":"ee8cfade.5904f8","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"","x":190,"y":140,"wires":[["fcd66883.2931b8"]]},{"id":"b8d40718.cbdc38","type":"inject","z":"1f7ee0df.a51cef","name":"","topic":"","payload":"192.168.0.25","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":200,"wires":[["fcd66883.2931b8"]]},{"id":"9ed1920c.67ae4","type":"ui_group","z":"","name":"Verify Data","tab":"dfd0095f.3ae328","order":3,"disp":true,"width":"6","collapse":true},{"id":"ee8cfade.5904f8","type":"ui_group","z":"","name":"Manual Device check","tab":"dfd0095f.3ae328","order":2,"disp":true,"width":"10","collapse":true},{"id":"dfd0095f.3ae328","type":"ui_tab","z":"","name":"Testing","icon":"dashboard","order":12,"disabled":false,"hidden":false}]

The IP needs to be entered via the text input. Then passed along. My goal here was to have all the values needed in my function be define based on the multiple text inputs.

Everything works except for the IP address. My flow is too big to insert.

not sure why you keep sending it - once it's written to file it should be ok...
also - then on the read side - once read - you probably DO need a json node to make it back into an object so you can just access msg.payload.IP etc directly.

Write part of flow.

Read part


Thank you for advising me to use the json node, I got it to work. Now my next obstacle is take the new payload created to have ' before and after the value of msg.payload. Any advice on that?