Load Variables

Load Variables is a sub configuration in a Task or in a Schedule.
You can load any number of variables for the further operations.

Form View

load variables

  • Variable Name is used a internal reference for further operations. should be unique.
  • Add new variable click + icon
  • To delete a variable click - icon
  • By clicking edit icon of a value, can offer to select different data types.
YAML View

In YAML view, the data is encoded with base64 format to avoid syntax issues.

variables:
  water_level: >-
        {"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiBteXNlbnNvci4xLjEuVl9WT0xVTUUKc2VsZWN0b3I6IGN1cnJlbnQudmFsdWUK"}
  motor_status: >-
        {"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiBteXNlbnNvci4xMy4xLlZfU1RBVFVTCnNlbGVjdG9yOiBjdXJyZW50LnZhbHVlCg=="}

Data Types

Following data types are supported in Load Variables.

String

String is static type. It assigns the given value to that variable.

Resource By QuickID

Resource can be selected by their QuickID.

Form View

load variable by quick id

  • Select a Resource Type
  • enter the id of the resource, you will get a list of matching resources. Select a resource.
  • On the Selector field enter the exact path to get value. See Selector Guide
YAML View
type: resource_by_quick_id
data:
  resourceType: field
  quickId: tasmota.tasmota_0B8E60.Control.POWER
  selector: current.value

Resource By Labels

Resource can be selected by their Labels.

Form View

load variable by quick id

  • Select a Resource Type
  • enter key value of a label. enter as many labels you want.
  • On the Selector field enter the exact path to get value. See Selector Guide
YAML View
type: resource_by_labels
data:
  resourceType: field
  labels:
    location: hall
  selector: current.value

Selector

Selector is dot(.) separated path used to select a value on the given resource.
If the path not found returns empty value.
To make the path, you should know the supported keys on a resource.

To know more about supported keys of a resource,

  • go to that particular resource details page
  • click on edit
  • select the YAML View.

Some of the references

Resource - Field

  • current.value - current value
  • current.timestamp - current value received timestamp
  • noChangeSince - There is no change on the received value from this time
  • previous.value - previous value
  • previous.timestamp - previous value received timestamp

Resource - Gateway

  • state.status - status of the gateway. can be up, down, error, etc.,
  • enabled - enabled or disabled