5d5e51c2f670a69c4acab48a55be2946ba7aee39
Home Assistant - ESP Home - LilyGo Diabetes Display
A custom, open-source continuous glucose monitor (CGM) desktop display powered by a LilyGO T-Display-S3 running ESPHome, integrated directly with Home Assistant.
Features
- Real-Time Glucose Display: Shows current blood glucose readings (in mmol/L) with trend arrows.
- Data Freshness Warning: Automatically detects if CGM data becomes stale and displays an "OLD" warning with an animated alert icon.
- Clock & Seconds Counter: Displays current local time synchronized via Home Assistant.
Hardware Requirements
- LilyGO T-Display-S3 ESP32-S3 Display Board
- USB-C cable for power and flashing
Home Assistant Prerequisites
- A working Home Assistant instance with the ESPHome integration installed.
- A CGM data source feeding into Home Assistant (e.g., Nightscout, xDrip+, or LibreLinkUp integration).
- The following Home Assistant entities:
- Numeric sensor for your blood glucose levels (
sensor.blood_sugar_mmol) - Text/attribute sensor supplying the MDI trend icon (
sensor.blood_sugar_trend_icon) - Binary sensor that evaluates to
onwhen data is fresh andoffwhen stale (see below).
- Numeric sensor for your blood glucose levels (
Creating the Staleness Binary Sensor in Home Assistant
If you are using Home Assistant template helpers to check if your CGM data is fresh (e.g., updated within the last 15 minutes / 900 seconds), you can create a template binary sensor using this logic:
{% if states.sensor.blood_sugar_mmol_dc.last_updated %}
{% set last_updated = as_timestamp(states.sensor.blood_sugar_mmol_dc.last_updated) %}
{% set current_time = as_timestamp(now()) %}
{% if current_time - last_updated <= 900 %}
on
{% else %}
off
{% endif %}
{% else %}
off
{% endif %}
Setup & Installation
1. Add Required Assets
Ensure all PNG and GIF files are placed inside the /homeassistant/esphome/images directory.
2. Configure Secrets
In your ESPHome secrets file (/homeassistant/esphome/secrets.yaml), ensure you have defined your Wi-Fi credentials:
wifi_ssid: "Your_WiFi_SSID"
wifi_password: "Your_WiFi_Password"
3. Compile and Flash
Connect your LilyGO T-Display-S3 via USB and flash the configuration using ESPHome:
- Create device
- Advanced set up options
- Either select "Import from file" (
lilygo-glucose-display.yaml) or "Empty Configuration" where you can copy/paste the YAML code.
Description
ESPHome and Home Assistant configuration for a LilyGO blood glucose display with PIR motion sensor and ambient light sensor.
https://unknownuniverse.uk
61 KiB
0 Stars
1 Watchers
0 Forks