Is it possible to collect data from two devices and see results under one template

Hi all,

I am curious if it is possible to set up two devices, in my case ESP32s, collect data from each and send them to the same template in the IoT Blynk app? I’ve got one device working on one template. I could duplicate this, but I think a more elegant solution is to use a single template instead. If so, can you point me in the direction on how this could be done.

Cheers,
MathPi

I think you’re confusing the concepts of templates and devices.

I’m guessing that you mean you want to have one dashboard which displays the data from several devices?
If so, this isn’t how Blynk IoT is designed to be used. However, there are some workarounds. Automations can be used to send data from one device to another, but there are restrictions that mean this may not be suitable for your use-case.
Otherwise, data can be sent from one device to another using the REST API or Node-Red. More info here…

Different equipment on the same screen - #13 by PeteKnight

If this isn’t what you meant then you need to clarify your question.

Pete.

Hi Pete,

Ok I’ll try to explain in more detail. I might be mixing up some of the terminology… I have two ESP32 microcontrollers. Each of them collects data that I want to send to Blynk IoT 2.0 cloud, using Edgent library. I’ve managed to make two separate templates, connect one ESP32 to each, and see the results in their respective sections within the Blynk 2.0 IoT app.

However, this data from the two ESP32 make sense to compare together, so I want to bring the two data together. E.g. the data from ESP32_1 say data_1, and the data from ESP32_2 say data_2 on a single SuperChart.

I have tried to the following. Using a single template I got the BLYNK_TEMPLATE_ID and BLYNK_TEMPLATE_NAME. I’ve uploaded code to both ESP32 in which I used the same ID and NAME. For the first ESP32 I used virtual datastreams V0, V1 and V2. For the second ESP32 I used virtual datastreams V3, V4, and V5. Then in the App I added all the datastreams and added them to widgets. Sadly only the datastreams for the first ESP32 is working. I am not sure how to get all the data from all of the ESP32s in one place.

Hopefully, I am making more sense, and even more so what I am asking is possible with Blynk…

Cheers,
MathPi

Yes, that’s what I thought you meant.
See my previous reply for information on how to achieve this.

Pete.

1 Like

I’ll try it with automations. If this works, great but also a bit of a non-elegant solution. Especially when there are many ESP32 from which I want to gather data into one location.

I’ll come back to let you know if I got it working with two ESP32s.

Cheers,
MathPi

That’s because Blynk IoT isn’t meant to be used in the way you describe, hence the need for a workaround.

In that case you’d be better looking at Node-Red.
I currently receive/send data to almost 40 devices in a single Blynk device dashboard that way.

Pete.

1 Like

I got it working with automations. In this project I only have two nodes (or ESP32s), so this solution is fine. Thanks for pointing me towards Node-Red, will look into that for bigger projects.

I do have somewhat related questions here as they came up in this project:

  1. I see that sorting of devices is available as follows: A-Z, Z-A, First Added, Last Added. I’d like to custom sort to put the most important at top. Is this possible?

  2. Is it possible to hide devices? In this project I made a template/device for the second ESP32 which is only used to send the data to the first ESP32 via automations. I don’t actually want to see this one, and only the device that now has both sets of data.

  3. Is there a math widget? I’d like to do basic math operations on virtual datastreams, such as multiplication, addition, etc. Including multiple datastreams. E.g. take the absolute difference of two datastreams to create a new datasteam.

Cheers,
MathPi

  1. I don’t believe so at the moment, although it has been discussed before

  2. I don’t believe so at the moment. This is the first time I’ve seen this discussed.

  3. No. There was a very recent discussion about averaging values, but your suggestion goes much further than that. Why don’t you simply do this in code on the “primary” device before sending the data to dashboard? (or use Node-Red).

Here’s the “Averaging” topic…

Pete.

1 Like

Hi Pete,

Setting up the Device, in particular the SuperChart, I am seeing something that might be a bug. In the SuperChart I want to plot two datastreams. One is called “Volt Inside” and the other is called “Volt Outside”. It is the Volt Outside that is a forwarded value from the automations as you had suggested. When I set the x-axis to Live, I can see two datastreams, updating every second - all good. See the first image below. The Volt Outdoor datastream is in GREEN.

When I change the x-axis scaling to anything other than Live then the Volt Outside datastream completely disappears from the plot. I have made sure that this datastream has Is Raw = True. I’ve tried to delete this datastream and re-add it, but I cannot seem to get it to display to any other x-axis value (such as 15 mins, 30 mins, etc). See screenshot to show the issue below

Any thoughts on how I can fix this?

Cheers,
MathPi

No idea I’m afraid, I’ve never used automations.

What I would suggest is to send some better values, that utilise more of the min/max range of your superchart, so you can see the results better.

You also need to check how you’ve configured the settings for that datastream in your superchart.

Pete.

Ok, I’ll report this in another post as a potential bug. Thanks Pete

MathPi