Workflow output to update the dahsboard widgets

I am struggling to find a guide to set dashboard widget according to my attributes. all widgets are only allowing the payload attributes which sent by my device. basically I am searching for a guide that allow me to understand the connection between dashboard and workflow. if I make a workflow like whenver my device connected to losant that triggers and my indicator widget set to RUNNING and whenever my device disconnected with losant it says POWERED OFF and when my device is connected to losant but if there is no data was sent in last 100 seconds indicator should be set to STANDBY.

Also I am searching for a widget that only shows data of perticular time. I have 10 production machines which run MON to FRI in 2 shifts. But all the widgets have fixed time. Is there any custom time selection for widgets that only shows data visulization of perticular time slots?

Also the production target for my all machines are diffrent in all shifts so I can not alwats set a permaenant value on guage widget. I am ready to make external form on my own website which allow the production supervisor to fill the target production value for each machine on new shift and that form will send the json payload to losant. But here also I can not find a guide that how that json data will set the set value on guage indicator!

So basically I am searching for a guide that give me an overview how I can do something on workflow and the result can be displayed on the dashboard widgets.

Please note that I am not an IT proffessional, I am a control systems engineer.

Hi @Jimish_Patel and welcome to the Losant forums!

For a general introduction to dashboards and data visualization, recommend checking out our LosantU courses - specifically Course 104: Data Visualization. Additionally, if you haven’t done so already, check out our documentation on dashboards and dashboard blocks.

I am searching for a widget that only shows data of perticular time. I have 10 production machines which run MON to FRI in 2 shifts. But all the widgets have fixed time. Is there any custom time selection for widgets that only shows data visulization of perticular time slots?

Dashboards can be set to a particular date and time, but individual blocks currently cannot. This has been brought up recently by other users as well, so I’ll add a +1 to the feature request. I’ll respond to this thread if I get any updates.

With regards to your question on the Indicator Block queries, give me a bit to put together a proof-of-concept for your use case.

With regards to the Indicator Block configuration…

You can use a conditional expression to display a chosen color / label if a particular device attribute has been reported within a certain amount of time by using the subtract and currentDateTime helpers. For example:

{{ subtract (currentDateTime 'x') time-0 }} < 100000

This subtracts the Time Variable of your query (in this example, time-0) from the current time (in Unix milliseconds) and evaluates if it’s less than 100000 (100 seconds in milliseconds).

You could then evaluate if it’s between 100000 and 200000:

{{ subtract (currentDateTime 'x') time-0 }} > 100000 && {{ subtract (currentDateTime 'x') time-0 }} < 200000

And finally, evaluate if it’s over 200000:

{{ subtract (currentDateTime 'x') time-0 }} > 200000

This assumes that you are OK with using the last time a particular device attribute reported as the basis of your Indicator Block.

Alternatively, you can use Device: Connect, Device: Disconnect, and Device: Inactive Triggers along with a Device: Update Node to update a particular device attribute value, which you can then reference in your Indicator Block. The consideration here is that each invocation of a trigger counts towards your payload limit, so if you have devices connecting and disconnecting frequently, it could add up. However, if you’re already taking other actions in a workflow based on these triggers, you might consider this approach.

Thank you for the update. I am satisfied with dashboard and the indicator block solution.

Can you please tell me that is the work flow only for trigger and alerts or it also be able to do some maths and display that manipulated data on dashboard? Because dashboard widgets need some attributes and those attributes only available from device data. I was searching for something in workflow that can use my original attributes and do some maths/manipulation and generate new updated attributes that can be used to display on dashboard widgets.

You can certainly use workflows to perform mathematical calculations on device attributes (using logic nodes such as the Math Node or Function Node), which can then be saved as new device attributes (using the Device: Update Node). These values can then be referenced in dashboard blocks.

However, most dashboard blocks allow for the use of expressions, which can be used to perform basic calculations on device attributes (as demonstrated with the Indicator Block above). While you have far fewer data transformation capabilities in a dashboard block than you do with the workflow engine, this allows you to transform data without saving it as a separate device attribute or elsewhere in your application.

  1. As you mentioned that currently there is no customized time DURATION for the widgets available, I came to an idea that anyhow if I can make a form/button or anything on experience view to allow my user to reset the widgets to 0 before starting of a shift to monitor the performance of all machines during that shift, if I can do this then my major obstacle will be eliminated.

  2. In the attached photo, can I give the access to my user to enter the value of x axis ? because I am gonna use this widget to show them how much machine is producing with compare to given target.

because that field is not filled with an attribute otherwise I will go for a mqtt message from a separate form.

My apologies for the delay. The functionality you’ve laid out here is not currently possible on the platform, with the possible exception of some fairly advanced Custom HTML blocks. Please let us know if you have any further questions.