Summation of variables received through flow

I am just trying to perform summation for two variables. In that I am able to perform summation with constant value using Function Node.
But I am not able to perform the same for variable (value from flow). I am attaching Image of flow and json file below.
I think something is wrong with flow.get or payload parameters. Still, I am not sure where things are going wrong. Below is what I have wrote In Function Node.

var val1 = (flow.get("val1")|| "0" );
msg.payload = (flow.get("val2")|| "0" ) + val1;
return msg;

It would be great to have guidance regarding the same.

Flow.json (8.1 KB)

See this article in the cookbook for an example of how to join messages into one object.

Once you have both values in one msg, you can do the maths. There is no need for flow.get.

Thank you so much!
Please can you explain me in bit detail? After using Join node where I can write math thing. how will it recognize values?

in a function or change node

Use a debug node to get the path to the values (hint: copy path button)

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

You are using a string "0" as the default if neither context variable flow.val1 or flow.val2 has a value.
"0" + "0" = "00" which may not be the result you expect.

It might be worth trying

var val1 = (flow.get("val1")|| 0 );
msg.payload = (flow.get("val2")|| 0 ) + val1;
return msg;

I have tried as below. but still there is some mistake

[{"id":"2349502c.99c05","type":"tab","allowCycles":false,"readOnly":false,"userName":"mitin@prima-automation.com","tenant":"iiotgjgt","label":"Flow 1","disabled":false},{"id":"4780e4e9.f653cc","type":"change","z":"2349502c.99c05","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":715,"y":110,"wires":[["f01cd66d.5228a8"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"c8c7845e.fd0f18","type":"change","z":"2349502c.99c05","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":727.7708892822266,"y":183.98615264892578,"wires":[["f01cd66d.5228a8"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"1786df32.6c6941","type":"change","z":"2349502c.99c05","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$sum(payload)\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1025,"y":130,"wires":[["3b7d302.ad24ad"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"af154ee0.f9df","type":"extract parameter","z":"2349502c.99c05","name":"Agg1_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg1_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"te977db91a139c\",\"variableName\":\"Agg1_Current_Weight\"}","parameter":"Agg1_Current_Weight","x":505,"y":110,"wires":[["4780e4e9.f653cc"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"f0aa8a90.81e3b8","type":"extract parameter","z":"2349502c.99c05","name":"Agg2_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg2_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"tf977db91a139d\",\"variableName\":\"Agg2_Current_Weight\"}","parameter":"Agg2_Current_Weight","x":522.7708282470703,"y":188.18750762939453,"wires":[["c8c7845e.fd0f18"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"f01cd66d.5228a8","type":"join","z":"2349502c.99c05","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","x":875,"y":130,"wires":[["1786df32.6c6941"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"84c6f1b5.7106c","type":"read timeseries","z":"2349502c.99c05","name":"Agg1_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg1_Current_Weight","topicLabel":"BatchMix/BatchMix_Current_Weight/Agg1_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspects\":[{\"aspectId\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variables\":[{\"variableId\":\"te977db91a139c\",\"name\":\"Agg1_Current_Weight\"}]}]}","assetName":"","selectedTopics":"","period":"60","offset":"0","mode":"lastValue","from":"","datetimepickerFrom":"","to":"","datetimepickerTo":"","timezoneoffset":0,"x":265,"y":110,"wires":[["af154ee0.f9df"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"1b27e2e0.e0d6ad","type":"read timeseries","z":"2349502c.99c05","name":"Agg2_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg2_Current_Weight","topicLabel":"BatchMix/BatchMix_Current_Weight/Agg2_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspects\":[{\"aspectId\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variables\":[{\"variableId\":\"tf977db91a139d\",\"name\":\"Agg2_Current_Weight\"}]}]}","assetName":"","selectedTopics":"","period":"60","offset":"0","mode":"lastValue","from":"","datetimepickerFrom":"","to":"","datetimepickerTo":"","timezoneoffset":0,"x":285,"y":190,"wires":[["f0aa8a90.81e3b8"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"98481e0f.ba3d","type":"ui_button","z":"2349502c.99c05","name":"","group":"933bef30.6e133","order":0,"width":0,"singleBrowser":false,"height":0,"passthru":false,"label":"button","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","powerMode":false,"x":55,"y":150,"wires":[["84c6f1b5.7106c","1b27e2e0.e0d6ad"]],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"3b7d302.ad24ad","type":"ui_gauge","z":"2349502c.99c05","name":"","group":"933bef30.6e133","order":0,"width":0,"singleBrowser":false,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1189.7847442626953,"y":131.97223663330078,"wires":[],"userName":"mitin@prima-automation.com","tenant":"iiotgjgt"},{"id":"933bef30.6e133","type":"ui_group","z":"","name":"Summation","tab":"71bf6668.e36f88","order":2,"disp":true,"width":"6","collapse":false,"userName":"mitin@prima-automation.com","_type":"config"},{"id":"71bf6668.e36f88","type":"ui_tab","z":"","name":"PLANT1","icon":"dashboard","publicAccess":"true","fmAccess":"default","fmAccessType":"private","assetType":"","asset":"","assetName":"","assetText":"","image":"","description":"","hideTitleBar":false,"readOnly":false,"userName":"mitin@prima-automation.com","tenant":"iiotgjgt","_type":"config"}]

Thank you so much!
I tried this but didn't work.

Try this...

image

[{"id":"4780e4e9.f653cc","type":"change","z":"2349502c.99c05","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"1","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"top_flow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":715,"y":110,"wires":[["f01cd66d.5228a8"]]},{"id":"c8c7845e.fd0f18","type":"change","z":"2349502c.99c05","name":"","rules":[{"t":"set","p":"parts","pt":"msg","to":"2","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"bottom_flow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":160,"wires":[["f01cd66d.5228a8"]]},{"id":"1786df32.6c6941","type":"change","z":"2349502c.99c05","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload.top_flow) + $number(payload.bottom_flow)\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1025,"y":130,"wires":[["3b7d302.ad24ad","38d373776ff50988"]]},{"id":"f01cd66d.5228a8","type":"join","z":"2349502c.99c05","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":875,"y":130,"wires":[["1786df32.6c6941","f78c284a3dea9ccf"]]},{"id":"3b7d302.ad24ad","type":"ui_gauge","z":"2349502c.99c05","name":"","group":"933bef30.6e133","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1290,"y":120,"wires":[]},{"id":"f78c284a3dea9ccf","type":"debug","z":"2349502c.99c05","name":"show me what comes out of here","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1040,"y":200,"wires":[]},{"id":"38d373776ff50988","type":"debug","z":"2349502c.99c05","name":"show me what comes out of here","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1200,"y":80,"wires":[]},{"id":"933bef30.6e133","type":"ui_group","name":"Summation","tab":"71bf6668.e36f88","order":2,"disp":true,"width":"6","collapse":false},{"id":"71bf6668.e36f88","type":"ui_tab","name":"PLANT1","icon":"dashboard"}]

Sorry for bothering again but I have tried and still not able to correct my mistake. Please could you help me with this?

I did - I provided a demo flow and a picture with instructions

  • You don't set the topics in the change nodes
  • I cannot see inside you "change node" to see what you are doing.

Anyhow - here is an updated version now I can actually see your incoming data is an array with 1 value inside.

Working proof...

You will need to import this flow...

[{"id":"df65cc8f973b0a5f","type":"change","z":"a974952f9392fa56","name":"set topic to agg1","rules":[{"t":"set","p":"topic","pt":"msg","to":"agg1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":800,"wires":[["d2c492ea3d25a575"]]},{"id":"a3f93bb6fdad6f2c","type":"change","z":"a974952f9392fa56","name":"set topic to agg2","rules":[{"t":"set","p":"topic","pt":"msg","to":"agg2","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":860,"wires":[["d2c492ea3d25a575"]]},{"id":"9316bbc0645bbd2e","type":"change","z":"a974952f9392fa56","name":"payload.agg1 + payload.agg2","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload.agg1) + $number(payload.agg2)\t","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"Gauge Title","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":820,"wires":[["4ccf5cda8d69f6ff","d96990631e4fbb74"]]},{"id":"d2c492ea3d25a575","type":"join","z":"a974952f9392fa56","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":840,"y":820,"wires":[["9316bbc0645bbd2e","50665031e81c1dc5"]]},{"id":"4ccf5cda8d69f6ff","type":"ui_gauge","z":"a974952f9392fa56","name":"","group":"933bef30.6e133","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":"500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":1290,"y":820,"wires":[]},{"id":"50665031e81c1dc5","type":"debug","z":"a974952f9392fa56","name":"result of join","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":990,"y":880,"wires":[]},{"id":"d96990631e4fbb74","type":"debug","z":"a974952f9392fa56","name":"gauge data","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"topic & ': ' & payload","statusType":"jsonata","x":1310,"y":760,"wires":[]},{"id":"4c43aa384d9a6162","type":"inject","z":"a974952f9392fa56","name":"simulate Agg1 blue node","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"xxxx_crazy_long_topic_xxx/BatchMix_blahblah_Agg1/realy/realy/long/topic","payload":"[265.5]","payloadType":"json","x":430,"y":800,"wires":[["df65cc8f973b0a5f"]]},{"id":"6c45f65bcffc40d2","type":"inject","z":"a974952f9392fa56","name":"simulate Agg2 blue node","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"xxxx_crazy_long_topic_xxx/BatchMix_blahblah_Agg2/realy/realy/long/topic","payload":"[261]","payloadType":"json","x":430,"y":860,"wires":[["a3f93bb6fdad6f2c"]]},{"id":"933bef30.6e133","type":"ui_group","name":"Summation","tab":"71bf6668.e36f88","order":2,"disp":true,"width":"6","collapse":false},{"id":"71bf6668.e36f88","type":"ui_tab","name":"PLANT1","icon":"dashboard"}]

Some questions though...

  1. What are the 2 blue Aggx_xxx nodes on the left? Database nodes? - if yes, then why not simply do this summation in a database query - then you will get the result without all this extra work
  2. What is the "set msg.parts" all about? what reason?

Thank you so much again!

  1. Yes, those 2 are database node. Actually, I am using Mindshare Visual Flow Creator. Which is based on Node red. So I am trying to perform functions on the stored data.
  2. I was trying two set those as part and then join.

and sorry for bothering again. But It's showing undefine for the change nod which we used after join node. Please help me with this one also.




and Also I have question that, Red cross in JSONata (Scrrenshot 359) indicate error?

You can clearly see it works from my screenshot AND I provided you with the working flow to import

However it seems you didnt use it?

Look at what the join node outputs...
image

Now look at what you have in the change node...
image

HINT: agg1 is not the same as Agg1

JavaScript is case sensitive. Use the tools it provides to avoid typos...

canned text...

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

HINT: :point_up_2: use "copy path" button :point_up_2: to get the path to a property and use that in your JSONata

Sorry, it was my silly mistake. Thank you for your kind help. I will keenly go through the sources you have provided to conquer my basic knowledge.

Hello!
I am trying to display data which is being choose through drop down node on the dashboard. I have tried this but it works ok for the first time and as I choose 2nd time it shows any value from the list. I have done as below. Kindly guide me.

before this I didn't use change node but then I added thinking that something can be done with the topic and payload to display selected value.

[{"id":"d499028f.0d59f","type":"ui_dropdown","z":"d5fb055e.9fec08","name":"","label":"","place":"Select option","group":"70709469.2c1bcc","order":0,"width":0,"singleBrowser":false,"height":0,"passthru":true,"options":[{"label":"Agg1_Current_Weight","value":"payload.Agg1","type":"str"},{"label":"Agg2_Current_Weight","value":"payload.Agg2","type":"str"},{"label":"Agg3_Current_Weight","value":"payload.Agg3","type":"str"},{"label":"Agg4_Current_Weight","value":"payload.Agg4","type":"str"},{"label":"Bitumen_Current_Weight","value":"payload.Bitumen","type":"str"},{"label":"Filler_Current_Weight","value":"payload.Filler","type":"str"}],"payload":"","topic":"","powerMode":false,"x":1120,"y":620,"wires":[["136118a6.b02817","38e85ae4.5c4686"]],"_type":"node"},{"id":"93a9b3ea.1e91d","type":"read timeseries","z":"d5fb055e.9fec08","name":"All 6 var read","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg1_Current_Weight,Agg2_Current_Weight,Agg3_Current_Weight,Agg4_Current_Weight,Bitumen_Current_Weight,Filler_Current_Weight","topicLabel":"BatchMix/BatchMix_Current_Weight/Agg1_Current_Weight,Agg2_Current_Weight,Agg3_Current_Weight,Agg4_Current_Weight,Bitumen_Current_Weight,Filler_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspects\":[{\"aspectId\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variables\":[{\"variableId\":\"te977db91a139c\",\"name\":\"Agg1_Current_Weight\"},{\"variableId\":\"tf977db91a139d\",\"name\":\"Agg2_Current_Weight\"},{\"variableId\":\"tg977db91a139e\",\"name\":\"Agg3_Current_Weight\"},{\"variableId\":\"th977db91a139f\",\"name\":\"Agg4_Current_Weight\"},{\"variableId\":\"ti977db91a13a0\",\"name\":\"Bitumen_Current_Weight\"},{\"variableId\":\"tj977db91a13a1\",\"name\":\"Filler_Current_Weight\"}]}]}","assetName":"","selectedTopics":"","period":"60","offset":"0","mode":"lastValue","from":"","datetimepickerFrom":"","to":"","datetimepickerTo":"","timezoneoffset":0,"x":270,"y":600,"wires":[["d0958e27.c7ed6","a8cd0226.a5993","4ec21130.a754","44eb1d46.840f94","b39f0773.b87d28","fc4bda16.832b88"]],"_type":"node"},{"id":"38e85ae4.5c4686","type":"ui_gauge","z":"d5fb055e.9fec08","name":"","group":"70709469.2c1bcc","order":0,"width":0,"singleBrowser":false,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{msg.payload}}","min":0,"max":"500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1410,"y":720,"wires":[],"_type":"node"},{"id":"c96e2f4c.82b9a","type":"ui_button","z":"d5fb055e.9fec08","name":"","group":"70709469.2c1bcc","order":0,"width":0,"singleBrowser":false,"height":0,"passthru":false,"label":"button","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"Current_Weight","powerMode":false,"x":110,"y":600,"wires":[["93a9b3ea.1e91d"]],"_type":"node"},{"id":"d0958e27.c7ed6","type":"extract parameter","z":"d5fb055e.9fec08","name":"Agg1_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg1_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"te977db91a139c\",\"variableName\":\"Agg1_Current_Weight\"}","parameter":"Agg1_Current_Weight","x":580,"y":440,"wires":[["e45338ad.d3f048"]],"_type":"node"},{"id":"a8cd0226.a5993","type":"extract parameter","z":"d5fb055e.9fec08","name":"Agg2_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg2_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"tf977db91a139d\",\"variableName\":\"Agg2_Current_Weight\"}","parameter":"Agg2_Current_Weight","x":587.49609375,"y":497.06640625,"wires":[["12dec0e5.0650af"]],"_type":"node"},{"id":"4ec21130.a754","type":"extract parameter","z":"d5fb055e.9fec08","name":"Agg3_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg3_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"tg977db91a139e\",\"variableName\":\"Agg3_Current_Weight\"}","parameter":"Agg3_Current_Weight","x":587.49609375,"y":559.06640625,"wires":[["7f2ae022.7d546"]],"_type":"node"},{"id":"44eb1d46.840f94","type":"extract parameter","z":"d5fb055e.9fec08","name":"Agg4_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Agg4_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"th977db91a139f\",\"variableName\":\"Agg4_Current_Weight\"}","parameter":"Agg4_Current_Weight","x":587.49609375,"y":619.06640625,"wires":[["778fea35.806834"]],"_type":"node"},{"id":"b39f0773.b87d28","type":"extract parameter","z":"d5fb055e.9fec08","name":"Bitumen_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Bitumen_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"ti977db91a13a0\",\"variableName\":\"Bitumen_Current_Weight\"}","parameter":"Bitumen_Current_Weight","x":590,"y":680,"wires":[["1090a631.5ac02a"]],"_type":"node"},{"id":"fc4bda16.832b88","type":"extract parameter","z":"d5fb055e.9fec08","name":"Filler_Current_Weight","topic":"1a655a707b4a445a98eb4f4e516b02a0/BatchMix_Current_Weight/Filler_Current_Weight","topicData":"{\"asset\":\"1a655a707b4a445a98eb4f4e516b02a0\",\"assetName\":\"BatchMix\",\"aspect\":\"cde53ccd1ff84624af95951d5dc41188\",\"aspectName\":\"BatchMix_Current_Weight\",\"variable\":\"tj977db91a13a1\",\"variableName\":\"Filler_Current_Weight\"}","parameter":"Filler_Current_Weight","x":587.49609375,"y":759.06640625,"wires":[["1c191cf6.f0add3"]],"_type":"node"},{"id":"e45338ad.d3f048","type":"change","z":"d5fb055e.9fec08","name":"set topic to agg1","rules":[{"t":"set","p":"topic","pt":"msg","to":"Agg1","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":440,"wires":[["d499028f.0d59f"]],"_type":"node"},{"id":"12dec0e5.0650af","type":"change","z":"d5fb055e.9fec08","name":"set topic to agg2","rules":[{"t":"set","p":"topic","pt":"msg","to":"Agg2","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":500,"wires":[["d499028f.0d59f"]],"_type":"node"},{"id":"7f2ae022.7d546","type":"change","z":"d5fb055e.9fec08","name":"set topic to agg3","rules":[{"t":"set","p":"topic","pt":"msg","to":"Agg3","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":560,"wires":[["d499028f.0d59f"]],"_type":"node"},{"id":"778fea35.806834","type":"change","z":"d5fb055e.9fec08","name":"set topic to agg4","rules":[{"t":"set","p":"topic","pt":"msg","to":"Agg4","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":620,"wires":[["d499028f.0d59f"]],"_type":"node"},{"id":"1090a631.5ac02a","type":"change","z":"d5fb055e.9fec08","name":"set topic to Bitumen","rules":[{"t":"set","p":"topic","pt":"msg","to":"Bitumen","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":680,"wires":[["d499028f.0d59f"]],"_type":"node"},{"id":"1c191cf6.f0add3","type":"change","z":"d5fb055e.9fec08","name":"set topic to Filler","rules":[{"t":"set","p":"topic","pt":"msg","to":"Filler","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":760,"wires":[["d499028f.0d59f"]],"_type":"node"},{"id":"136118a6.b02817","type":"debug","z":"d5fb055e.9fec08","name":"","active":true,"console":"false","xaxis":"","complete":"payload","x":1383.5,"y":627.97265625,"wires":[],"_type":"node"},{"id":"70709469.2c1bcc","type":"ui_group","z":"","name":"Position","tab":"71bf6668.e36f88","order":3,"disp":true,"width":"6","collapse":false,"_type":"config"},{"id":"71bf6668.e36f88","type":"ui_tab","z":"","name":"PLANT1","icon":"dashboard","publicAccess":"true","fmAccess":"default","fmAccessType":"private","assetType":"","asset":"","assetName":"","assetText":"","image":"","description":"","hideTitleBar":false,"_type":"config"}]

I think It passes on String value (Payload.Agg1 or..). Number value is not being passed to gauge.

If I set Value in numeric form and write 1,2,3,4,5,6. It give that 1,2 ,3,4,5,6 on the gauge as per option selected in drop down menu at dashboard.

How can I get variable value from there instead of constant number?

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