{"id":18073264,"url":"https://github.com/chl33/garage133","last_synced_at":"2026-06-23T13:32:07.432Z","repository":{"id":259336146,"uuid":"863787271","full_name":"chl33/Garage133","owner":"chl33","description":"A DIY device for garage door automation","archived":false,"fork":false,"pushed_at":"2025-01-01T01:02:20.000Z","size":3016,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T18:16:40.111Z","etag":null,"topics":["esp32","garage-door-opener","home-assistant","kicad","openscad"],"latest_commit_sha":null,"homepage":"https://selectiveappeal.org/posts/garage133/","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/chl33.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}},"created_at":"2024-09-26T23:11:15.000Z","updated_at":"2025-01-01T01:02:23.000Z","dependencies_parsed_at":"2024-10-24T14:49:16.160Z","dependency_job_id":"2ff532ef-5302-4240-8094-36ded8715010","html_url":"https://github.com/chl33/Garage133","commit_stats":null,"previous_names":["chl33/garage133"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chl33%2FGarage133","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chl33%2FGarage133/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chl33%2FGarage133/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chl33%2FGarage133/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chl33","download_url":"https://codeload.github.com/chl33/Garage133/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378141,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["esp32","garage-door-opener","home-assistant","kicad","openscad"],"created_at":"2024-10-31T10:05:45.213Z","updated_at":"2026-06-23T13:32:07.427Z","avatar_url":"https://github.com/chl33.png","language":"OpenSCAD","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Garage133\n\n**Garage133** is a DIY garage door automation and monitoring system based on the ESP32.\nIt provides capability to remotely control up to two garage doors, monitor their\n state (open/closed), detect vehicle presence, measure environmental conditions\n (temperature/humidity), and detect motion within the garage.\n\nThe system is designed to integrate seamlessly with **Home Assistant** via MQTT\n but also provides a modern, responsive **Svelte-based Web Interface** for control and configuration.\n\n![Garage133](images/garage133-1400x600.webp)\n\n## What's New in v1.0.3\n\n*   **Modernized API**: Full transition to `camelCase` JSON keys for all status and configuration endpoints, enabling simpler and more robust integration with the Svelte frontend.\n*   **og3 v0.6.0 Core**: Leveraging the latest framework improvements, including declarative `require()` dependencies and optimized memory management.\n*   **Automatic Build Pipeline**: Frontend assets are now automatically rebuilt during the PlatformIO compilation process.\n*   **Coding and infrastructure cleanups**: Linting, CI, coding improvements.\n\n## Features\n\n*   **Dual Door Control:** Independent control for two garage doors using relays.\n*   **HMM State Estimation:** Uses **Hidden Markov Models (HMM)** and sonar sensors to robustly determine door and car states:\n    *   **Open** (Door is rolled up).\n    *   **Closed with Car** (Door is down, vehicle detected).\n    *   **Closed (Empty)** (Door is down, bay is empty).\n*   **Modern Web Dashboard:** A responsive Svelte SPA to:\n    *   Monitor real-time sensor data and door status.\n    *   Trigger door relays remotely.\n    *   Visualize HMM detection probabilities.\n    *   Manually correct/label states to refine detection.\n    *   Upload and reload HMM JSON models dynamically.\n*   **Environmental Monitoring:** SHTC3 sensor for Temperature and Humidity.\n*   **Motion Detection:** PIR sensor integration.\n*   **Light Monitoring:** Analog light sensor to detect garage lighting levels.\n*   **Home Assistant:** Native MQTT Discovery support for easy integration.\n*   **OLED Display:** Shows status, IP address, and sensor readings locally.\n*   **OTA Updates:** Support for reliable Over-The-Air firmware updates using expanded flash partitions.\n\n![Web interface](images/garage133-web.png)\n\n## Hardware\n\nThe project is built around an **ESP32** (Node32s / ESP32 Dev Module).\n\n### Pinout Configuration\n\n| Component | Pin (ESP32) | Description |\n| :--- | :--- | :--- |\n| **Relay (Left)** | GPIO 15 | Control for Left Garage Door |\n| **Relay (Right)** | GPIO 2 | Control for Right Garage Door |\n| **Sonar Trigger (Left)** | GPIO 16 | HC-SR04 Trigger |\n| **Sonar Echo (Left)** | GPIO 17 | HC-SR04 Echo |\n| **Sonar Trigger (Right)** | GPIO 5 | HC-SR04 Trigger |\n| **Sonar Echo (Right)** | GPIO 18 | HC-SR04 Echo |\n| **PIR Sensor** | GPIO 25 | Motion Detection |\n| **Light Sensor** | GPIO 33 | Analog Light Level |\n| **I2C SDA** | GPIO 21 | SHTC3 \u0026 OLED Display |\n| **I2C SCL** | GPIO 22 | SHTC3 \u0026 OLED Display |\n\n*Note: Pin definitions can be found in `src/main.cpp`.*\n\n### Fabrication\nThis repository includes files for fabricating the custom PCB and 3D printed case:\n*   **KiCAD:** Circuit board designs are located in the `KiCAD/` directory.\n*   **3D Parts:** OpenSCAD and STL files for the enclosure and sensor mounts are\n     in the `scad/` directory.\n\n![Garage133 board](images/garage133-board-1400x728.webp)\n![Sonar sensor](images/sonar-mounted-1400x1054.webp)\n\n## Getting Started\n\n### Prerequisites\n*   [PlatformIO](https://platformio.org/) (VSCode Extension or CLI)\n*   [Node.js \u0026 npm](https://nodejs.org/) (For building the Web Interface)\n*   Git\n\n### Installation\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/chl33/Garage133.git\n    cd Garage133\n    ```\n\n2.  **Build the Web Interface:**\n    Generate the C++ header containing the Svelte assets:\n    ```bash\n    ./build-svelte.sh\n    ```\n\n3.  **Configuration:**\n    Copy the example secrets file and configure your environment settings.\n    ```bash\n    cp secrets.ini.example secrets.ini\n    ```\n    Edit `secrets.ini` to set your upload port, UDP log target, and OTA password.\n\n-    *Note: WiFi and MQTT credentials can be configured via the captive portal on\n-\t first boot, when you attach to the board's WiFi network named 'garage133.'\n     They can be configured via the web dashboard therafter.*\n\n4.  **Build and Flash:**\n    Connect your ESP32 via USB for the first flash (to apply the `min_spiffs` partition table).\n    ```bash\n    pio run -e usb_node32s --target upload\n    ```\n\n## Usage\n\n### Web Interface\nOnce connected to WiFi, navigate to the device's IP address in your browser.\n*   **Overview:** Real-time status of both doors and environment.\n*   **Door Details:** Click the Gear icon on a door card to see HMM probabilities, manually label the current state, or upload a new model.\n*   **Settings:** Configure WiFi, MQTT, and restart the device.\n\n### Home Assistant\nEnsure your Home Assistant instance has an MQTT broker configured.\nThe device uses Home Assistant MQTT Discovery. Once the device connects to your MQTT broker, the following entities should automatically appear:\n*   **Covers:** `left_door`, `right_door` (Open/Close control)\n*   **Sensors:** `temperature`, `humidity`, `light`\n*   **Binary Sensors:** `car` (presence for each bay), `motion`\n\n### HMM Analysis Toolkit\nThe `analysis/` directory contains Python tools to help refine your detection models:\n*   Download historical sonar data from InfluxDB, if you have this setup.\n*   Train HMM models using the Viterbi algorithm.\n*   Evaluate and export models to JSON for upload to the device.\n\n## Blog Post\nFor a more detailed write-up on the background and design of this project, please see the [blog post](https://selectiveappeal.org/posts/garage133/).\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchl33%2Fgarage133","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchl33%2Fgarage133","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchl33%2Fgarage133/lists"}