Skip to content

feat: nutrient bottle level tracker with progress bars and Telegram alerts - #31

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

feat: nutrient bottle level tracker with progress bars and Telegram alerts#31
m0nk1111 wants to merge 1 commit into
masterfrom
feature/nutrient-bottle-tracker

Conversation

@m0nk1111

Copy link
Copy Markdown
Collaborator

Summary

Tracks remaining liquid levels in nutrient bottles by monitoring how much each dosing pump has dispensed. Provides visual progress bars in the Mycodo dashboard and sends Telegram alerts when bottles need refilling.

Features

  • 1-8 configurable bottle/pump slots: Each with Mycodo output selection, bottle capacity (ml), and ml/min calibration
  • Visual progress bars: Color-coded (green >25%, yellow >10%, red ≤10%) in Function Status widget
  • Telegram alerts: Configurable threshold (default 15%) with repeat suppression (default 6h)
  • Reset commands: "Reset All Bottles" + individual per-bottle reset buttons
  • Persistent state: Bottle placement timestamps and usage survive restarts
  • Dashboard widget: function_status_always() works even when function is deactivated
  • InfluxDB logging: Remaining ml per bottle written as measurement channels

Dashboard Widget Preview

The function status shows colored bars per bottle:

Pump A (Nutrient A): ████████████████░░░░ 82.3% (823 / 1000 ml)
Pump B (Nutrient B): ████████░░░░░░░░░░░░ 41.5% (415 / 1000 ml)
Pump C (pH Down):    ████░░░░░░░░░░░░░░░░ 18.2% (91 / 500 ml)  ⚠️

Testing

Tested in production on RPi 4B + Mycodo v8.16.2 tracking 8 dosing pumps over 4+ weeks.

Checklist

  • No hardcoded UUIDs or installation-specific values
  • 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 bottle level tracking function for hydroponic/aquaponic setups:
- 1-8 configurable pump/bottle slots with per-pump ml/min calibration
- Visual progress bars (green/yellow/red) in dashboard widget
- Telegram alerts when bottle level drops below configurable threshold
- Per-bottle and bulk reset commands for refills
- Persistent state across restarts
- function_status_always() for always-visible dashboard widget
- InfluxDB logging of remaining ml per bottle
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.

2 participants