Blynk <-> Notehub Integration - Can't receive Location coordinates on Blynk datastream

We’re testing out the official Notehub<->Blynk integration and we are having problems relaying location data. All of the other datastreams are populating just fine, it’s only the location datastream that will not receive any coordinates.

I have a support thread in progress with Blynk support already, as I suspect the problem is on their end. They don’t seem to have it figured out yet however, so I thought I would mention it here in case someone on the Notehub team might be able to lend a hand in some way.

All of the details (and a few replies from Blynk support) are already in this thread: Blues Notehub Integration - JSON format for sending 2 values (long,lat) to GPS datastream? - #6 by ironhalo2021 - Need Help With My Project - Blynk Community

Please let me know if you might have a clue what’s going on, or if you need more info to help troubleshoot it. I’m really hoping there is an easy solution to this, as we bought into the Blues ecosystem specifically because of the advertised Blynk integration. Unfortunately, without location data, the integration is a non-starter for us.

Thanks in advance!

1 Like

UPDATE: We made a little progress with Blynk support on this, but only enough to know that…

  1. The JSONata transform option definitely does not work for sending data to Blynk. (It appeared as though it was working initially, but only because the integration is apparently still sending the sensor data via sensors.qo in the background even when JSONata was selected as the payload.) Which makes me wonder why was the JSONata Expression option was not put in place in the integration? Having a transform method in between Notehub and Blynk would be incredibly useful, adding an option for augmenting data that doesn’t require MCU code.

  2. The only way to get location data to Blynk is to have the MCU manually add it to a note file, such as: {“req”:“note.add”,“body”:{“location”: [1.11, 2.22]}}. If this is the case, how would we send the “best_lon” and “best_lat” data from the event API? And even if we can access those attributes, it seems rather inefficient for the MCU to be fetching those and feeding them back to the Notecard when those event attributes are already being sent with each sync by default. It would be really simple to alleviate the MCU from having to deal with location at all by using the following JSONata expression, but again the JSONata transform doesn’t seem to be working unfortunately…

{
"body": {
   "location": [best_lon, best_lat]
  }
}

Is this something that can be remedied?

Hey @josh77,

Sorry you ran into issues here. I’ll start with the good news: you don’t have to replicate the location logic in your MCU as JSONata has the ability to append the best_lat and best_lon to the body of your Notes. See Using JSONata to Transform JSON - Blues Developers.

I just tried this JSONata out and it appended a location to the body in my webhook.site test route as expected.

(
    $merge([$, {"body": $merge([body, { 
        "location": [best_lat, best_lon]
    }])}])
)

However, I did verify that for whatever strange reason these JSONata adjustments do not seem to be making it to Blynk specifically—which is… odd. I’m looking into it. Just wanted to let you know we saw this and appreciate the thorough report.

TJ

Confirmed, I am having great success getting the location data to webhook.site as well using JSONata. But yes, JSONata to Blynk is definitely the issue.

Thanks for confirming and looking into this TJ!