Skip to content

User JSON TemperatureTextIndicator

roosit edited this page Oct 16, 2026 · 2 revisions

Temperature Text JSON

Back to list | Indicator page | Русский

Purpose

This page describes the JSON template of the temperatureText indicator for manual editing of .vttp.

Full Template

{
  "name": "com.velitask.plagin.official.temperatureText",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Temperature": {},
      "font": {"name":"Dialog","style":0,"size":48,"color":{"r":255,"g":255,"b":255,"a":255}},
      "textAlign": {"value":4},
      "measurement": {"system":{"value":0},"format":{"value":0},"temperature":{"value":0}},
      "textTemplate": {"template":"{currNum} {currUnit}","vars":{"currNum":"%.1f","currUnit":"%s","celsius":"%.1f"}}
    }
  }
}

Settings

Temperature

Selects the temperature sensor.

{
  "Temperature": {}
}
Field Values What it does
sourceId {"value": number} Identifier of the source in the project. Absent in the template.
sensorId {"value": number} Identifier of the sensor in the source. Absent in the template.

In a template, leave an empty object {}: the source and the sensor will be selected when the indicator is added to the project.

font

Changes the font, style, size and color of the text.

{
  "font": {"name":"Dialog","style":0,"size":48,"color":{"r":255,"g":255,"b":255,"a":255}}
}
Field Values What it does
name string, the font name; Dialog by default Font family.
style 0, 1, 2 Style: 0 plain, 1 bold, 2 italic.
size integer 1..999; 48 by default Font size; it is recalculated proportionally when the layer is scaled.
color object r, g, b, a Text color, see below.

color

Field Values What it does
r 0..255 Red channel.
g 0..255 Green channel.
b 0..255 Blue channel.
a 0..255 Transparency: 0 fully transparent, 255 opaque.

textAlign

Selects the position of the text inside the layer.

{
  "textAlign": {"value":4}
}
Field Values What it does
value integer 0..8; 4 by default Number of the text position.
value Text position
0 top left
1 top center
2 top right
3 vertically centered, left
4 centered (default)
5 vertically centered, right
6 bottom left
7 bottom center
8 bottom right

A value outside the range 0..8 is treated as 3 (vertically centered, left).

measurement

Selects the measurement system, the unit label format and the temperature scale.

{
  "measurement": {"system":{"value":0},"format":{"value":0},"temperature":{"value":0}}
}
Field Values What it does
system.value 0..4 Measurement system.
format.value 0..3 Unit label format.
temperature.value 0..2 Temperature scale.

Valid values:

Field Value Meaning
system.value 0 From global settings (default)
system.value 1 Metric
system.value 2 Imperial
system.value 3 Nautical
system.value 4 Mixed
format.value 0 Full: "Celsius", "Fahrenheit", "Kelvin" (default)
format.value 1 Normal: C, F, K
format.value 2 Short: C, F, K
format.value 3 Symbol: °C, °F, K
temperature.value 0 Celsius (default)
temperature.value 1 Fahrenheit
temperature.value 2 Kelvin

The temperature scale is taken into account when system.value is not 0; with 0 the scale is taken from the program's general unit settings. For a combination such as "Fahrenheit and symbol", set "system":{"value":4},"format":{"value":3},"temperature":{"value":1} (the mixed system does not substitute the scale automatically).

textTemplate

Sets the text of the current temperature: the converted value, its unit and the original value in Celsius.

{
  "textTemplate": {"template":"{currNum} {currUnit}","vars":{"currNum":"%.1f","currUnit":"%s","celsius":"%.1f"}}
}
Field Values What it does
template string The resulting text with variables in curly braces.
vars object Variable formats: the key is the variable name without braces, the value is the format.

Template variables

Variable Default format What it shows
{currNum} %.1f Current temperature in the selected scale (the value is already converted to the selected units).
{currUnit} %s Unit label for {currNum}: for example, "Celsius", C or °C depending on the unit format.
{celsius} %.1f Current temperature in degrees Celsius regardless of the selected scale.

The format is applied to a number: %.1f gives one decimal place, %.0f gives an integer. An integer-type format (%d) does not suit temperature: the variable will be replaced with an empty string.

The "Compact" skin replaces template with {currNum}{currUnit}; the vars fields stay the same.

Clone this wiki locally