Aller au contenu

Modèle Jauge

Un modèle basé sur une plage pour surveiller des valeurs numériques. Il affiche la valeur actuelle avec son unité et indique les étiquettes min/max aux extrémités de la barre de progression. La progression est calculée automatiquement par le serveur.

Démonstration de Live Activity

Fields

FieldTypeDescription
templatestringRequired. Must be "gauge"
valuefloatRequired. Current value within the range
min_valuefloatRequired. Minimum value of the range
max_valuefloatRequired. Maximum value of the range. Must be greater than min_value
unitstringUnit label displayed after the value (e.g. "°C", "%", "rpm"). Max 32 characters
statestringStatus text (e.g. "Heating", "Ready")
iconstringSF Symbol name (e.g. "thermometer.medium") or MDI icon with mdi: prefix
subtitlestringSecondary descriptive text
accent_colorstringNamed color or hex. Default: orange
background_colorstringBackground color override
text_colorstringText color override
Info

The progress field is auto-calculated by the server from (value - min_value) / (max_value - min_value). You do not need to send it.

Example: Oven Preheating

Mise à jour de la jauge
{
  "state": "ongoing",
  "content": {
    "template": "gauge",
    "value": 125,
    "min_value": 0,
    "max_value": 250,
    "unit": "°C",
    "state": "Heating",
    "icon": "thermometer.medium",
    "accent_color": "orange"
  }
}

Example: Target Reached

Jauge terminée
{
  "state": "ended",
  "content": {
    "template": "gauge",
    "value": 250,
    "min_value": 0,
    "max_value": 250,
    "unit": "°C",
    "state": "Ready",
    "icon": "checkmark.circle.fill",
    "accent_color": "green"
  }
}

Typical Flow

  1. Start monitoring (ended -> ongoing): Set initial value, min/max range, and unit
  2. Update value (ongoing -> ongoing): Send updated value — server recalculates progress automatically
  3. Target reached (ongoing -> ended): Final value with completion state
💡 Astuce

The gauge template is ideal for any value that changes within a known range: temperature, humidity, battery level, disk usage, download speed, etc.

Buttons & tap targets

The circular Dynamic Island variant has no inline buttons; tap_action is the most useful field there. On Lock Screen surfaces, url_action and secondary_url_action render as buttons. See Tap actions for the action object shape.

Use Cases

  • Smart home — oven temperature, thermostat setpoint, humidity sensors
  • 3D printing — hotend/bed temperature reaching target
  • Infrastructure — CPU temperature, disk fill percentage, memory usage
  • IoT — tank level, battery charge, signal strength