Edge Impulse Route JSONata formatting

When using the Edge Impulse Route there are options to add “Sensors” there is a an option labelled “Json Expression” is this the place where one inputs JSONata reformatting?

Additionally what is the correct syntax to decode a field from the body when sending data from the Notecard.

For example the body of my request looks like this:
image

If I use the simple expression body.temp I get an error stating no value found.

On the other hand if i use this syntax {"body.temp" : temperature} I get this error
I get an error stating that the value cannot be marshalled into a float 64 type. Unfortunately I can only post one picture.

Is the second option on the right track it seems to be detecting some value?

Hey @peter!

Make sure to check out our documentation page on creating an Edge Impulse route if you haven’t already: Configuring an Edge Impulse Route - Blues Developers.

In general though, Edge Impulse expects an array of readings over time, so you’ll need to construct your Notes to look something like this instead:

{
  "req": "note.add",
  "file": "data.qo",
  "body": {
    "gas_resistance": [1, 2, 3],
    "humidity": [3, 2, 1],
    "pressure": [0, 2, 1],
    "temp": [0, 2, 1],
  }
}

With this format each entry in the body is a sensor that you’ll need to register on the route. For example one sensor could be:

  • Sensor: Temperature
  • Unit: C
  • JSON expression: temp

Let me know if that makes sense, and if you have any other questions or feedback.

Thanks,
TJ