Skip to content

TemperatureTextIndicator JSON

roosit edited this page May 22, 2026 · 2 revisions

TemperatureTextIndicator JSON

Up | Code | Русский

Purpose

This page describes the persisted format of the temperatureText indicator in a project, Mixel, and templates. For user-facing manual .vttp instructions, see Temperature Text JSON.

Two save modes

The indicator is saved in two modes:

  • toJSON(false) — real Mixel state: contains selected source/sensor, current property values, layer size, and layer position.
  • toJSON(true) — template state: contains only template values that can be moved between projects. For sensor properties, source/sensor are usually not fixed.

Common indicator wrapper

The layer identifier is built from plugin uid and indicator name:

{
  "name": "com.velitask.plagin.official.temperatureText",
  "data": {
    "properties": {}
  }
}

Stable parts:

Part Value
plugin uid com.velitask.plagin.official
indicator name temperatureText

Real mixel state

In a real Mixel, runtime stores layer geometry near properties: size, position, and parent binding. Exact State payload shape depends on the current runtime, so the structure below is intentionally shortened.

{
  "name": "com.velitask.plagin.official.temperatureText",
  "data": {
    "size": { "...": "layer size state" },
    "positionInParent": { "...": "layer position state" },
    "properties": {
      "Temperature": {
        "sourceId": { "...": "source id state" },
        "sensorId": { "...": "sensor id state" }
      },
      "font": { "...": "font and color state" },
      "textAlign": { "...": "alignment state" },
      "measurement": { "...": "temperature unit state" },
      "textTemplate": { "...": "template state" }
    }
  }
}

Template state

Template state uses maket, and the sensor property may stay empty so runtime can pick a suitable temperature sensor when the indicator is added to a project.

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

Properties

JSON key Java property SDK type User meaning Default
Temperature mTemperature TemperatureAtomProperty Selected temperature sensor. Empty selection in templates.
font mText FontColorProperty Text font and color. Dialog, 48, white.
textAlign mTextAlign TextAlignProperty Text alignment inside the layer. Property default.
measurement mUnits MeasurementProperty Measurement system, temperature scale, and unit format. Inherit, normal, Celsius.
textTemplate mTemplate TextTemplateProperty Text template with temperature variables. {currNum} {currUnit}.

Examples

Compact template state:

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

Here system.value = 4 switches measurement to mixed mode, temperature.value = 1 selects Fahrenheit, and format.value = 3 uses the symbol label (°F).

Compatibility

  • Plagin.UID (com.velitask.plagin.official) must not change without saved-project migration.
  • Indicator.getName() (temperatureText) must not change without migration.
  • Property names (Temperature, font, textAlign, measurement, textTemplate) must not be renamed without migration.
  • Property order mostly affects UI, while persisted state is loaded by names; renaming is more dangerous than reordering.

Clone this wiki locally