Mobile dashboards

this is not about the device side, this is about the mobile app side

so I have a water tank monitoring system
it needs some parameters to be configured at the firmware side on power on
and I synchronize those at startup, which should call their appropriate BYLNK_WRITE() functions

but how do I set them in the app at the device location, another ‘dashboard’
with a pushbutton to sync somehow? I can hard code them , but don’t want to
particularly the alert settings…

then display is a different dashboard to visualize the values posted…??

on my prior instance of this,(in 2018!) I created a web based graph and displayed this realtime on a wall , so I didn’t use the blynk web UI at all and never looked at the mobile side… the alerts were enough

this is for a blind user who cannot ‘see’ the screen, but wants alerts and critical notices if the tank gets low…

I have added events for those…

I created a dashboard on the web ui, how do I see it at the mobile?
I don’t want to teach each user how to create their own dashboard,
to get A dashboard

I really don’t understand your question. Maybe is you asked a specific question about one parameter, rather than talking in general terms, then it would be easier to understand your questions.

You don’t. There is no link between the web dashboard and mobile app dashboard - other than the values of the datastreams.
If you want a mobile app dashboard then you create that in the mobile app.

Pete.

ok, thx…

I found where to create the mobile dashboard.
I don’t see any data altho I have a couple hundred reports

You’ll need to be much more specific if you want assistance.

Pete.

finally see some data… couple questions on templates

i have a numeric virtual pin, set at 0-20, default 10
attach a device on that

now, it turns out I need to change the config of that pin.
edit template, change to 10-50, default 25. save
the device doesn’t get any update

if I delete the device and add it again in the mobile app it gets the new values.

so this solution has two parts

configuration

   set tank height/width, range for sensor to full state water level,   
   maybe the esp32 pins the sensor is attached to.
   important water levels for alerts

reporting

    water levels over time,  and events
    base on the above config

I don’t see a way centrally manage the config info the hardware will need
and I don’t want to…
but I don’t see a way to push the config screen to them, they shouldn’t have control of the format of this page… only the data on it. most importantly the alert level settings…

I want to

ship the box, and sensors and instructions
mount box, mount water level sensor,
plug sensor and power into  controller box

customer

open blynk app, find device, add to local wifi
fill out config page, info above
add email address for alerts.

they should be able to get back to config somehow to change the settings.
and they should be pulled by my code, which does Blynk.syncAll();
on every sensor reading cycle (every 5 minutes)… but I don’t see any callbacks…
to the BLYNK_WRITE methods

then they can see output/charts… on some other page, not config

if there are firmware updates, I can add that and it works.

I have esp8266 and esp32 devices, looks like I need to duplicate the template and change the device… AND that means different template ID/name… in the source…

also, If the template says esp8266, why was the ESP32 device allowed to onboard there??

I’m afraid your writing style is a little to random, and vague for me, but I’ll try to make as much sense as I can of what you’ve written and address some issues you’ve raised…

Easy one first…

The hardware type in the template is a memo field only. It has no functionality.

You shouldn’t need to do that.

First of all, using Blynk.syncAll() is a bit of a sledgehammer to crack a nut. It ONLY works for datastreams where you’ve enabled the “Sync with latest server value every time device connects to the cloud” option.

Instead of using Blynk.syncAll() you should use Blynk.syncVirtual(vPin).

But, the ONLY place where you should be using these sync commands is in the BLYNK_CONNECTED() function. This function is called automatically when the device connects or re-connects to the Blynk server. You use the sync commands to force the server to send the device the latest values for each virtual pin. This triggers the corresponding BLYNK_WRITE (vPin) callback functions.
The purpose for the sync commands is to obtain the current values of data input widgets on your dashboards. Say for example you gave a switch widget attached to pin V1. While the device is offline, the user could change the status of that switch widget. When the device starts up and you call the sync command, the server will tell your device what that widget’s current status is - you are synchronising your device with your dashboard’s control widget.

Any subsequent changes to the widget when the device is online will automatically trigger the relevant BLYNK_WRITE(vPin) callback.

If you want to regularly sent sensor values from your hardware device to your dashboard (via the server of course) then your device code should be using a BlynkTimer to facilitate this.

Pete.

thanks…

template device type… got it

this code was written originally in 2018, and used SyncVirtual as appropriate, in the BLYNK_CONNECTED callback

at that time, there wasn’t a setting for sync to server in a datastream.

and we found that we were connected for months at a time, and if the settings were synced only at connect, we wouldn’t get them, so did syncAll on each cycle to insure we got them… now with the server side filter of which virtual pin could be synched, syncAll vs syncVirtual (pin1, pin2, …) are functionally the same

but I changed to syncVirtual for only the pins defined as outbound values.

but might change back as this insulates the code from design changes if there are other pins added (as there are ifdefs around 2 other flow rate sensors at the moment)

I just changed the datastreams for outbound values to sync with server,
but the devices still connected didn’t get any update on syncAll() (done every 5 mins now) both devices have been thru 3 reporting cycles, so should have picked up the values 3 times… , unless syncAll also filters to only changed values sent

and I use BlynkTimer as my timer control.

I’ve been using Blynk since 2017 and the ability to sync a single virtual pin has existed since then.

That’s the whole point of synchronisation - to synchronise your hardware with the server when your device starts-up and doesn’t know the server-side values.
If you are using the app or web dashboard to update values (as you said you are) then every update will trigger the relevant BLYNK_WRITE(vPin) callback without the need to use the Blynk.sync functionality. If this isn’t happening then either you’ve done something incorrectly in your code, or the scenario isn’t what you’ve described.

How are your datastreams configured? Post screenshots.

I think that talking in vague or hypothetical terms, you need to share far more information if you want to progress whatever issue it is that you are experiencing.

Pete.

maybe written in 2017, before I started using git, so don’t have a history…
house was bought feb 2017, sold august 2019… so, sometime in there

here is one virtual pin


we get the values on connect, BUT they could be changed AFTER connect,
WHILE RUNNING , this is a 24x7x365 day monitor application, NEVER intend to reconnect (altho it will happen due to external events)

pin handler code

// Blynk Virtual Pin Handlers

BLYNK_WRITE(V10) // Tank Diameter (inches, converted to cm)
{
    PhysicalTankDiameter = (int)(param.asInt() * 2.54);
    printmsg("V10 (diameter) =" + String(PhysicalTankDiameter) + " cm, input=" + String(param.asInt()) + " inches", true);
    Area1 = PI * ((PhysicalTankDiameter / 2) * (PhysicalTankDiameter / 2));
    AlertCounter = 1;
    CriticalAlertCounter = 1;
}

BLYNK_WRITE(V11) // Tank Depth (inches, converted to cm)
{
    PhysicalTankDepth = (int)(param.asInt() * 2.54);
    MAX_DISTANCE = PhysicalTankDepth + max(minDistance , DistanceFromSensorToFullLevel);
    printmsg("V11 (depth) =" + String(PhysicalTankDepth) + " cm, input=" + String(param.asInt()) + " inches", true);
    AlertCounter = 1;
    CriticalAlertCounter = 1;
}

BLYNK_WRITE(V12) // distance from sensor to water full level
{
  DistanceFromSensorToFullLevel = (int)(param.asInt() * 2.54);
  MAX_DISTANCE = PhysicalTankDepth + max(minDistance , DistanceFromSensorToFullLevel);
  printmsg("V12 (minDistance) =" + String(minDistance) + " cm, input=" + String(param.asInt()) + " inches " + " max=" + String(MAX_DISTANCE) +" sensorDistance=" + String(DistanceFromSensorToFullLevel), true);
}

BLYNK_WRITE(V13) // Low Water Warning Percentage
{
    LowWaterPercent = param.asInt();
    printmsg("V13 low water warning set to " + String(LowWaterPercent) + "%", true);
    AlertCounter = 1;
}

BLYNK_WRITE(V14) // Critical Water Alarm Percentage
{
    CriticalWaterPercent = param.asInt();
    printmsg("V14 critical water alarm set to " + String(CriticalWaterPercent) + "%", true);
    CriticalAlertCounter = 1;
}

// Sync virtual pins on connection
BLYNK_CONNECTED()
{
    printmsg("Connected to Blynk Cloud", true);
// 1-8 are send to server only
    Blynk.syncVirtual(/*V1,V2,V3,V7, V8,Z*/ V10, V11, V12, V13, V14);
}

beginning of the timer routine

void sendSensorReadings()
{

  // Send data to Blynk Cloud
  if (Blynk.connected())
  {
    // check for config changes
    Blynk.syncVirtual(/*V1,V2,V3,V7, V8,Z*/ V10, V11, V12, V13, V14);
  }
...

setup

  
  edgentTimer.setInterval(Period, sendSensorReadings);

If the virtual datastream values are changed by the mobile app or the web dashboard then the corresponding BLYNK_WRITE(vPin) callback function will be triggered. This is one of the basic functional concepts of Blynk and this is what gives Blynk its power.

You previously stated…

You’ve not said which datastreams you’ve changed. You’ve provided a screenshot of V11, and posted the code relating to pins V10-V14, but you’ve not said whether V11 is one of the pins you’ve changed.
Also, you’ve said that these changed pins don’t respond to a syncAll() command, but the code you posted doesn’t contain a syncAll() command.

Can you not see how this level of vagueness on your part, along with code snippets rather than a full sketch, make it impossible to understand your issue or suggest solutions?

Pete.

thanks… I’ll continue to work on this on my own

I am moderator on a bunch of forums and I would never treat my users this way.

Good luck!

Pete.

I have tried to understand what you have posted but to be honest, I don’t get what you are aiming at. At least it looks to me as if you have a very personal view of what Blynk is and how it should operate and that view does not necessarily concurs with the reality of Blynk.

If you want to use Blynk, then you will have to go through the documentation and model your needs according to the capabilities of Blynk.

If I were a moderator of this forum, I would have been lost already very early in this discussion.

3 Likes