Read Metadata values of Location or Text

I have copied this code from documentation-

I followed the steps to read the metadatas-
I was able to read numeric but unable to read string or location metadata values.
Thank you

Any idea on this, how to read the meta data ?

Please don’t keep tagging people, especially the Blynk staff, in post like this.

Have you tried the example in the documentation?
What results did you get?


Please show your code and metadata setup.

Example code from documentations only.

That’s not very helpful!


//// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID           "TMPLxxxxxx"
#define BLYNK_DEVICE_NAME           "Device"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h

#include "BlynkEdgent.h"

void setup()


void loop() {;
    String field = param[0].asStr();
    if (field == "Location") {
        String value = param[1].asStr();

        // Do something with Metadata value
  // Send requests for different metadata
  Blynk.sendInternal("meta", "get", "Location");
//  Blynk.sendInternal("meta", "get", "Device Model");

Where is your screenshot showing the metadata you have set-up?


Here is it.

I even tried changing meta name to location1 . Still not working

It seems that you have a Location metadata type called Location, and have added a Coordinates metadata type also called Location, which has no coordinate values in it.

Did you add some coordinates, and did you change your sketch to reflect the new name?


Yes sir tried

if not possible,
tell m how t read it using http api

@VIGHNESHNS2008 do you have some data assigned to the location metafield of the specific device?Do you get some response at all? Or you get empty response?

yes assigned value.

empty response

@Dmitriy I’ve been doing a bit of testing, and ther seems to be an issue with coordinates…

Metadata setup:

Map Coordinates is populated as follows:

Test code…

  // Send requests for different metadata
  Blynk.sendInternal("meta", "get", "Board Type");
  Blynk.sendInternal("meta", "get", "Device Location");
  Blynk.sendInternal("meta", "get", "Map Coordinates");  

    String field = param[0].asStr();
    if (field == "Board Type")
      String value = param[1].asStr();
      Serial.print("Board Type = ");
    if (field == "Device Location")
      String value = param[1].asStr();      
      Serial.print("Device Loaction = ");

    if (field == "Map Coordinates")
      String value = param[1].asStr();      
      Serial.print("Map Coordinates = ");

Serial Output…

[2652] Connecting to
[3529] Certificate OK
[3540] Ready (ping: 10ms).

Board Type = ESP32 DevBoard
Device Loaction = The desk in my office
Map Coordinates = 

Note that Map Coordinates is blank (or 0.00 if I change to Float).

I also tried param[2].asStr() and param[3].asStr() in the hope that Latitude and Longitude were hidden in there, but no joy.

Also, when you view the Device metadata, the field names are capitalised…


which could get confusing.


I tried writing values. Wks fine. but reading is a problem

Same Issue for Me

Yes. You’re right. Not all fields yet supported. I forgot about that. I’ll fix this.

1 Like

And… has that unexpeted error fixed?

@VIGHNESHNS2008 location meta reading should work now. Please check.

Yes. Do you still see any errors?