Reducing a complexity of the flow

So can you post your (complete) incoming data, the flow you currently have and a screen capture of the dashboard as it currently is?

I appreciate that this is a commercial system, you might need to falsify the data to an extent

I am attaching the SS of flow, dashboard as it currently, flow and debug panel...



flows (16).json (20.8 KB)

[{"Agg1_Current_Weight":210.6,"Agg1_Set_Weight":200,"Agg2_Current_Weight":210.6,"Agg2_Set_Weight":210,"Agg3_Current_Weight":246.59998,"Agg3_Set_Weight":220,"Agg4_Current_Weight":241.20001,"Agg4_Set_Weight":270,"Bitumen_Current_Weight":80.46,"Bitumen_Set_Weight":50,"Filler_Current_Weight":0,"Filler_Set_Weight":50,"_time":"2023-01-11T12:42:34.989Z"}]

To address just the rounding issue for your table, not whether your code is the best style, nor the issue of whitespace for Agg2, the function which constructs the table can be tweeked like this:

[
    {
        "id": "0eed20f323d53d9d",
        "type": "function",
        "z": "8b63e60d25961a51",
        "name": "",
        "func": "\n  msg.payload = [\n    {\n        \"Name\": \"Agg1\",  \n        \"Last Batch\": msg.payload[0].Agg1_Current_Weight,\n        \"Archived Recipe(%)\": Math.round(msg.payload[0].Agg1_Current_percentage * 100) / 100,\n          \"Targeted Recipe(%)\": Math.round(msg.payload[0].Agg1_Set_percentage * 100) / 100,\n          \"Error in Recipe(%)\": Math.round(msg.payload[0].Agg1_Error * 100) / 100\n    },\n    {\n        \"Name\": \"Agg2\",\n        \"Last Batch\": msg.payload[0].Agg2_Current_Weight,\n        \"Archived Recipe (%)\": Math.round(msg.payload[0].Agg2_Current_percentage * 100) / 100,\n        \"Targeted Recipe (%)\": Math.round(msg.payload[0].Agg2_Set_percentage * 100) / 100,\n        \"Error in Recipe (%)\": Math.round(msg.payload[0].Agg2_Error * 100) / 100\n    },\n    {\n        \"Name\": \"Agg3\",  \n        \"Last Batch\": msg.payload[0].Agg3_Current_Weight,\n        \"Archived Recipe(%)\": Math.round(msg.payload[0].Agg3_Current_percentage * 100) / 100,\n        \"Targeted Recipe(%)\": Math.round(msg.payload[0].Agg3_Set_percentage * 100) / 100,\n        \"Error in Recipe(%)\": Math.round(msg.payload[0].Agg3_Error * 100) / 100\n    },\n    {\n        \"Name\": \"Agg4\",  \n        \"Last Batch\": msg.payload[0].Agg4_Current_Weight,\n        \"Archived Recipe(%)\": Math.round(msg.payload[0].Agg4_Current_percentage * 100) / 100,\n        \"Targeted Recipe(%)\": Math.round(msg.payload[0].Agg4_Set_percentage * 100) / 100,\n        \"Error in Recipe(%)\": Math.round(msg.payload[0].Agg4_Error * 100) / 100\n    }\n  ];\n  return msg;\n\n\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 700,
        "y": 740,
        "wires": [
            [
                "6d4f394963cfbff8",
                "017b681410e0cb83"
            ]
        ]
    }
]

ps this is rounded to the nearest 0.01 not rounded up to 2dp. Do you really need to round up?
I think Math.ceil() rounds up. Not sure how it works with the negative numbers though.

pps Do you see the same missing values on the Agg2 line? This might be a problem in my setup.

Thank you so much for your king help!
Edit
It's working in my case.

I have seen that missing value. It's problem in my set up. I am trying to find out it.

Specify a size for your widget rather than "Auto"

Yes,
Thank you so much!

Please Help me to get this Bitumen and Filler thing

what is the calculation ?

do your mean what's the current situation by conclusion?

How are the calculations done for these values ?

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