This section shows how to reference different kinds of data inside Tabs created in Tasker.

NOTES: when a value referenced below uses a # in it, it can be any channel number available for that value unless specified otherwise.

  1. Internal I/O

    Internal I/O
    din[#].state Returns the state, 0 or 1, for the digital input represented by the #.
    din[#].counter Returns the counter for the digital input represented by the #. Ranges from [0 - Integer.MAX]
    din[#].usagemeter Returns the usage meter for the digital input represented by the #. Ranges from [0 - Long.MAX]
    rout[#].state Returns the state, 0 or 1, for the relay output represented by the #.
    rout[#].usagemeter Returns the usage meter for the relay output represented by the #. Ranges from [0 - Long.MAX]
  2. Temperature Probe I/O

    Temperature Probe and Environmental Sensor NOTE: When 2 Temperature Probes are connected, for #, using 1 references the first probe and 2 references the second probe.
    temp[#].f or temp[#].tempf or temp[#].fahrenheit Returns the temperature in fahrenheit from the Temperature Probe.
    temp[#].c or temp[#].tempc or temp[#].celsius Returns the temperature in celsius from the Temperature Probe.
  3. Environmental Sensor I/O

    Environmental Sensor I/O NOTE: When 2 Environmental Sensors are connected, for #,using 1 references the first sensor and 2 references the second sensor.
    env[#].f or env[#].tempf or env[#].fahrenheit Returns the temperature in fahrenheit from the Environmental Sensor.
    env[#].c or env[#].tempc or env[#].celsius Returns the temperature in celsius from the Environmental Sensor.
    env[#].h or env[#].humidity Returns the humidity from the Environmental Sensor.
  4. Math Functions

    Random Number Generator
    math.random() or math.random(upper bound) or math.random(lower bound, upper bound) 0 to 1 default. Optionally an upper bound can be specified. This would give you a random value between 0 and the upper bound. Optionally a lower and upper bound can be specified. This would give you a random value between the lower bound and the upper bound.
    Absolute Value
    math.abs(number) Returns the absolute value of the number provided. The absolute value is the number's distance from 0.
    Exponents
    math.pow(number, number) Takes the first number, and puts it to the power of the second number.
    Square Root
    math.sqrt(number) Returns the square root of the number provided.
    Max
    math.max(number, number) Compares the two numbers, and returns the larger number.
    Min
    math.min(number, number) Compares the two numbers, and returns the smaller number.
    Round Down
    math.floor(number) Rounds the value down to the nearest whole number.
    Round up
    math.ceil(number) Rounds the value up to the nearest whole number.
    Round
    math.round(number) Rounds the value to the nearest whole number, whichever direction is closer
  5. Trigger References

    Trigger Name
    task.caller To be used in a task that was executed by a trigger. Returns the name of the trigger that executed this task.
    Trigger Execute Time
    trigger.time To be used in a task that was executed by a trigger. Returns a long representing the current time the trigger was executed to call said task.
    Trigger State
    trigger.state To be used in a task that was executed by an I/O trigger. Returns the state of the signal that activated the trigger that executed this task.
    Trigger Signal Name
    trigger.signalname To be used in a task that was executed by a trigger. Returns the name of the signal in the trigger that executed this task.
    Trigger Control Panel Switch
    trigger.controlpanelswitch To be used in a task that was executed by a control panel trigger. Returns the switch number used in the trigger that executed this task.
  6. Buffer

    Buffer NOTE: In order to use this from the Device Send action, after checking the "Listen for Response" checkbox, leave the variable name blank.
    (devicename)_buffer References the data that the defined device has received from a Device-Send Action when the "Listen for Response" checkbox is enabled. This will return you whatever data has been received from the device with that name given.
  7. Parse

    Parse
    double.parse(string) Parses a string as a double
    int.parse(string) Parses a string as an integer
  8. Validate Days of Week

    Validate Days of Week
    date.isday(montuewedthufrisatsun) Returns true or false if the current day abbreviations matches one of the abbreviations provided. For example, providing “montuewedthufri” would return true on a weekday where “satsun” would return true on the weekend.
  9. Validate Time of Day

    Validate Time of Day
    time.isbefore("HH:MM") Returns true or false if the current time of day is equal to or before the string representation. The string representation must be in 24 hour format. For example, is the current time before or equal to “14:00” would be true if the current time is 2pm or earlier.
    time.isafter("HH:MM") Returns true or false if the current time of day is equal to or after the string representation. The string representation must be in 24 hour format. For example, is the current time equal to or after “14:00” would be true if the current time is 2pm or later.
  10. date

    Current Date
    date.currentmillis() Returns a long representing the current time in milliseconds since Jan 1 1970.
  11. String Format

    String Format
    string.formatdecimal(value) or String.formatdecimal(value, format string) Returns a formatted string representation of the given value. A default of 2 decimal places is used if a format string is not provided.
    string.frombytes(bytes) Returns a formatted string representation from a given byte value. Can be used on (devicename)_buffer data from a Device-Send Action to convert the buffer data from bytes to a string.
  12. HexUtils

    HexUtils
    hexutils.bytestohex(bytes) Returns a formatted hex representation from a given byte value. Can be used on (devicename)_buffer data from a Device-Send Action to convert the buffer data from bytes to a hex.
  13. File

    File
    file(filename).size Returns the size of the file represented by the filename.
  14. Read Registry

    Read Registry
    registry.read(key) or Registry.read(key, default value) Reads a registry key. Optionally, a default value can be specified.
  15. Arrays

    Arrays NOTE: Currently this section only has fucntions for byte arrays. This is best used when getting a byte response using the Send Device Action.
    arrayutils.getshort(ref to byte array, offset) or arrayutils.getshort(ref to byte array, offset, swap endian) Returns a short that is represented by 2 bytes in the referenced array starting at the offset. The Short will be represented in little-endian byte default. To read the array with big-endian format you must specify true for the swap endian parameter.
    arrayutils.getint(ref to byte array, offset) or arrayutils.getint(ref to byte array, offset, swap endian) Returns a short that is represented by 2 bytes in the referenced array starting at the offset. The Int will be represented in little-endian byte default. To read the array with big-endian format you must specify true for the swap endian parameter.
    arrayutils.getlong(ref to byte array, offset) or arrayutils.getlong (ref to byte array, offset, swap endian) Returns a Long that is represented by 2 bytes in the referenced array starting at the offset. The Long will be represented in little-endian byte default. To read the array with big-endian format you must specify true for the swap endian parameter.
    arrayutils.getdouble(ref to byte array, offset) or arrayutils.getdouble(ref to byte array, offset, swap endian) Returns a Double that is represented by 2 bytes in the referenced array starting at the offset. The Double will be represented in little-endian byte default. To read the array with big-endian format you must specify true for the swap endian parameter.
  16. 4-20ma I/O

    4-20ma I/O NOTE: When 2 4-20ma modules are connected, for #, using 1 through 4 references the first modules inputs and using 5 through 8 reference the second modules inputs. As for outputs, using 1 or 2 refrence the first modules outputs and using 3 or 4 reference the second modules outputs.
    iin[#].desc Returns the string that represents the description for the # channel. This can be set in the WebUI for each channel.
    iin[#].raw Returns the raw value of the 4-20ma input. 0-65520.
    iin[#].scaled Returns the scaled value. 4-20ma. The minimum and maximum for the scaled range can be set in the WebUI for each channel.
    iin[#].units Returns the string that represents the units for the # channel. “ma” will be returned by default. This can be set in the WebUI for each channel.
    iout[#].desc Returns the string that represents the description for the # channel. This can be set in the WebUI for each channel.
    iout[#].raw Returns the raw value of the 4-20ma output. 0-65520.
    iout[#].scaled Returns the scaled value. 4-20ma. The minimum and maximum for the scaled range can be set in the WebUI for each channel.
    iout[#].units Returns the string that represents the units for the # channel. “ma” will be returned by default. This can be set in the WebUI for each channel.
  17. 10volt I/O

    10volt I/O NOTE: When 2 Ten Volt modules are connected, for #,using 1 through 4 references the first modules inputs and using 5 through 8 reference the second modules inputs. As for outputs, using 1 or 2 refrence the first modules outputs and using 3 or 4 reference the second modules outputs.
    vin[#].desc Returns the string that represents the description for the # channel. This can be set in the WebUI for each channel.
    vin[#].raw Returns the raw value of the 4-20ma input. 0-65520.
    vin[#].scaled Returns the scaled value. 4-20ma. The minimum and maximum for the scaled range can be set in the WebUI for each channel.
    vin[#].units Returns the string that represents the units for the # channel. “ma” will be returned by default. This can be set in the WebUI for each channel.
    vout[#].desc Returns the string that represents the description for the # channel. This can be set in the WebUI for each channel.
    vout[#].raw Returns the raw value of the 4-20ma output. 0-65520.
    vout[#].scaled Returns the scaled value. 4-20ma. The minimum and maximum for the scaled range can be set in the WebUI for each channel.
    vout[#].units Returns the string that represents the units for the # channel. “ma” will be returned by default. This can be set in the WebUI for each channel.
  18. Control Panel

    Control Panel
    fpled[#].state Returns true or false if the LED for the control panel channel is on or off.