Examples
Copy-paste examples for the MQTT-discovered Glucose sensor. See Configuration for the full sensor and attribute reference.
Attribution. The
sensor.gluco_hub_*_glucoseentity is published by the upstreamgluco-hub-rsbridge via MQTT discovery. This add-on wires HA Ingress and translates add-on options into the upstream config.
Quick reference
| Example | What you'll build |
|---|---|
| EX-01 | High/low glucose alert with mobile push notification |
| EX-02 | Lovelace gauge card with severity color bands |
| EX-03 | Multi-account LibreLink Up polling with per-source topics |
EX-01 — Alert automation
What it does
Fires a persistent notification and mobile push when glucose drops below 70 or rises above 180 mg/dL. Both triggers watch the sensor state — the current glucose reading in your configured unit.
Code
alias: Glucose high / low alert
description: >
Fires a persistent notification and mobile push when glucose
leaves the 70–180 mg/dL range.
trigger:
- platform: numeric_state
entity_id: sensor.gluco_hub_ha_glucose
below: 70
id: low
- platform: numeric_state
entity_id: sensor.gluco_hub_ha_glucose
above: 180
id: high
action:
- choose:
- conditions:
- condition: trigger
id: low
sequence:
- action: persistent_notification.create
data:
title: "Glucose low"
message: >
Glucose is {{ states('sensor.gluco_hub_ha_glucose') }}
— below 70.
- action: notify.mobile_app_your_phone
data:
title: "Low glucose"
message: >
{{ states('sensor.gluco_hub_ha_glucose') }} — below 70
- conditions:
- condition: trigger
id: high
sequence:
- action: persistent_notification.create
data:
title: "Glucose high"
message: >
Glucose is {{ states('sensor.gluco_hub_ha_glucose') }}
— above 180.
- action: notify.mobile_app_your_phone
data:
title: "High glucose"
message: >
{{ states('sensor.gluco_hub_ha_glucose') }} — above 180
mode: single
Notes
- Entity naming.
sensor.gluco_hub_ha_glucoseuses the defaultclient_id: ha. Replacehawith your configuredclient_idvalue — the entity name follows the patternsensor.gluco_hub_<client_id>_glucose. - Notify service. Replace
notify.mobile_app_your_phonewith your device's notify service (Settings → Devices & Services → Mobile App).
The sensor state is in your configured unit (mgdl by default; mmol if glucose_unit: mmol). If you use mmol/L, adjust the thresholds: below: 3.9 (low) and above: 10.0 (high) are the mmol/L equivalents.
- Trigger targets the state, not attributes. Do not use
attribute: mgdlin the trigger; the state already holds the value in your configured unit.
EX-02 — Dashboard gauge card
What it does
A Lovelace gauge card with color-coded severity bands. Add with the + Add card button — no HACS or custom card required.
Code
type: gauge
entity: sensor.gluco_hub_ha_glucose
name: Glucose
min: 40
max: 300
needle: true
severity:
green: 70
yellow: 180
red: 40
Notes
- Severity colors. The
severitymap sets the lower bound of each colored band. With the values above the gauge shows: red from 40 → 70, green from 70 → 180, yellow from 180 → 300. - Entity. Replace
sensor.gluco_hub_ha_glucoseusing the same<client_id>convention as in EX-01.
EX-03 — Multi-account configuration
What it does
Polls multiple LibreLink Up accounts simultaneously with per-source MQTT topics. See Multi-account setup for the full field reference.
Add-on options (llu_accounts)
llu_accounts:
- name: alex
email: alex@example.com
password: "hunter2"
region: EU
timezone: Europe/Berlin
- name: sam
email: sam@example.com
password: "correct-horse"
region: US
timezone: America/New_York
patient_id: "00000000-0000-0000-0000-000000000001"
Per-source topic topology
With llu_accounts the add-on sets per_source = true in the upstream config. Each source publishes to its own path:
| Source | Reading topic |
|---|---|
alex | gluco-hub/ha/alex/glucose |
sam | gluco-hub/ha/sam/glucose |
The shared <prefix>/glucose topic is not published in multi-account mode. Target the per-source entity in your automations and dashboard cards (e.g. sensor.gluco_hub_ha_alex_glucose).
Generated TOML
Generated by the add-on at startup and validated with gluco-hub check-config:
[poller]
interval_secs = 60
[http]
bind = "0.0.0.0:8080"
[state]
dir = "/data/state"
[sink.mqtt]
broker_host = "mqtt.local"
broker_port = 1883
username = "mosquitto"
password = "mqttpass"
topic_prefix = "gluco-hub/ha"
client_id = "ha"
discovery_enabled = true
per_source = true
[source.sources.alex]
email = "alex@example.com"
password = "hunter2"
region = "EU"
timezone = "Europe/Berlin"
[source.sources.sam]
email = "sam@example.com"
password = "correct-horse"
region = "US"
timezone = "America/New_York"
patient_id = "00000000-0000-0000-0000-000000000001"
Notes
The MQTT sink section uses broker_host / broker_port — these are the field names required by the gluco-hub config loader. Bare host / port keys are rejected by check-config with [CFG001] missing configuration field "sink.mqtt.broker_host".
- Multi-account limitations. The generated TOML hard-codes
client_id = "ha"and does not includediscovery_unit— so MQTT discovery always advertises mg/dL regardless of yourglucose_unitsetting. Theclient_idanddiscovery_unitsingle-account options are not carried into multi-account mode. - Validation. Validated against the pinned upstream image
ghcr.io/micschr0/gluco-hub:2026.621.0and returned configuration ok.
Not affiliated with Abbott Laboratories. Unofficial research and self-hosting tool. Use may violate Abbott's LibreLink Up Terms of Service. No warranty. Not for medical decisions, therapy, dosing, or diagnosis.
LibreLink, LibreView, FreeStyle Libre, Libre 2, and Libre 3 are trademarks of Abbott.