I am testing out the new Blues Notehub integration, and I’m successfully passing several single values from Notehub to my Blynk datastreams. However I’m stuck on how to pass two individual doubles (longitude and latitude) to one datastream using the JSONata expression formatting. The JSONata transform will only allow one item named “location”, so I tried formatting it using JSON array syntax (which works when passing the values to the webhook.site for testing), but that does not seem to work for Blynk. The location datastream never receives anything, remaining at default 0.0, 0.0.
Can someone please shed some light on this? I assume I will have a similar problem when I try to send other datatypes with multiple values, like RGB data.
Attaching my Notehub route config with JSONata expression, and the received JSON data from the webhook.site test using the same JSONata expression.
Your payload seems to be correct. Please, make sure you are using the correct JSON key name (it corresponds to the datastream name) and your datastream type is “Location”.
If nothing helps, could you please attach your datastreams configuration?
@ironhalo2021 are you sure, that other data are populated properly? I’m not sure that this integration works properly with JSONata Expressions, to be honest.
Can you also try to wrap your transformed data with body property, such as:
Thanks for the reply, but I’m not sure I understand…
Why wouldn’t the integration work with JSONata transformed data? The JSONata output conforms to standard JSON formatting, and all of my other data is populating correctly using the JSONata transformed data. It is only this location datatype that is not populating.
How would you develop an integration with Blues without using the JSONata transform built into the Blues routing config? How else would you transform the data into the correct format for Blynk? (There are bound to be plenty of objects coming out Notehub that aren’t natively in exactly the right format for Blynk.) The JSONata expression is the only available method for doing this in between the Blues output and the Blynk input, no? Or is there some other method for transform in this scenario that I’m not aware of?
Surely the testing of this integration included passing a GPS location between Blues and Blynk? I can’t imagine an IoT use-case of an LTE/GPS enabled Notecard that would not involve processing location/GPS data. Seems like a fundamental piece of functionality for an official integration between the two platforms.
We’ve identified some issues connected with the locations, but it’s unlikely that they were affecting you.
Can you try sending the location from Blues without data transformation (select “No Transformation” in the Notehub Route configuration)?
Also, do you have any errors in your route logs on Notehub? You can find it by opening your device events and verifying the event status.
I am now syncing with no transformation, and the location data is still not being received (attaching raw JSON data).
So am I to infer from your answer that your integration is setup to automatically pull the location data from two of the default Notehub response members? Is it supposed to be using ‘best_lat’ and ‘best_lon’, or something else? Whatever the case, it is not working.
Sorry Munoon, but I feel like I am getting conflicting information at this point. Initially, I was sending the location information manually and it wasn’t working. First you said you weren’t sure this integration worked with the JSONata transform, and you had me revert back to sending default system-generated JSON…but now you’re saying you have to send the location information manually. Unless I’m mistaken, the transform is the only way to manually send specific information. Unless you mean something else by “pass location from your device manually”?
We’ve been going back on forth on this for a few days now and I fee like we are no closer to finding the problem here. Is it possible to escalate this to someone who is directly involved in the integration project so we can get this remedied ASAP? Our entire development project is on hold until we can verify this integration as a viable path forward, and without location data it is not. Both Blues and Blynk are advertising this online as a viable commercial IoT integration, and as it stands now, it’s not working correctly.
Munoon, thanks for continuing to investigate this. In further testing, I can confirm that:
The JSONata expression does not seem to be working at all, for any datastreams. It only appears to work for our sensor data because the integration is apparently continuing to send the sensor data via the sensors.qo file in the background even when JSONata was selected as the data payload (something that would be helpful to clarify in the integration tutorial to avoid confusion).
Manually adding location values to a note file with {“req”:“note.add”,“body”:{“location”:[1.11,2.22]}} does work as you suggested.
If this is truly the only way to send location data, that’s unfortunate. It’s inefficient for the MCU to have to fetch this data from the Notecard, then send it back to the Notecard for transmission. Especially since the “best_lat” and “best_lon” event attributes are already being transmitted by the Notecard with every sync by default. This would be creating redundant processing, communication and storage. The simplest and most efficient method by far would be enabling the JSONata Expression to be able to send the following: