Ubidots Developer Guides
Help CenterAPI ReferenceData APICommunity
  • Welcome to our Dev Guides
  • ⚡️ Getting Started
    • What is Ubidots?
    • Devices, Variables, and Dots
    • Technical FAQs
    • Business FAQs
  • 🧩Integration Guides
    • Industrial IoT
      • Advantech
      • Amplified Engineering
      • AWS
      • Azimut
      • Balena
      • Bivocom
      • CESVA
      • Controllino
      • Digital Communications Technologies (DCT)
      • Everactive
      • Golioth
      • Kepware
      • Kunbus
      • Monnit
      • MultiTech
      • NCD.io
      • Node-RED
      • Omicron IoT
      • Red Lion
      • Robustel
      • Senquip
      • Sielco
      • Siemens
      • Strega
      • vNode
      • WAGO
      • Weintek
      • YuDash
    • Cellular
      • Blues Wireless
      • Digi International
      • Hologram
      • Monogoto
      • Particle
      • Quectel
      • Soracom
    • LoRaWAN
      • AonChip
      • Chirpstack
      • Decentlab
      • Helium
      • ioThings
      • LORIOT
      • Milesight
      • MOKOSmart
      • RAKwireless
      • Sagemcom
      • Seeed Studio
      • Senet
      • The Things Industries
        • The Things Stack
        • The Things Network
    • Sigfox
      • Digital Matter
      • McThings
      • Sigfox
      • Suntech
      • Thinxtra
      • UnaBiz
    • Satellite
      • Swarm
    • Dev Kits
      • Adafruit
      • Advantech
      • AloriumTech
      • Arduino
      • Blues Wireless
      • DFRobot
      • Dragino
      • Electric Imp
      • Espressif Systems
      • McThings
      • Microchip Technology
      • Onion
      • Particle
      • Pycom
      • RAKwireless
      • Raspberry Pi
      • Seeed Studio
      • Sodaq
      • STMicroelectronics
      • Texas Instruments
      • Thinxtra
      • Verse Technology
    • Weather
      • Weather Plugins
      • Ambient Weather
    • Tools
      • Gambit Communications
      • PubNub
  • 📊Dashboards & Widgets
    • HTML Canvas
      • 3rd party packages
      • Preload Dashboard data
      • Built-in library
        • Properties
        • Methods
        • Listening events
        • API
      • Examples
        • Basics
        • Create an LCD screen with the HTML Canvas
        • Interacting with dashboard data
        • Change header's custom style
        • Adding real time using Socket.IO
        • Delete Variable data from a Device
        • Delete Variable data from Groups or Types of Devices
        • Navigation through Dashboard
        • Using a React library
      • Code editor
        • HTML Tab
        • CSS Tab
        • JavaScript Tab
    • Custom UI
      • Paragraph
      • Input combo
        • Text
        • Numeric
        • Numeric with buttons
        • Date
        • Time
        • Toggle
        • Dropdown
        • Multiple selection dropdown
      • Button
    • Custom Style
      • Dashboards
      • Widgets
    • Line chart
    • Pages
      • Getting started
      • Development
      • API
        • Page creation
        • Publish
  • 🤖UbiFunctions
    • Getting Started
      • Creating an UbiFunction
      • Coding an UbiFunction
      • Testing an UbiFunction
      • Authentication
      • Execution Time
      • Logs
    • Runtimes
      • Python
      • NodeJS
      • Custom Runtimes
    • Invocation
      • Time-based Trigger
      • HTTPS
      • MQTT Publish
      • Ubidots Event
    • Advanced
      • Account Token
      • Execution time
      • Raw Functions
      • CORS Policy
      • Async Execution
      • DaaS (Decoder as a Service)
      • Developing and Managing UbiFunctions with Ubidots CLI
    • Examples
    • Specs and Limits
    • Storage
      • File Storage API
      • Mutiple files
  • 🧩Plugins
    • What is a plugin?
    • Public vs. Private
    • Public plugins
      • Cron
      • Webhook
    • Private Plugins
      • Cron
      • Webhook
      • Widget
      • Device
    • Plugins development
      • Getting started
      • Cron
      • Webhook
      • Widget
      • Device
      • view.xml
      • view_widget.xml
    • Plugins deployment
      • Cron and Webhook
      • Widget
      • Device
    • Using the plugins
      • Cron and Webhook
      • Widget
      • Device
  • 📈SYNTHETIC VARIABLES
    • Getting started
      • Creating synthetic variables
      • Synthetic Variables' editor
    • Expressions
      • Mathematical
      • Date range
      • Rolling
      • Special functions
    • Specs and limits
    • Examples
      • Mathematical
      • Date range
      • Rolling
      • Special functions
  • ⌨️Developer tools
    • Javascript SDK
      • Overview
      • Getting started
      • Ubidots class
        • Get methods
        • Filter methods
        • Ubidots objects
          • Entity object
          • Paginator
      • Examples
    • CLI
      • Overview
      • Installing
      • Usage
      • SDK for UbiFunctions
  • 🏗️Apps
    • App builder
      • Custom sidebar
Powered by GitBook
On this page
  • Timezone
  • Context
  • Timestamp
  • Device properties
  • Using device properties from device types synthetic variables editor

Was this helpful?

Export as PDF
  1. SYNTHETIC VARIABLES
  2. Getting started

Synthetic Variables' editor

PreviousCreating synthetic variablesNextExpressions

Last updated 5 months ago

Was this helpful?

Ubidots Synthetic Variables' editor allows you to write and configure the synthetic expression that will be computed.

In the bottom right corner of the editor, you'll see a message that indicates whether the expression is valid and can be computed or if there is an issue with the syntax that has to be corrected.

Timezone

The editor allows selecting a timezone to reference the exact variable's timestamps based on a particular place. This comes in handy when a variable has to be calculated for a client, user, or process that has a different timezone than the one of your location.

Context

Synthetic Variables allow context data handling, meaning you can take the context of the raw variable and use it in the synthetic expression (only if the context value is a number). Accessing it from the editor is straightforward: you just need to use the dot . operator over the variable, add context and then the context key identifier:

{YOUR_VARIABLE}.context.context.key

Timestamp

Similarly to accessing context data, timestamps can be accessed in synthetic variables using the dot . operator.

{YOUR_VARIABLE}.timestamp

Device properties

It's possible to use device properties in a synthetic variable's expression as long as the property has a floating number format. To access it from the synthetic editor, it's necessary to use any of the following syntax to retrieve the device object:

Using a device's ID:

{{device:<device_id>}}

Using a device's label:

{{device:<device_label>}}

Then, in order to access this device's properties, you need to use the dot operator . , like this:

{{device:<device>}}.properties

Here, you need to replace <device> with the id or label of the device that you wish to calculate the synthetic variable for.

Now you can retrieve any of the device's properties using the property's key, like this:

{{device:<id>}}.properties.<key>

Where <key> is the property's key.

For example, suppose that you need to retrieve the property uptime from a device whose ID is 65fb47fad809281764f8a350 . The following syntax accomplishes that:

{{device:65fb47fad809281764f8a350}}.properties.uptime

Note that in order to use the properties of the device in a synthetic variable, it's necessary to have a mathematical expression with another variable, which will determine the calculation of new data within the synthetic variable.

Using device properties from device types synthetic variables editor

It is also possible to create a synthetic variable across device types from within the synthetic variables editor at device types module using any of the following syntax:

{{device:self}}.properties.<key>

Here, you should only replace the property's key for the intended value. The keyword self is a placeholder that gets replaced by the actual device ID for all the devices contained in this device type.

📈