Fikar Suwardi
Fikar Suwardi

Reputation: 35

How to Calculate and Visualize Flowrate Difference Between Two Devices in Thingsboard?

I’m working on an IoT project for rainwater management using Thingsboard. In this project, I’ve created two devices: Flowmeter 1 (as input) and Flowmeter 2 (as output). Both devices send flowrate data.

I want to display this flowrate data on a line chart, showing the calculation: Flowrate Output (Flowmeter 2) - Flowrate Input (Flowmeter 1).

What’s the best way to process this data in Thingsboard so that it can be visualized on the chart?

Thanks in advance!

Upvotes: 0

Views: 66

Answers (2)

Allan Caldas
Allan Caldas

Reputation: 1

If what you want is to show the graph data on ThingsBoard, it seems very simple to me:

Just insert the Device and make sure the telemetry is arriving correctly. After that, insert a graph in a Dashboard and point it to that specific Device.

enter image description here

enter image description here

Upvotes: 0

ThingsMaster3000
ThingsMaster3000

Reputation: 141

This question seems easy at surface, but there are some things to consider here.

Does your meters report data at same time? If not, how large is a time difference between them. I assume that if it is anything grater than 1 minute, you can't just do value_1-value_2 and call it a day.

What I have done for similar case is calculating the difference every 10 minutes by using equation of line. You need a rule chain that will take telemetry data of both devices, go over that data in chunks of 10 minutes, make equation of equation of line thru 2 points, and then use those equations to approximate the values of those two devices at the same time. Only then you will get semi-ok results.

If you really have some devices that report to you at few seconds periods, on event of new msg from device in root rule chain you can pull last value of other device and do your calculation. This will most certainly produce some saw like line on chart.

Upvotes: 0

Related Questions