Skip to content

feat: configurable nutrient dosing schedule with safety guards and Telegram - #30

Draft
m0nk1111 wants to merge 1 commit into
masterfrom
feature/nutrient-schedule
Draft

feat: configurable nutrient dosing schedule with safety guards and Telegram#30
m0nk1111 wants to merge 1 commit into
masterfrom
feature/nutrient-schedule

Conversation

@m0nk1111

Copy link
Copy Markdown
Collaborator

Summary

Generic hydroponic/aquaponic nutrient dosing schedule function. Configurable for any nutrient brand or feeding chart — not tied to any specific product line.

Features

  • 1-8 configurable pumps: Each pump has its own Mycodo output selection, name, and ml/min calibration
  • JSON feeding schedule: User provides a JSON object mapping week number to an array of ml/L values per pump. Supports any feeding chart.
  • Auto-calculated grow week: From a configurable cycle start date
  • Safety features:
    • Flow sensor check with retry/deferral logic (configurable retries and interval)
    • EC pre-check with configurable maximum threshold
    • Per-pump overdose protection with configurable safety factor (default 1.5×)
    • Daily dose tracking prevents double-dosing
  • First-week ramp-up: Configurable percentage (default 50%) for gentle start
  • Telegram notifications: Optional dose summaries and error alerts
  • Custom commands: Dose Now, Show Schedule, Reset First-Week Flag
  • Dashboard widget: function_status_always() for persistent display even when deactivated
  • InfluxDB logging: Per-pump dose volumes logged for graphing

Schedule Format Example

{
  "1": [2.0, 2.0, 0.0, 2.0, 0.0],
  "2": [2.0, 2.0, 2.0, 2.0, 0.0],
  "3": [2.0, 2.0, 2.0, 2.0, 0.0],
  "4": [2.0, 0.0, 2.0, 2.0, 0.0],
  "5": [2.0, 0.0, 2.0, 2.0, 2.0],
  "6": [0.0, 0.0, 0.0, 2.0, 2.0],
  "7": [0.0, 0.0, 0.0, 0.0, 0.0]
}

Each key is a week number, each value is an array of ml/L/week per pump index (0-based). Week 7 = flush week (all zeros).

Testing

Tested in production on RPi 4B + Mycodo v8.16.2 managing 5 dosing pumps in a hydroponic NFT system running 24/7 for 4+ weeks.

Checklist

  • No hardcoded UUIDs or installation-specific values
  • No brand-specific references
  • All strings in English
  • GPL-3.0 license header
  • Uses lazy_gettext for translatable labels
  • Valid Python syntax
  • Follows Mycodo custom function conventions
  • Unit tests (to be added before upstream PR)

Generic hydroponic nutrient schedule function supporting:
- 1-8 configurable output pumps with per-pump ml/min calibration
- JSON-based weekly feeding schedule (week -> ml/L per pump)
- Auto-calculated grow week from configurable start date
- Flow sensor check with retry/deferral logic
- EC pre-check with configurable maximum threshold
- Overdose protection with configurable safety factor (default 1.5x)
- First-week ramp-up at configurable percentage
- Daily dose tracking with persistent state
- Optional Telegram notifications with dose summary
- Custom commands: dose_now, status_now, reset_first_week
- function_status_always() for persistent dashboard widget
- InfluxDB dose logging per pump channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants