Skip to content

Repository files navigation

🌱 OptiCell Dashboard

Self-hosted monitoring & control for hydroponic growing systems

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.

License: MIT Python CouchDB Made by OptiCell

opticell-limited.com

OptiCell Dashboard — System Overview


Overview

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)

Features

  • 📊 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

Tech stack

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

Prerequisites

Quick start

# 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.py

Then 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) or start_all.bat (server + Telegram bot).

Configuration

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.

CouchDB

  1. Install CouchDB and set an admin user/password.
  2. Enable CORS so the browser dashboard (served from :8000) can reach CouchDB (:5984): in Fauxton → Configuration, or via the config API, set httpd/enable_cors = true, cors/credentials = true, and cors/origins to your dashboard origin(s).
  3. Set the same credentials in the dashboard's CouchDB config block and in .env.

AI server

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_TOKEN

Telegram bot (optional)

python -m pip install -r telegram_bot_requirements.txt
python telegram_bot_poller.py

See TELEGRAM_BOT_SETUP.md for the full guide.

Security notes

  • 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 .env or real credentials. .gitignore excludes them by default.
  • Set a strong CouchDB admin password.

About OptiCell

OptiCell Limited builds monitoring and optimisation technology for controlled-environment agriculture. Learn more at opticell-limited.com.

License

Released under the MIT License © 2026 OptiCell Limited.

About

Self-hosted hydroponic monitoring dashboard - Flask + CouchDB + AI plant analysis + Telegram bot. By OptiCell (opticell-limited.com)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages