Scope Route execution confusion

The confusion is about limiting the route execution to a single Notecard.

I was about to set up a few General HTTP/HTTPS Request/Response routes to Ubidots and just when I thought everything was clear, I got confused about the scope of the route execution.

My understanding of the documentation is that the scope of the route execution can be a single device, a fleet, or an entire project.

A Route is an external API, or Server location, where Notes will be forwarded for a Device or Fleet upon receipt.
Routes are defined in Notehub for a Project, and can target a single Fleet or all devices in a Project.

In the General HTTP/HTTPS Request/Response configuration there is a filter for selecting a fleet or using the route for the entire project:

I couldn’t figure out, however, how to limit the scope of a route to a single device.

Following the Route Tutorial Ubidots specific part I was under the impression that substituting the [device label] in the Ubidots endpoint URL https://industrial.api.ubidots.com/api/v1.6/devices/[device lable]/
with the Notecard’s Product SN or DeviceUID, the scope of the execution will be automatically limited to that particular device. Nevertheless, that’s not the case.

Setting up multiple routes with multiple [device label_1] ; [device label_2] ...etc, successfully initialize the corresponding device_1, device_2, etc. in the Ubidots platform, but all devices display all the variables in the Fleet or Project.
If multiple Notecards send temperature and humidity information for example, than all devices in Ubidots will display the same temperature and humidity values that were extracted from the last event in the fleet or project. When event_1 captures device_1, than all devices in Ubidots will display temp_1 and humidity_1. When event_2 captures device_2, than all devices in Ubidots will display temp_2 and humidity_2 … and so forth.

So, the brief question is, how can I limit the route execution to one particular Notecard ?

Thanks

Hi @LBBD,

In order to accomplish this I would recommend adding that single device to a new fleet, then choosing the fleet in the route creation UI. I’ll add a feature request to allow for choosing individual devices and fix the docs too!

Thanks,
Rob

@RobLauer Thanks for your quick reply and the workaround.

Speaking of feature requests, would you also consider looking into the issue of routing many devices to Ubidots?

There is an open discussion about it where we were hoping @dsepulvedara to chime in but it might need a direct communication between your companies.

Until then, individual routes would provide a temporary solution.

Thank you.

Hello @LBBD

You’re right about the tutorial, it sort of suggest that when manually replacing the {DEVICE_LABEL} for a fixed Notecard’s ID, then the Route will only work for said card. As you’ve pointed out, this is not the case.

In the tutorial, it is shown like that as an example only, however, you should actually use the URL field like follows:

https://industrial.api.ubidots.com/api/v1.6/devices/[device]

This will dynamically replace [device] by your Notecard’s ID, and will allow you to correctly forward data from your devices in a fleet into Ubidots.

Does it make sense?

Last not least, I agree with @RobLauer. For the time being, simply create a independent project if you want a device with a route of its own.

Best,

–David

1 Like