[Solved] Dashboard block displaying raw data

state
dashboard

#1

Hi, I have a full working devices conecting and reporting, I get the Device State ( into the Workflow) then doing some math inside a function node, not returning anything just replacing the payload.data.VALUE for the new one, but the Dashboard displays the raw data coming from the device…
Placing a Debug node at the output of Function node show the value modified. So I am lost, here.

image

It is not the same vale as many payloads arrived later, but… the idea is that is not catching the value after the Function node, it is the raw value coming directly from device.

Thanks in advance


#2

Hello Esteban,

You are missing a couple of steps to getting this value to your device. Your function replaces the value of “FREQ” within the workflow, but the device must also be updated to have this value. I have replicated your workflow below so you can see the solution:


Here I have my workflow with a function that changes the value of rpm to 6 when rpm is 1. You can see in the debug log here that rpm has been changed to 6, but over on my dashboard, nothing has changed, the rpms are still at 1.
33%20PM

To remedy this, there are a couple of steps.

Updating State and Device: State

I begin by adding a Device State node, that will update my device’s value from 1 to 6, since I have set it to the new value. I run into a problem here: an infinite loop! In updating my device, I am also triggering the workflow again.

Now, I will add a conditional to ensure I don’t get stuck in a loop again.


RelayType, which can be seen in the debug tab, is different based on where the Device State has been updated from. Data coming from a device will read “device,” and data coming from a Device State node will be labeled “flow.”

Here are the two debug logs, the first is from the device, and the second is from the Device State node.
11%20PM

Now, my dashboard will reflect the correct value of 6, showing that I have successfully updated the device state from the function node.

Note: the value of FREQ will replaced on the original state report. If you’d like a new state report to be triggered by Device State, change Time to a value other than “use the time of the current payload”
22%20PM

Hopefully this helps!
Julia


#3

Thanks a lot Julia, it worked , thanks a lot.