Real-time sensor telemetry, tower & pod management, historical charts, AI-powered plant health analysis, and Telegram alerts — all running on your own hardware, with your own data, on your own network.
OptiCell Dashboard is a lightweight, fully self-hosted control panel for hydroponic and controlled-environment agriculture setups. A single-page web dashboard talks to a small Python (Flask) server, which persists data to CouchDB and brokers requests to an AI model and optional Telegram bot. No cloud account required — everything runs on a PC, mini-PC, or Raspberry Pi on your local network.
ESP32 sensor nodes ─┐
▼
┌─────────────┐ HTTP ┌──────────────────┐ ┌─────────────┐
│ Dashboard │ ────────► │ Flask server │ ─►│ CouchDB │
│ (browser) │ ◄──────── │ (api_server_...) │ │ (storage) │
└─────────────┘ └────────┬─────────┘ └─────────────┘
│
┌────────────┴────────────┐
▼ ▼
AI server (OpenAI- Telegram bot
compatible / Ollama) (alerts & queries)
- 📊 Real-time monitoring — temperature, humidity, light, pH, EC/TDS, CO₂ and more
- 🗼 Tower & pod management — track multiple grow towers and individual pods
- 📈 Historical charts — trend visualisation backed by CouchDB
- 🤖 AI plant analysis — capture a photo and get health, deficiency and pest assessments from any OpenAI-compatible vision model (e.g. a local Ollama server)
- 💬 Telegram bot (optional) — status queries and push alerts on the go
- 📷 Webcam capture & annotation — snapshot plants directly from the dashboard
- 🔌 ESP32 integration — poll sensor nodes and drive relays/pumps over HTTP
- 🏠 100% self-hosted — your data never leaves your network
| Layer | Technology |
|---|---|
| Frontend | Single-file HTML + vanilla JS + Chart.js |
| Backend | Python 3, Flask, Flask-CORS |
| Storage | Apache CouchDB 3.x |
| AI | Any OpenAI-compatible /v1/chat/completions endpoint (Ollama, LiteLLM, vLLM, LocalAI, …) |
| Messaging | Telegram Bot API |
| Devices | ESP32 over HTTP |
- Python 3.8+
- Apache CouchDB 3.x
- An OpenAI-compatible AI endpoint (optional, for plant analysis) — e.g. Ollama
- A Telegram bot token from @BotFather (optional)
# 1. Clone
git clone https://github.com/<your-org>/opticell-dashboard.git
cd opticell-dashboard
# 2. Install Python dependencies
python -m pip install -r requirements.txt
# 3. Configure
cp .env.example .env # then edit .env with your values
# 4. Run the server
python api_server_unified.pyThen open http://localhost:8000/opticell_dashboard_v2.0_final.html in your browser.
On Windows you can simply double-click
start_server.bat(server only) orstart_all.bat(server + Telegram bot).
All server-side settings live in .env (see .env.example):
| Variable | Purpose |
|---|---|
AI_BASE_URL / AI_BEARER_TOKEN |
Your OpenAI-compatible AI endpoint + token |
AI_TEXT_MODEL / AI_VISION_MODEL |
Model names for text Q&A and image analysis |
COUCHDB_URL / COUCHDB_USER / COUCHDB_PASS / COUCHDB_DB |
CouchDB connection |
TELEGRAM_BOT_TOKEN, AUTHORIZED_USERS, ADMIN_USERS |
Telegram bot (optional) |
ESP32_IP |
Sensor node address (optional) |
SERVER_HOST / SERVER_PORT |
Where the Flask server listens |
The AI bearer token stays server-side — the browser talks only to the local Flask server, which forwards to your AI endpoint. Your token is never exposed to the client.
- Install CouchDB and set an admin user/password.
- Enable CORS so the browser dashboard (served from
:8000) can reach CouchDB (:5984): in Fauxton → Configuration, or via the config API, sethttpd/enable_cors = true,cors/credentials = true, andcors/originsto your dashboard origin(s). - Set the same credentials in the dashboard's CouchDB config block and in
.env.
Point AI_BASE_URL at any OpenAI-compatible gateway. With Ollama, for example:
ollama pull gemma3:12b # a vision-capable model
# expose it behind a token-protected reverse proxy, then set AI_BASE_URL / AI_BEARER_TOKENpython -m pip install -r telegram_bot_requirements.txt
python telegram_bot_poller.pySee TELEGRAM_BOT_SETUP.md for the full guide.
- This project is designed for trusted local networks. Do not expose the dashboard, CouchDB, or the Flask server directly to the public internet without a proper reverse proxy, TLS, and authentication.
- Never commit your
.envor real credentials..gitignoreexcludes them by default. - Set a strong CouchDB admin password.
OptiCell Limited builds monitoring and optimisation technology for controlled-environment agriculture. Learn more at opticell-limited.com.
Released under the MIT License © 2026 OptiCell Limited.
