Skip to content

About

Self-hosted garden dashboard: Hunter Hydrawise irrigation and Dreame mower (via Home Assistant) history, Open-Meteo weather, a garden map with plant pins, a garden action log and Google Gemini AI insights and plant recognition. FastAPI + SQLite, runs in Docker or on Kubernetes (Helm).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🌱 Ogrodnik AI (Garden Assistant AI)

A web-based garden dashboard that aggregates:

  • Irrigation — Hunter Hydrawise (Wi-Fi),
  • Mowing — Dreame robot (via Home Assistant bridge),
  • Weather — Local garden coordinates forecast (Open-Meteo, API key not required),
  • Manual action logs (fertilizing, planting, pruning, plant protection) with photos,
  • Garden map with plant positioning (interactive pins on a photo or sketch),
  • AI Analysis (Gemini) — Auto-generated insights and recommendations every 24 hours, on-demand analysis, and plant species recognition from photos.

All collected data is stored in a local SQLite database, as the default Home Assistant recorder only keeps history for ~10 days.


Features

Area Description
Dashboard Summary of watering, mowing, weather, and latest AI insights
Hunter Hydrawise Schedule polling, local watering history builder
Dreame Mower Mowing history fetched via Home Assistant (REST API)
Weather Real-time and forecast data for the garden's coordinates (Open-Meteo)
Action Logs Form and photo uploads for fertilizing, planting, pruning, etc.
Garden Map Upload a photo/sketch, click to set locations, and map plants with pins
AI Plant Recognition Upload a photo of a plant; Gemini Vision suggests species for mapping
AI Analysis Daily automated reports (every 24h) + on-demand analysis with history
Settings in UI Edit API keys and coordinates directly in the app without container restarts

Quick Start (Docker — Recommended)

git clone <your-repo-url> ogrodnik-ai
cd ogrodnik-ai

cp .env.example .env
# Fill in ADMIN_PASSWORD and SECRET_KEY — see "Required Configuration" below.
# The rest of .env can stay empty — all API keys can
# be entered later in the application under "Settings"

docker compose up -d --build

Open http://localhost:8000

All data (SQLite database, uploaded photos, and maps) is stored in the Docker volume ogrodnik_data, so it will persist across container restarts and rebuilds.


Quick Start (Local, without Docker)

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cp .env.example .env

uvicorn app.main:app --reload

Open http://localhost:8000


Required Configuration

Two environment variables have no default value and the application refuses to start without them. This is deliberate: this repository is public, so any default baked into the source would be known to everyone — and the login screen is the only thing guarding the Settings tab, which holds your Home Assistant token and API keys.

Variable Purpose
ADMIN_PASSWORD Password for the admin panel (username comes from ADMIN_USERNAME, default admin)
SECRET_KEY Key used to sign session identifiers — a separate secret, not the password

Generate a SECRET_KEY with:

python -c "import secrets; print(secrets.token_urlsafe(48))"

Set both in .env (Docker Compose reads it via env_file), or — for the Helm chart — in the Kubernetes Secret referenced by secretName in charts/ogrodnik/values.yaml. If either is missing, startup aborts with a message naming the variable.

Sessions are stored server-side in the SQLite database, so logging out really invalidates the session token and sessions survive a pod restart.


Database Browser (sqlite-web)

docker-compose.yml ships an optional sqlite-web container bound to 127.0.0.1:8082. In the Helm chart the same sidecar is available under dbWeb.enabled and is disabled by default — inside a cluster it would listen on the pod IP with no authentication, letting any other pod read and overwrite the appsetting table (Home Assistant token, Gemini and Hydrawise keys) without logging in. Enable it only temporarily, and preferably alongside a NetworkPolicy restricting port 8080.


API Key Configuration

Keys (Hydrawise, Home Assistant, Gemini) can be configured in two ways:

  1. In the Application: In the Settings tab (/settings). Values configured here override .env and take effect immediately without restarting the container — ideal for Docker deployments.
  2. In the .env File: Before the first launch, see .env.example.

The application works out of the box (without any keys) for the dashboard, garden action log with photo uploads, garden map, and weather (Open-Meteo does not require a key). Hydrawise, Dreame/Home Assistant, and Gemini AI activate automatically once their corresponding configuration is supplied.


Integration Status

Integration Requires POC Status
Open-Meteo (Weather) Nothing Active out of the box
Action Log & Photos Nothing Active out of the box
Garden Map (Plants) Nothing Active out of the box
Hunter Hydrawise API key Working (polling, local history building)
Dreame Mower Home Assistant + mower integration Core skeleton ready, requires configured Home Assistant
Gemini AI (Analysis & Plant ID) API key from aistudio.google.com Working (automatically every 24h + on-demand)

Technology Stack

FastAPI + Jinja2 (server-side rendering, no SPA) · SQLModel/SQLite · APScheduler · httpx · Tailwind CSS & Chart.js via CDN · Docker / Docker Compose.


License

MIT — free to use, modify, and distribute.

About

Self-hosted garden dashboard: Hunter Hydrawise irrigation and Dreame mower (via Home Assistant) history, Open-Meteo weather, a garden map with plant pins, a garden action log and Google Gemini AI insights and plant recognition. FastAPI + SQLite, runs in Docker or on Kubernetes (Helm).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages