Remove old data from the "Value display" or "Labeled Value" widget

Continuous data is coming from the ESP8266 device to the Blynk app. Values is shown on “Value display” or “Labeled Value” widget.

Due several reasons (e.g. power off or no wifi connection, bug in ESP code), there can be a gap when data is not coming from the ESP8266 device. At the moment “Value display” or “Labeled Value” widget is showing latest value forever.

How to change latest value on “Value display” or “Labeled Value” widget, to “–” or “data not available” after specified time e.g. no new value arrived last 1h.
I’m trying to avoid misunderstanding on user side and get a rid of old data on the widget.

@lum1kasa if the ESP is without power then I don’t think there is anyway of updating the app. What you could do is add a clock or simple millis() display. If it’s not updating then you can assume the rest of the data in the app is stale.

How to implement this in a way that “Value display” or “Labeled Value” widget will not show data at all if data is old?

I thought I answered that question, it’s not possible.
Another technique I have used is to send the data and then immediately send the “-”.
If the interval between each data transmission is long enough then you are more likely to see a “-” in the app than the data when the ESP loses power. Not ideal but basically if you are only seeing “-” and no data quickly flashing up then the ESP is not running.

The best solution is to fix your problem.

A decent sketch will run forever with just a minor reset from time to time.

We have 2 ISP’s, a USP and multiple cloud based servers for our mission critical tasks.

Very good question actually. Someday we had discussed that with @Pavel. This requires new widget from our side.

@lum1kasa I haven’t tested it… but perhaps you can use Eventor, and it’s timer to periodically update any displays you want with a 0 or N/A value. Then as the devices are online they will override that null value… much like @Costas idea, but handled on the App itself.

To get a 'reset" more frequently than once a day, you would need to create multiple duplicate events at differing times.

@Dmitriy does Eventor work without the heartbeat from an ESP (or Arduino)?

@Costas what do you mean?

@Dmitriy if ESP is “dead” i.e. without power would Eventor still continue to run?

@Costas yes. And you may get state via SYNC

1 Like

Yes… it verx!! :stuck_out_tongue:

Click this one to see whole screen… first three are examples of hourly display reset, the 4th is my realtime test …

This particular project as been offline for awhile (the sketch is not even loaded into the device)

But as long as the project is Active (showing the square stop button) then it will work as required.


I’m not convinced.

You are setting an Event time of 12:00 to write “N/A” to a Virtual Display but the OP doesn’t know when his ESP is going to be offline. You would need hundreds or thousands of Events to cover the OP’s requirement, no?

This is a workaround… 24 events would cover each hour of a day, every day, and you can adjust multiple vPins in each event.

Yes, creating 24+ events is a bit of a pain… but once done… it is done.

@Dmitriy If there was a way of quickly copying an event for later “personalised” editing (e.g. time), use cases of many similar events would go much quicker.

I think millis() and the fact that the app tells you when it’s offline is adequate for most Blynkers.

Useful to know Eventor runs without an ESP but I don’t consider it very appropriate for this particular issue.

Well, I am glad the idea came up… as I am going to use it as a great way of periodically clearing some of my displays that sometimes retain unwanted infrequently used data (NOTE - can also relate to issues when the device is STILL online) … without doubling up on my required Blynk.virtualWrites(). Until the developers come up with an alternative.



I hope you could solve this in Blynk app side, because so many things can go wrong before value endup to the Blynk app.

Example of practical problem. We have cold winter here, I use IOT devices to measure outside temperature. By this temperature data we make decisions: “What to wear before going to school / work”, “should I turn car preheating on and when” etc. Now value on "Value display” or “Labeled Value” widget can be “bogus”, hours / several days old and user is making wrong decision by this data.

As a technical background user I can understand why / when value can be bogus, but “normal” not technical user can’t, they think if there is a value it is true data.

1 Like

@lum1kasa I think your last post is reasonable but it shouldn’t be difficult to educate a user that a number in red towards the top right of the screen means “don’t trust the data you see in the app because the MCU failed”.

@Costas “number in red” method.
If you have several IOT devices connected to Blynk app, how to distinguish reliable and not reliable data?

1 Like

From your cold winter example I wouldn’t be using several IOT devices, just the one.

For projects that have multiple IOT devices I would probably put each one on a separate TAB (Android now allows lots of TABS). Each IOT device sends an ID and an incrementing number at say 3 second intervals.

So Garage-0003, Garage-0004, Kitchen-0008, Kitchen-0009, Bedroom-0015, Bedroom-0016.

If the numbers are not increasing or looping back to zero I know the data from these devices is stale.