{"id":15515849,"url":"https://github.com/calvinmclean/automated-garden","last_synced_at":"2025-04-23T03:23:07.345Z","repository":{"id":39909784,"uuid":"318905094","full_name":"calvinmclean/automated-garden","owner":"calvinmclean","description":"weather-based smart irrigation controller and backend","archived":false,"fork":false,"pushed_at":"2024-04-14T00:54:09.000Z","size":25312,"stargazers_count":18,"open_issues_count":7,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-14T15:23:20.237Z","etag":null,"topics":["arduino","esp32","garden","garden-automation","go","golang","influxdb","iot","irrigation","irrigation-controller","mqtt","netatmo"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calvinmclean.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}},"created_at":"2020-12-05T22:49:44.000Z","updated_at":"2024-04-19T05:35:45.961Z","dependencies_parsed_at":"2024-04-19T05:35:39.504Z","dependency_job_id":null,"html_url":"https://github.com/calvinmclean/automated-garden","commit_stats":{"total_commits":571,"total_committers":2,"mean_commits":285.5,"dds":"0.0017513134851138146","last_synced_commit":"9caaba39854330b24c9f971f7884a506986dd214"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fautomated-garden","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fautomated-garden/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fautomated-garden/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmclean%2Fautomated-garden/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calvinmclean","download_url":"https://codeload.github.com/calvinmclean/automated-garden/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250361747,"owners_count":21417957,"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":["arduino","esp32","garden","garden-automation","go","golang","influxdb","iot","irrigation","irrigation-controller","mqtt","netatmo"],"created_at":"2024-10-02T10:04:35.505Z","updated_at":"2025-04-23T03:23:07.326Z","avatar_url":"https://github.com/calvinmclean.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated Garden\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/calvinmclean/automated-garden)](https://goreportcard.com/report/github.com/calvinmclean/automated-garden)\n[![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/calvinmclean/automated-garden?filename=garden-app%2Fgo.mod)](https://github.com/calvinmclean/automated-garden/blob/main/garden-app/go.mod)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/calvinmclean/automated-garden/main.yml?branch=main)\n[![License](https://img.shields.io/github/license/calvinmclean/automated-garden)](https://github.com/calvinmclean/automated-garden/blob/main/LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/calvinmclean/automated-garden/garden-app.svg)](https://pkg.go.dev/github.com/calvinmclean/automated-garden/garden-app)\n[![codecov](https://codecov.io/gh/calvinmclean/automated-garden/branch/main/graph/badge.svg?token=20LWQYHKE8)](https://codecov.io/gh/calvinmclean/automated-garden)\n\n\nThis project is a monorepo containing code for an ESP32-based microcontroller project and a Go backend for improving interactions with multiple irrigation systems.\n\n**If you have any question at all, please reach out and I would love to chat about the project!**\n\n[![Additional Docs](https://img.shields.io/badge/Use-Live_UI_Demo-2ea44f?style=for-the-badge)](https://garden-app-demo.fly.dev/)\n[![Additional Docs](https://img.shields.io/badge/View-Documentation-3271a8?style=for-the-badge)](https://calvinmclean.github.io/automated-garden)\n\nThis system is designed to be flexible for all types of gardening. Here are a few examples of different possible setups:\n  - Traditional irrigation system using 24V AC valves\n  - Backyard vegetable garden\n  - Indoor garden with a pump and multiple valves to control watering plants, plus a grow light\n  - Indoor seedling germination system with a pump and grow light (fan and heating pad control possibly coming soon)\n  - Hydroponics system with one circulation or aeration pump\n\n## How It Works\n\n![Garden](docs/_images/GardenApp.png?raw=true)\n\n### Garden Server\nThis Go application is contained in the [`garden-app`](./garden-app) directory and consists of a CLI and web backend for interacting with the garden controller. It implements all logic and orchestrates the separate systems.\n\nKey features include:\n  - Intuitive REST API\n  - Actions to water plants and toggle a light\n  - Water plants automatically on a schedule\n  - Aggregate data from connected services and previous actions\n  - Scale watering based on external weather API\n\n### Garden Controller\nThis Arduino-compatible firmware is contained in the [`garden-controller`](./garden-controller) and is intended to be used with an ESP32. It implements the most basic functionality to control hardware based on messages from the Go application received over MQTT.\n\nKey features include:\n  - Control valves or devices (only limited by number of output pins)\n  - Queue up water events to water multiple zones one after the other\n  - Publish data and logs to InfluxDB via Telegraf + MQTT\n  - Respond to buttons to water individual zones and cancel watering\n\n## Core Technologies\n- Arduino/FreeRTOS\n- Go\n- MQTT\n- InfluxDB\n- Telegraf\n- Netatmo Weather (optional for weather-based watering)\n- Grafana (optional for visualization of data)\n- Prometheus (optional for metrics)\n- Loki + Promtail (optional for log aggregation)\n\n## Quickstart/Demo\nUse Docker Compose to easily run everything and try it out! This will run all services the `garden-app` depends on, plus an instance of the `garden-app` and a mock `garden-controller`.\n\n1. Clone this repository\n  ```shell\n  git clone https://github.com/calvinmclean/automated-garden.git\n  cd automated-garden\n  ```\n\n2. Run Docker Compose and wait a bit for everything to start up\n  ```shell\n  docker compose -f deploy/docker-compose.yml --profile demo up\n  ```\n\n3. Try out some `curl` commands to see what is available in the API\n  ```shell\n  # list all Gardens\n  curl -s localhost:8080/gardens | jq\n\n  # get a specific Garden\n  curl -s localhost:8080/gardens/c9i98glvqc7km2vasfig | jq\n\n  # get all Zones that are a part of this Garden\n  curl -s localhost:8080/gardens/c9i98glvqc7km2vasfig/zones | jq\n  ```\n  - You may notice that these responses all contain a `links` array with the full API routes for other endpoints related to the resources. Go ahead and follow some of these links to learn more about the available API!\n\n4. Water a Zone for 3 seconds\n  ```shell\n  curl -s localhost:8080/gardens/c9i98glvqc7km2vasfig/zones/c9i99otvqc7kmt8hjio0/action \\\n    -d '{\"water\": {\"duration\": 3000}}'\n  ```\n\n5. Now access Grafana dashboards at http://localhost:3000 and login as `admin/adminadmin`\n  - The \"Garden App\" dashboard contains application metrics for resource usage, HTTP stats, and others\n  - The \"Garden Dashboard\" dashboard contains more interesting data that comes from the `garden-controller` to show uptime and a watering history. You should see the recent 3 second watering event here\n\n6. Access the UI at http://localhost:8080/gardens\n\nAnd that's it! I encourage you to check out the additional documentation for more detailed API usage and to learn about all of the things that are possible.\n\n## Frontend\nThis project includes an HTMX UI served by the Go application.\n\n\n## Compile controller\n```\npio run -t upload\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmclean%2Fautomated-garden","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinmclean%2Fautomated-garden","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmclean%2Fautomated-garden/lists"}