General
Continuous data is coming from the ESP8266 device to the Blynk app. Values is shown on “Value display” or “Labeled Value” widget.
Problem
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.
Question
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.
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.
@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.
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.
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.
@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”.
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.