My client wants to obtain many different business analytics from the data sent to Ubidots. One example is this:
- Of all the devices, show only devices with a “City” property = “Mesa”. I will then compute the total performance for the devices that were not filtered out and how much revenue each device made. Then display totals for all those devices. Most of these metrics are computed based on the devices variables
- Compute total performance/revenue for all devices within a particular city and display total performance for each month of the last year for those devices.
But in general, I want to make a powerful filter/search widget so they filter all of their devices and only display metrics for those devices.
I was thinking about using an HTML canvas widget since I can make them do anything I want with HTML, CSS and JS.
But in order to create such a device filter, I need to get a list of all devices and delete the ones not within the filter criteria. In the Ubidots REST API I do not see a “List Devices” API like you guys do for datasources and variables.
I can use the https://industrial.api.ubidots.com/api/v1.6/variables/ which will return a list of ALL the variables available to the user. I can then extract all the unique device ids and other parameters I need for the widget. But this seems like a LOT of data to GET every time the dashboard page loads.
If I have 1000 devices and each has 20 variables, that will be 20000 variables that API will return, plus variables can have lots of “context” data, etc. And if I have more than one widget that needs to do this type of filtering, each widget will have to get this data. Doesn’t scale vary well I don’t think.
I was wondering what Ubidots offers as far as being able to search and filter through all the devices and their data? To filter by device property for example. Then I can use that data to compute specific metrics and analytics. I was looking at something like ElasticSearch with Kibana which has a powerful and fast searching api for lots of data to get an idea of what I’m trying to do.
I was looking at device tables widget, but that is just a table that you can order by column. It does not give me the ability to remove devices by property and let me compute metrics from the filtered devices.
Any ideas on how to do these custom business metrics efficiently?