[SOLVED] Control widgets and input types

Just started having a play with the ‘for Education’ version of Ubidots, got it receiving some values, displaying some data, exporting CSVs etc and looks good.

But I was wondering about how it handles devices/projects where you would want to use Ubidots as a combined display and control dashboard to send control signals/value back to your IOT device.

I found the basic on/off and slider widget, ok for very basic control, but wasn’t sure how you’d achieve some of the following:
say you wanted to set a start/stop clock-time and needed to set hours/mins/seconds (like a clock face selector),
or select a start/stop dates from a calendar,
or display things like the radio button for 1 of X options,
accept and send typed values - numbers, text strings, config codes etc.

Is it possible to do any this with any of the standard widgets?

Or would you need to develop these widgets yourself in the HTML Canvas widget, and could you do the above in the education version?

Thanks.

Greetings, to send or retrieve non-numerical data to/from Ubidots you may use the variable’s context that is intended to manage string-type data, for more information refer to the articles below:

About your other two specific applications, you may implement them using the enterprise UbiFunctions module or the HTML Canvas which is available in both educational and industrial platforms.

All the best

I’ve investigated the HTML Canvas option and got a few basic functions working - so using some simple HTML to receive inputs - strings, option buttons, clock time selector, combined with a bit of Javascript borrowed from a Canvas example to push those values over to a variable.

Which leads onto a question about the Canvas widget because it seems like you could develop some quite useful, customised widgets - but is there anyway to save them to a library, so you can re-use them?

And is there any way to make them more re-useable, it looks like links to variables have to be hard-coded into the Javascript, what happens if you wanted to use that widget on a number of dashboards, or dashboards with different users - do you need to edit the code everytime? Or is there functionality in the enterprise version that you can’t see/don’t have in the education version that makes these more flexible?

Greetings, answering your questions:

is there anyway to save them to a library, so you can re-use them?

You can use external JS libraries if you expose them in the cloud, i.e the jquery library can be added through this public link https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js in the third party libraries section.

it looks like links to variables have to be hard-coded into the Javascript, what happens if you wanted to use that widget on a number of dashboards

To deploy several devices I advise you to use labels instead of ids, please refer to this article for more information:Automatically provision Devices and Variables with Ubidots API Labels | Ubidots Help Center

You may also use dashboard templates and device types to deploy several devices and dashboards in bulk in the industrial portal. The articles below may serve you as reference:

All the best

Thanks for the assistance.