{"id":51028472,"url":"https://github.com/aamat09/baby-tracker-suite","last_synced_at":"2026-07-09T23:00:25.955Z","repository":{"id":361783407,"uuid":"1254532421","full_name":"aamat09/baby-tracker-suite","owner":"aamat09","description":"Baby care tracking suite: HA dashboards, n8n workflows, PostgreSQL, ESP32-C3 remote with 3D-printed enclosure","archived":false,"fork":false,"pushed_at":"2026-06-10T06:00:07.000Z","size":18425,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-10T06:07:30.767Z","etag":null,"topics":["3d-printing","baby-tracker","diy","esp32","esp32-c3","esphome","home-assistant","iot","kicad","mqtt","n8n","newborn","openscad","pcb","postgresql","self-hosted","smart-home"],"latest_commit_sha":null,"homepage":"https://www.shmaestro.com/projects/baby-tracker","language":"OpenSCAD","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aamat09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-30T17:27:20.000Z","updated_at":"2026-06-10T06:00:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf1632dd-bc35-47d7-99cb-2bc491242245","html_url":"https://github.com/aamat09/baby-tracker-suite","commit_stats":null,"previous_names":["aamat09/baby-tracker-suite"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aamat09/baby-tracker-suite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamat09%2Fbaby-tracker-suite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamat09%2Fbaby-tracker-suite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamat09%2Fbaby-tracker-suite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamat09%2Fbaby-tracker-suite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aamat09","download_url":"https://codeload.github.com/aamat09/baby-tracker-suite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aamat09%2Fbaby-tracker-suite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35314872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-printing","baby-tracker","diy","esp32","esp32-c3","esphome","home-assistant","iot","kicad","mqtt","n8n","newborn","openscad","pcb","postgresql","self-hosted","smart-home"],"created_at":"2026-06-21T22:00:23.177Z","updated_at":"2026-07-09T23:00:25.942Z","avatar_url":"https://github.com/aamat09.png","language":"OpenSCAD","funding_links":["https://www.buymeacoffee.com/aamat09"],"categories":["OpenSCAD"],"sub_categories":[],"readme":"# Baby Tracker Suite\n\n[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20A%20Coffee-support-%23FFDD00.svg?logo=buy-me-a-coffee)](https://www.buymeacoffee.com/aamat09)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![ESPHome](https://img.shields.io/badge/ESPHome-firmware-blue.svg?logo=esphome)](https://esphome.io/)\n![status](https://img.shields.io/badge/status-active-brightgreen)\n\nA baby care tracking system built on Home Assistant, n8n, PostgreSQL, and ESP32. Born out of a contraction tracker built for labor, evolved into a full newborn care dashboard once my son arrived plus a ~$10 3D-printed physical remote for those 3am diaper-change logs.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/dashboard.png\" alt=\"Home Assistant baby tracker dashboard — summary stats and one-tap event buttons\" width=\"340\"\u003e\n\u003c/p\u003e\n\n## Features\n\n- **One-tap logging** of feeds, diapers, sleep, baths, medicine, tummy time, weight, pumping, and notes. 17 event types across 8 categories\n- **Multi-channel fan-out** on every press: PostgreSQL, both phones, Echo Show, and Discord via a single n8n webhook\n- **Live HA dashboard** with daily stats (feeds/diapers today, sleep total, last feed/diaper) polled every 30s\n- **3D-printed physical remote** ESP32-C3 + a 15-button 4x4 matrix + WS2812 feedback LED, MQTT over WiFi\n- **Reproducible PCB**  fully-routed 2-layer KiCad board *and* a 3D-printed copper-tape groove board, both generated from script\n- **2-hour pump reminders** with independent per-side timers\n- **Retired contraction tracker**  the labor-day origin story, Ring panic button + on-demand Ollama labor-stage AI assessment\n\n## The Story\n\nWhen my wife went into labor, we needed a way to log contractions without fumbling with phone apps. We paired a Ring Alarm Panic Button (Z-Wave) to our home automation stack where one press logged the contraction, timestamped it in PostgreSQL, notified both phones, posted to Discord, and announced it on the Echo Show. It worked beautifully for 700+ contractions over two weeks.\n\nWhen we got to the hospital, the Ring button was back home. So we added intensity-coded buttons (Mild/Moderate/Strong/Intense) to the HA dashboard with color coding, stats (average gap, frequency), and an on-demand AI assessment powered by Ollama that would estimate the labor stage.\n\nMy son was born the next day. The contraction tracker was retired the same day and replaced with a baby tracker covering feeds, diapers, sleep, baths, medicine, tummy time, weight, pumping, and notes.\n\nKeeping the same low-friction (high-WAF) style, we then built a 3D-printed physical remote with labeled buttons so nobody has to unlock a phone to log a diaper change at 3am.\n\n## Architecture\n\n```\nPhysical Button / HA App / Siri Shortcut\n        |\n        v\n   n8n Webhook (POST /webhook/baby-event)\n        |\n   +----+----+----+----+\n   |    |    |    |    |\n   v    v    v    v    v\n  DB  Phone Phone Echo Discord\n  PG   you   ptnr Show\n        |\n        v\n   n8n Log API (GET /webhook/baby-log)\n        |\n        v\n   HA REST Sensor (polls every 30s)\n        |\n        v\n   HA Dashboard (stats + journal + buttons)\n```\n\n## Components\n\n### Contraction Tracker (retired)\n\nThe original. Ring Panic Button press -\u003e Z-Wave JS UI -\u003e Python bridge -\u003e MQTT + n8n webhook -\u003e full pipeline.\n\n| File | Description |\n|------|-------------|\n| `contraction-tracker/zwave_panic_mqtt.py` | Python bridge: Z-Wave WebSocket -\u003e MQTT + webhook |\n| `contraction-tracker/n8n/contraction_tracker.json` | Main workflow: webhook -\u003e Discord, DB, notifications |\n| `contraction-tracker/n8n/contraction_note_logger.json` | MQTT-triggered note logger |\n| `contraction-tracker/n8n/contraction_log_api.json` | GET API: returns entries + 2-hour stats |\n| `contraction-tracker/n8n/contraction_ai_assessment.json` | On-demand Ollama AI labor stage assessment |\n| `contraction-tracker/ha/dashboard.json` | HA Lovelace dashboard (intensity buttons, journal, AI) |\n| `contraction-tracker/ha/configuration_snippets.yaml` | HA config: rest_command, input_text, REST sensor |\n\nFeatures added during labor:\n- 4 color-coded intensity buttons (Mild/Moderate/Strong/Intense)\n- Real-time stats: contraction count, average gap, average intensity (last 2 hours)\n- On-demand AI assessment via Ollama (gpt-oss model) with timestamp\n- Press feedback: haptic vibration + button scale animation\n- iPhone home screen shortcut via Apple Shortcuts deep link\n\n### Baby Tracker (active)\n\nFull newborn care tracker. 17 event types across 8 categories.\n\n| File | Description |\n|------|-------------|\n| `baby-tracker/n8n/baby_event_logger.json` | Main workflow: webhook -\u003e DB + phone notifications |\n| `baby-tracker/n8n/baby_note_logger.json` | MQTT-triggered note logger |\n| `baby-tracker/n8n/baby_log_api.json` | GET API: returns entries + daily stats |\n| `baby-tracker/n8n/pump_reminder.json` | 2-hour pump reminder (independent timers per pump) |\n| `baby-tracker/ha/dashboard.json` | HA Lovelace dashboard |\n| `baby-tracker/ha/configuration_snippets.yaml` | HA config snippets |\n\nEvent types:\n- **Feed:** breast, bottle, solid\n- **Pump:** left, right (with 2h reminder)\n- **Diaper:** pee, poop, both, change\n- **Other:** sleep (toggle), bath, medicine, tummy_time, weight\n- **Notes:** regular, special (star-prefixed)\n\nStats tracked: last feed time/type, last diaper time/type, feeds today, diapers today, sleep total today, baths/medicines/tummy times/pumps today.\n\n### Baby Tracker App — Home Assistant add-on (separate repo)\n\nA **single-container Home Assistant app** that bundles everything above with\n**no n8n and no external database**: an Ingress web UI (the colorful button\ndashboard), local SQLite storage, the same stats/journal, pump reminders, and\nnative HA entities via MQTT discovery — and it still listens to the ESP32\nremote. It lives in its own installable repo:\n\n➡️ **[hms-homelab/hms-baby-tracker](https://github.com/hms-homelab/hms-baby-tracker)**\n(FastAPI + SQLite; add the repo URL under Settings → Add-ons/Apps → Repositories).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/addon/ingress-ui.png\" alt=\"Baby Tracker add-on Ingress web UI — summary stats, color-coded button grid, notes and journal\" width=\"48%\"\u003e\n  \u003cimg src=\"assets/addon/addon-info.png\" alt=\"Baby Tracker add-on running in Home Assistant — Info page with Ingress, start-on-boot and resource usage\" width=\"48%\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cem\u003eThe add-on's Ingress web UI (left) and its Home Assistant app page (right) — runs as a native HA add-on, no n8n or external DB.\u003c/em\u003e\u003c/p\u003e\n\nThe n8n + PostgreSQL path in this repo remains as the advanced/legacy backend;\nthe app is the portable, one-click way to run the whole thing.\n\n### Baby Remote (in progress)\n\n3D-printed physical remote control with ESP32-C3, 15 tactile buttons, RGB LED feedback, and a 0.96\" OLED status screen.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/baby-remote.png\" alt=\"3D-printed baby-remote — 15 labeled buttons and a 0.96-inch OLED showing last feed, last pump and the next-pump reminder\" width=\"300\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cem\u003eThe remote with its 0.96\" OLED — last feed, last pump and the next-pump reminder, pushed live over MQTT by n8n.\u003c/em\u003e\u003c/p\u003e\n\n\n\u003e **🎛️ Want one without building it?** The remote is made in small batches —\n\u003e **[join the device waitlist →](https://www.shmaestro.com/waitlist)**.\n\n| File | Description |\n|------|-------------|\n| `baby-remote/kicad/` | 2-layer PCB (DRC-clean, Freerouting-routed) — the manufactured board |\n| `baby-remote/kicad/fab/baby-remote-jlcpcb.zip` | Gerbers + drill, ready to upload to JLCPCB |\n| `baby-remote/scad/baby-remote-pcb.scad` | OpenSCAD 3D-printed PCB substrate (grooved board = device back; bottom feet) |\n| `baby-remote/scad/baby-remote-pcb-case.scad` | OpenSCAD snap-fit cap (walls + ledge + barrels + labels); board snaps in |\n| `baby-remote/scad/button_plunger.stl` | Button plunger (print 15×) |\n| `baby-remote/scad/led_window.stl` | LED window (print 1× in clear filament) |\n| `baby-remote/esphome/baby_remote.yaml` | ESPHome firmware: matrix -\u003e MQTT -\u003e n8n / the app |\n\nSee [Hardware](#hardware) for the button layout, matrix wiring, PCB, and BOM.\n\n### Database\n\n| File | Description |\n|------|-------------|\n| `db/schema.sql` | PostgreSQL schema for both tables |\n\nBoth tables live in the `maestro_hub` database on PostgreSQL 17 at homelab.local.\n\n## Hardware\n\nThe **Baby Remote** is a 3D-printed, battery-powered ESP32-C3 keypad. 15 tactile\nswitches on a diodeless **4x4 scan matrix** (16th cell is the LED window), each\npress published over MQTT to the same n8n webhook the app and Siri use.\n\nButton layout (4x4 grid, last cell = RGB LED):\n```\n Breast  | Bottle  |  Solid  |  Sleep\n Pump L  | Pump R  |  Bath   |  Meds\n  Pee    |  Poop   |  Both   | Change\n Tummy   | Weight  |  Note   |  [LED]\n```\n\nMatrix -\u003e GPIO (firmware `baby-remote/esphome/baby_remote.yaml` == PCB):\n\n| Signal | GPIO | Net |\n|---|---|---|\n| Rows (drive) | GPIO0, GPIO1, GPIO3, GPIO4 | `ROW0..3` |\n| Columns (sense) | GPIO5, GPIO6, GPIO7, GPIO10 | `COL0..3` |\n| WS2812B LED | GPIO8 | `LED_DIN` |\n\nPCB -- two interchangeable designs, both script-generated and reproducible:\n- **KiCad** (`baby-remote/kicad/`)  fully-routed **2-layer** board (rows on\n  F.Cu, columns on B.Cu), DRC clean (0 violations / 0 unconnected / 0 parity),\n  Freerouting-routed, JLCPCB-ready. Regenerate with `gen_schematic.py` -\u003e\n  `pcbgen.py`; route via Specctra DSN/SES.\n- **OpenSCAD groove board** (`baby-remote/scad/baby-remote-pcb.scad`)  3D-printed\n  substrate with copper-tape/tinned-wire grooves; rows on the top face, columns\n  on the bottom, switch legs bridging faces (crossing-free).\n\nBOM (~$10):\n\n| Part | Qty |\n|---|---|\n| ESP32-C3 SuperMini | 1 |\n| TP4056 USB-C LiPo charger | 1 |\n| 3.7V LiPo 500mAh | 1 |\n| 6x6x5mm tactile switches | 15 |\n| WS2812B RGB LED | 1 |\n| Slide switch (power) | 1 |\n\n## Infrastructure\n\n- **Home Assistant:** KVM/VM at homeassistant.local (dashboards, scripts, REST sensors)\n- **n8n:** Native at homelab.local:5678 (workflow automation, webhooks)\n- **PostgreSQL 17:** Native at homelab.local:5432 (data storage)\n- **EMQX:** Native at homelab.local:1883 (MQTT broker)\n- **Ollama:** ollama.local:11434 (AI assessment, RTX 3050)\n- **ESPHome:** For ESP32 device firmware\n\n## Install as a Home Assistant App\n\nThe fastest path — no n8n, no PostgreSQL, no manual scripts:\n\n1. **Settings → Add-ons → Add-on Store** (shown as **Apps** on HA 2026.2+) →\n   ⋮ → **Repositories** → add `https://github.com/hms-homelab/hms-baby-tracker`.\n2. Install **Baby Tracker**, then **Start** it.\n3. Open the **Web UI** (Ingress) — the button dashboard is right there.\n4. *(optional)* In the app's **Configuration** tab set `notify_targets`\n   (e.g. `mobile_app_your_phone`) to get press + pump-reminder notifications,\n   and adjust `timezone` / `pump_hours`.\n\nIt auto-connects to the HA Mosquitto broker, so the **ESP32 remote keeps\nworking** (publishes to `baby/remote/event`) and native HA sensors/buttons\nappear automatically via MQTT discovery. Data lives in the add-on's `/data`\n(SQLite). Full reference:\n[hms-baby-tracker DOCS](https://github.com/hms-homelab/hms-baby-tracker/blob/main/baby_tracker/DOCS.md).\n\n## Quick Start (advanced / legacy n8n backend)\n\n### 1. Database\n\n```bash\npsql -d maestro_hub -f db/schema.sql\n```\n\n### 2. n8n + Home Assistant\n\n```bash\n# Import the n8n workflows (n8n UI or API)\n#   baby-tracker/n8n/*.json\n# Add the HA snippets to configuration.yaml\n#   baby-tracker/ha/configuration_snippets.yaml\n# Import the dashboard into HA storage (.storage/lovelace.\u003cname\u003e)\n#   baby-tracker/ha/dashboard.json\n# Create the HA scripts referenced by the dashboard (rest_command + input_text,\n#   see baby-tracker/ha/configuration_snippets.yaml)\n```\n\n### 3. Flash the remote\n\n```bash\nesphome run baby-remote/esphome/baby_remote.yaml\n```\n\n### 4. Build the remote\n\nPrint the case parts (`baby-remote/scad/*.stl`), fabricate the PCB\n(KiCad Gerbers or the OpenSCAD groove board), and assemble.\n\n## Related Projects\n\nPart of the [Smart Home Maestro](https://github.com/hms-homelab) homelab:\n- [hms-cpap](https://github.com/hms-homelab/hms-cpap) multi platform service for realtime visualization of sleep based data on cpap. \n- [hms-claude-mem](https://github.com/hms-homelab/hms-claude-mem) -- semantic memory MCP server (Redis vectorsets + Ollama)\n- [hms-mm](https://github.com/hms-homelab/hms-mm) -- dual ESP32-C3 WiFi SD-card bridge\n- [hms-scale-esp](https://github.com/hms-homelab/hms-scale-esp) -- ESP32-C3 BLE scale gateway\n\n## License\n\nMIT License -- see [LICENSE](LICENSE) for details.\n\n## Support\n\nIf this project is useful to you, consider buying me a coffee!\n\n[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/aamat09)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamat09%2Fbaby-tracker-suite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faamat09%2Fbaby-tracker-suite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faamat09%2Fbaby-tracker-suite/lists"}