We have 16 valves status (ON / OFF) to be displayed on dashboard.
We first used status widgets of Ubidots, but found following limitations:
- Ubidots status widgets are too large. It took full dashboard page for 16 valves!
- It shows device name with every valve.
- Even with “auto play” sometimes, the status was not refreshed smoothly.
Effectively, customer discarded above. And we moved to custom HTML widget…
We developed custom HTML widget. We have 16 valves with API labels: (valve01 to valve16).
Valve names are as per customer requirement.
- We use CSS to make smaller status LEDs (ON / OFF / UNKNOWN).
- We are reading each variable separately using GET API. We use device token and variable API labels. The variable API labels are stored in array in our javascript.
- But the process is too slow and we are making 16 calls to Ubidots. Each valve takes 3-5 seconds to get updated…
How can we read all 16 valves (last value) in single HTTP API call?
-
We don’t want to store variable ID in the HTML page.
-
We can only manage to store device ID (and list of valve API labels ) stored in CSS file.
Because, we will need to copy/paste dashboard for every new device we create for customer. -
We use “/values?page size=1” to get last value.
The valve status are updated every 1 minute by our IoT device. Customer wants “realtime” update.
Basically, single API call to get last value for list of variable API labels (not variable IDs)!
I can foresee following option: In API 2.0, we could see to get “all variable list”. In this case, we fetch all variables. Filter the variable IDs using API labels. And then make a last Value call using list of variable IDs that we want.
Please suggest most efficient and fast response option for same…
regards,
Sunand Mittal