From 88230ae011291a7d22f10046a1690effd04d5f26 Mon Sep 17 00:00:00 2001 From: unkn <1+unkn@noreply.localhost> Date: Mon, 19 Oct 2026 10:35:48 +0100 Subject: [PATCH] Update README.md --- README.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50c5609..e1a3264 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,102 @@ -# homeassistant-diabetes +# Home Assistant Diabetes Display -ESPHome and Home Assistant configuration for a LilyGO blood glucose display and alarms \ No newline at end of file +A custom, open-source continuous glucose monitor (CGM) desktop display and alarm hub 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. +- **Smart Power Saving:** Integrated PIR motion sensor wakes the display when movement is detected. +- **Adaptive Lighting:** BH1750 ambient light sensor automatically adjusts display backlight levels based on room lighting. +- **Clock & Seconds Counter:** Displays current local time synchronized via Home Assistant. + +--- + +## Hardware Requirements + +- LilyGO T-Display-S3 ESP32-S3 Display Board +- BH1750 Ambient Light Sensor (I2C) +- PIR Motion Sensor (GPIO 44) +- USB-C cable for power and flashing + +--- + +## Wiring Pinout + +| Component | Pin / Connection | +| :--- | :--- | +| **I2C SDA (BH1750)** | GPIO 21 | +| **I2C SCL (BH1750)** | GPIO 16 | +| **PIR Motion Sensor** | GPIO 44 | +| **Backlight Control** | GPIO 38 | + +--- + +## Repository Structure + +```text +homeassistant-diabetes/ +├── README.md +├── esphome/ +│ └── lilygo-glucose-display.yaml # ESPHome device configuration +├── images/ # Required icons, arrows, and warning animations +│ ├── arrow-bottom-right-thick.png +│ ├── arrow-down-thick.png +│ ├── arrow-right-thick.png +│ ├── arrow-top-right-thick.png +│ ├── arrow-up-thick.png +│ ├── chevron-down.png +│ ├── chevron-up.png +│ └── warning.gif +└── docs/ + └── wiring.md # Detailed wiring and assembly notes +``` + +--- + +## Setup & Installation Instructions + +### 1. 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) creating entities for your blood glucose value and trend icon. + +### 2. Clone or Download the Repository +Clone this repository to your local machine or download it into your ESPHome configuration directory: +```bash +git clone https://git.unknownuniverse.uk/unkn/homeassistant-diabetes.git +``` + +### 3. Add Required Assets +Ensure all arrow PNG files and the `warning.gif` animation are placed inside an `images/` directory relative to your ESPHome YAML configuration file, as referenced in the firmware config. + +### 4. Configure Secrets +In your ESPHome secrets file (`secrets.yaml`), ensure you have defined your Wi-Fi credentials: +```yaml +wifi_ssid: "Your_WiFi_SSID" +wifi_password: "Your_WiFi_Password" +``` + +### 5. Update Entity IDs +Open `esphome/lilygo-glucose-display.yaml` and verify that the Home Assistant entity IDs match your setup: +- `sensor.blood_sugar_mmol` (Your blood glucose numeric sensor) +- `sensor.blood_sugar_trend_icon` (Your CGM trend icon sensor) +- `binary_sensor.cgm_data_fresh` (Binary sensor indicating whether data is fresh or stale) + +### 6. Compile and Flash +Connect your LilyGO T-Display-S3 via USB and flash the configuration using ESPHome: +```bash +esphome run esphome/lilygo-glucose-display.yaml +``` + +--- + +## License + +Distributed under the **MIT License**. See `LICENSE` for more information. + + +--- + +[![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/theunknownuniverse) + +https://unknownuniverse.uk/