Ubidots Community

Add context automatically via ubidots by variables values

Hi, is there any way that I can adding context to the variable value automatically in the Ubidots itself (not in the source code).

For example, the device already send the variable value, and i want to include some context to it eg: values >28 is inactive. From here i want to create a devices table listing all the active and inactive device.

Since the project is already deployed and changing the source code is not an option.

Greetings @syafiq I hope this message finds you well.

Certainly, you can append context data to an existing Dot on Ubidots. Here’s a step-by-step guide on how to achieve this:

  1. Set Up the Values Table Widget: Begin by creating a Values Table widget for the specific device and variable whose context you wish to modify.
  2. Add a Context Column: Aside from the Date and Values columns that you’d normally add to the Values Table widget, introduce a context column to the table and specify the key you’d like to display within the Context.
  3. Enable Editing: Turn on the Allow editing option for the context column. This will let you manually input the desired context.
  4. Input Context Manually: Now, you can directly enter the context information from the Widget.

For clarity, please refer to the GIF below:


Breakdown: In this example, I’m working with a device named tempDevice. I aim to append context data to its temperature variable, specifically:

{"status" : "hot" }

After setting up the Values Table widget with Date, Value, and Context columns, and enabling the Allow editing option for the Context column, I can manually define the content for the status key within the context.

Here’s the outcome:

It’s worth noting that the above method is manual. If you’re looking to automatically set the status to “hot” or “cold” based on the temperature value, for instance, setting status to hot if the temperature is above 50, you’d need to integrate this logic within the HTTP request when sending the data.

I hope this helps! Let me know if you have any further questions.

Best regards,

–Juan David