Skip to content

About

A fully self-contained smart irrigation dashboard card for Home Assistant

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

💧 Sprinkler Dash Card

A fully self-contained smart irrigation dashboard card for Home Assistant. Zero YAML scripting required — install the card, create your zone duration helpers, and everything else is configured and auto-created from within the card UI.

Version HACS HA License


Support the Project

Buy Me A Coffee


Screenshots

Main Card Zones & Info Bar Schedule
Main Zones Schedule
Skip Next Run Zone Expand Popup Settings — General
Skip Next Run Zone Expand Settings 1
Settings — Rules & Info Bar
Settings 2

Features

Zero setup scripting

  • Auto-creates script.sprinkler, the Scheduler entity (defaults to Mon/Wed/Fri at 06:00), one timer.sprinkler_zone_N per zone, and automation.sprinkler_controller on first load (admin user)
  • Auto-creates required helpers: skip list, run queue, rain pause, manual run log
  • Everything silently rebuilds whenever zones or rules are changed, reordered, or toggled

Runs in Home Assistant, not in your browser (v3)

  • Every zone gets a restoring HA timer. Whenever a zone turns on — schedule, Manual Run, the zone toggle, the eWeLink/Sonoff app, or any other automation — the controller arms its timer and closes the valve when it runs out
  • Scheduled runs are held in a persistent queue (input_text.sprinkler_queue). If HA restarts mid-run, the running zone still stops on time and the remaining zones carry on
  • Valve-close is verified and retried up to 3 times, with a notification if a valve will not close
  • A once-a-minute watchdog arms a timer for any zone found running without one
  • Closing the dashboard, switching views, or a phone going to sleep can no longer leave a zone running

Zone control

  • Up to 12 configurable zones — 2-column grid with toggle, progress bar, countdown timer, and 1-minute adjustable duration
  • Zone expand popup — tap any zone tile to open a large overlay with big +/− duration buttons, status, last activity, and a Manual Run button
  • Manual Run auto-stop — pick a duration for this run only (the scheduled duration is not changed); the zone's HA timer closes the valve, even if the browser is closed or HA restarts
  • Zone last-run badge — shows "last: Xm/Xh/Xd ago" on each tile
  • Live countdown from the zone's HA timer, "Up next / Queued #n" badges during a schedule run
  • Per-zone schedule toggle — tick/untick each zone to include or exclude from scheduled runs
  • Per-zone skip next run — one-tap skip for the next run only, self-clearing after the schedule fires

Schedule management

  • Built-in scheduler section — enable/disable, set run days, set run time with mobile-friendly HH/MM editor
  • Smart next-run countdown — shows "Tonight 22:00", "Tomorrow 06:00", or "in 3h 45m"
  • Start Schedule button — manually triggers the full zone sequence
  • Stop Schedule button — clears the run queue and closes all valves (with confirmation)

Run history

  • Last Run popup — reads HA history for the most recent scheduled run and shows how long each zone actually watered (short runs highlighted), plus zones still queued, skipped, or that did not run
  • Skipped zones and zones with no recent activity are shown in their own sections, so a zone that's quietly stopped running (e.g. toggled off, disconnected) is surfaced instead of hidden
  • Manual runs are logged separately with a 🔧 icon, the duration used, and how long ago they ran — persisted via an auto-created helper so they survive page refreshes

Info bar

  • 4 configurable header slots — label, searchable MDI icon (7000+ with live preview), up to 2 sensors each
  • Weather entities auto-render with condition and temperature
  • Dual-sensor slots use unified dash separator (e.g. 4,650L - 97%, Possible - 55%)
  • All values title-cased automatically
  • Tap any slot to open the entity detail popup

Automation rules

  • Rain auto-disable — schedule turns off when rain crosses the configured mm threshold (runs in HA; slot turns yellow)
  • Rain auto-restore — schedule re-enables after the configured hours once rain is back below the threshold; more rain restarts the countdown. Only restores a pause the rain rule caused — a schedule you switched off yourself stays off
  • Pause countdown — schedule section shows "rain pause · resumes in Xh Xm"
  • Tank low-level shutoff — all valves close and the queued run is cancelled when the tank drops below the configured % (runs in HA)
  • Confirmation popups — optional confirmation before any zone or schedule action

Settings & persistence

  • All settings saved via HA websocket — survives hard refresh and works in sections layout
  • Drag-to-reorder zones — script run order matches
  • Searchable entity picker for all entity fields
  • Version number visible in settings header

Requirements

  • Home Assistant 2023.1+
  • Scheduler Component integration (via HACS)
  • One input_number helper per zone for duration (see Step 2)

Installation

Option 1: HACS Custom Repository (Recommended - Takes 30 seconds)

  1. Open HACS in Home Assistant
  2. Click Frontend in the sidebar
  3. Click the ⋮ (three dots) in the top right corner
  4. Select "Custom repositories"
  5. Paste this URL: https://github.com/HybridRCG/sprinkler-dash-card
  6. Select "Lovelace" as the category
  7. Click "Create"
  8. The card should now appear in HACS — click Install
  9. Hard refresh your browser (Ctrl+Shift+R on Windows, Cmd+Shift+R on Mac, or open DevTools and long-press refresh)

That's it! You're done. Go to any dashboard and add the card with:

type: custom:sprinkler-dash-card-v2

Note: The card is pending approval for the HACS default store. Once approved, you'll be able to search and install directly without adding a custom repository. For now, custom repository is the fastest way to get started.

Option 2: Manual Installation

  1. Download sprinkler-dash-card.js from the latest release
  2. Copy it to /config/www/sprinkler-dash-card.js on your Home Assistant server
  3. Go to Settings → Dashboards → Resources
  4. Click the + Create New Resource button
  5. Paste: /local/sprinkler-dash-card.js
  6. Set Resource Type to JavaScript Module
  7. Click Create
  8. Hard refresh your browser

Now add the card to any dashboard:

type: custom:sprinkler-dash-card-v2

Setup Guide

Step 1 — Add the card

type: custom:sprinkler-dash-card-v2

That's the only YAML needed. All configuration is done inside the card via ⚙️.


Step 2 — Create duration helpers

Go to Settings → Helpers → Add → Number and create one per zone:

Helper Min Max Step Unit
input_number.valve_1_time 0 60 1 min
input_number.valve_2_time 0 60 1 min
...
input_number.valve_8_time 0 60 1 min

Create up to valve_12_time for up to 12 zones.


Step 3 — Install Scheduler Component

Install Scheduler Component via HACS (Integration category).

The card auto-creates script.sprinkler and the Scheduler entity on first load. Adjust the run days and time directly on the card's Schedule section.


Step 4 — Configure zones in ⚙️

  • Set Active Zones (1–12)
  • For each zone: set Switch Entity (valve switch) and Duration Entity (input_number from Step 2)
  • Drag ⠿ to reorder — script run order matches
  • Tick checkbox to include zone in scheduled runs
  • Tap 💾 Save when done

Step 5 — Configure settings in ⚙️

Setting Description
Nav path Where tapping the title navigates
Rain sensor Precipitation sensor in mm
Rain limit mm above which schedule auto-disables
Rain restore Hours before schedule re-enables after rain clears (default 48h)
Weather Any weather.* entity
Jojo sensor Water tank litres sensor
Jojo low % Tank % below which all zones shut off immediately
Schedule switch The switch.schedule_* entity (auto-detected)

Step 6 — Configure info bar in ⚙️

4 slots, each with: enable checkbox, label, MDI icon (searchable, live preview), Sensor 1, Sensor 2.

Layout auto-adjusts: 1=full, 2=50/50, 3=3-col, 4=2×2. Tap any slot to open entity detail.


Step 7 — Automation rules in ⚙️

Rule Behaviour
Confirm before activating Confirmation popup on all zone/schedule actions
Rain: Auto-disable schedule Disables schedule when rain exceeds limit
Rain: Auto-restore schedule Re-enables schedule after rain clears (configurable hours)
Jojo: Low-level zone shutoff Closes all valves when tank drops below low %

Skip Next Run

Tap the 📅 calendar icon on any zone to skip it for the next run only. The zone shows an amber dashed border and "Skip next run" status. After the next schedule run, the skip clears automatically.

The card auto-creates input_text.sprinkler_skip_zones to track this — no setup needed.


Run History

Tap Last Run to see what happened during the most recent scheduled run.

  • Timestamp — when the schedule last triggered (from script.sprinkler's last_triggered attribute)
  • Watered — actual on-time per zone from HA's recorder history (up to 6 hours after start). Zones that ran noticeably shorter than configured are shown in amber, e.g. 6m 46s of 9m
  • Still queued — zones waiting their turn while a run is in progress
  • Skipped / not scheduled — zones marked "skip next run" or excluded from the schedule
  • Did not run — zones that should have run but show no activity (or are unavailable)
  • Manual Runs — any zones run manually via the zone expand popup, shown with a 🔧 icon, the duration used, and how long ago it ran. This is stored in an auto-created input_text.sprinkler_manual_log helper so it survives page refreshes.

No manual setup is required — the manual run log helper is created automatically on first load.


Support


Changelog

Version Changes
v3.0.4 FIX: Rain pause countdown now runs from the last rain, not from the moment rain crossed the limit — every further rain increment restarts it. While rain is still falling the schedule shows "raining · resumes Xh after it stops".
v3.0.3 Info bar: the tank slot keeps its 4,650 L - 95% format and low-level warning colour when Sensor 2 is the sensor chosen in Jojo level % (e.g. a stable template sensor), not only *liquid_level* sensors.
v3.0.2 Jojo low % is now the single source of truth — the controller uses the card setting for the tank shutoff. New settings: Jojo level % (pick the level sensor the shutoff watches — e.g. a smoothed/stable template sensor) and Notify (e.g. notify.whatsapp) for tank-low and stuck-valve alerts. Rain limit / Rain restore / Jojo low % now save as soon as you change them (previously only via 💾 Save).
v3.0.1 FIX: Tank low-level shutoff now requires the level to stay below the threshold for 2 minutes. Level sensors can glitch (e.g. 48% → 30% → 48% within seconds); a single bad reading used to cancel runs / switch the schedule off.
v3.0.0 MAJOR — watering now runs inside Home Assistant. Fixes: (1) a HA restart mid-schedule killed script.sprinkler, so the remaining zones never ran — runs now use a persistent queue and resume after a restart; (2) Manual Run relied on a browser setTimeout, so closing the dashboard, switching view or a sleeping phone left the zone on — every zone now has a restoring timer.sprinkler_zone_N and the auto-generated automation.sprinkler_controller closes the valve; zones switched on from the toggle or the Sonoff app now auto-stop too; (3) skip-list and manual-log helpers were created with an initial value, so HA wiped them on every restart — the card now repairs them; (4) cancelling a confirm popup left its OK handler attached, so the next confirm could also fire the cancelled action; (5) rain auto-restore only ran while a dashboard was open and could re-enable a schedule you (or the tank shutoff) had turned off; (6) rain/tank rules fired service calls every second from every open browser. Also: valve-close verify + retry with notification, per-minute watchdog, countdowns from HA timers, "Queued" badges, Last Run shows actual watered time from history, Manual Run duration no longer changes the scheduled duration.
v2.9.75 FIX (correctness): Last Run no longer assumes every configured zone ran. It now checks each zone's switch last_changed against the scheduled run's time window and only lists a zone under "Watered" if it actually toggled near that run. Zones with no activity near the run show separately under "No recent activity" with how long ago they last changed — surfaces zones that silently stopped running (e.g. toggled off) instead of hiding it.
v2.9.74 NEW: Manual run history now PERSISTS across page refreshes! Added input_text.sprinkler_manual_log helper (auto-created) that saves each manual run. Loaded automatically on card startup, so manual runs stay visible in Last Run even after reloading the page.
v2.9.73 Added manual run display back to Last Run. Shows both scheduled runs (with all zones) and recent manual runs (with 🔧 icon, duration, timestamp). Perfect combo!
v2.9.72 COMPLETE REWRITE: Last Run completely rewritten. Bulletproof fallback to script.sprinkler.last_triggered. Shows all configured zones + durations. Simple, direct, no fancy logic. This version WILL work!
v2.9.71 FIX: Last Run now simply shows all configured zones with durations, regardless of activity detection. No more complex filtering logic that missed zones. Shows what SHOULD have run based on config, not what activity detection thinks ran. Much more reliable!
v2.9.70 REVERT: Simplified Last Run back to v2.9.68 approach. Removed multi-run history feature (too complex). Now uses scheduler's last_triggered as fallback. Shows current + recent activity clearly. Coming back to this later with better implementation.
v2.9.69 Multi-run history feature (reverted)
v2.9.68 POLISHED: Last Run now clearly separates SCHEDULED RUNS from MANUAL RUNS. Scheduled zones show configured duration. Manual runs show a 🔧 icon and actual duration + timestamp. Crystal clear what was what!
v2.9.67 IMPROVED: Last Run now anchors to scheduler's last_triggered time instead of 2-hour window. Shows all zones that ran since last scheduled run. Detects activity up to 24 hours back. Much more reliable zone activity tracking!
v2.9.66 NEW: Last Run now shows duration! Manual runs display the duration you set (e.g., "12m • 1h ago"). Scheduled runs show configured duration from zone helpers. Fully tracks what each zone actually ran for.
v2.9.65 HOTFIX: Fixed syntax error in v2.9.64 (apostrophe in string). Card now loads without configuration error!
v2.9.64 FIX: Last Run now bulletproof with debug logging + fallback detection. Checks multiple attribute names, falls back to script.sprinkler. Shows zone activity timestamps in human-readable format (5m ago, 2h ago, etc). Check browser console for debug info if still not working.
v2.9.63 MAJOR: Zone modal now has BIG +/− buttons for duration adjustment. Manual zone runs now AUTO-STOP after the set time, then restore original duration. No more manual turn-off needed!
v2.9.62 NEW: Click any zone card to pop out zone details modal — shows status, duration, last activity, and quick turn on/off button. Brings back the zone expand feature!
v2.9.61 Added version footer to settings panel for easy version checking
v2.9.60 COMPLETE REWRITE: Last Run now bulletproof — reads from scheduler's last_triggered attribute instead of error-prone JSON storage. Detects zone activity from switch timestamps. No more "Could not read last run" errors!
v2.9.59 HOTFIX: Fixed Jinja template syntax in script delay — changed from max() filter to simpler or 1 logic. Zones now properly execute with correct delays
v2.9.58 FIX: Zone runs now have minimum 1-minute delay (prevents stuck zones with 0-duration). UI now initializes with actual entity values instead of default 10
v2.9.57 NEW: Smart Resume — on HA restart, detects running zones and resumes from elapsed time (prevents over-watering). Automatically stops zones that exceeded duration, lets others finish normally
v2.9.56 Fixed zone duration input increments — all zones now step by 1 minute (not 5)
v2.9.55 Automation rule descriptions now dynamically read config values after save — Jojo shutoff threshold, rain threshold, and rain restore hours show correct saved values
v2.9.54 Fixed time picker input width & height — no more cut-off numbers on desktop or mobile
v2.9.53 NEW: Time picker is now a beautiful popout modal with large hour/minute spinners — tap time → modal appears → adjust with ▲/▼ or type → tap Save to close and apply changes
v2.9.52 Fixed next-run countdown label — shows "in Xh Xm" instead of "Tonight" for clarity
v2.9.51 Replaced broken time picker with proper dual-spinner UI for desktop & mobile
v2.9.50 and earlier Foundational features: auto-created script/scheduler, zone grid with progress bars and duration steppers, per-zone schedule toggle and skip-next-run, rain auto-disable/auto-restore with seasonal hours, Jojo low-level shutoff, zone run order badges, manual zone timer with auto-stop, mobile-friendly time editor, drag-to-reorder zones, websocket-persisted settings, confirmation popups, and the original ring-buffer run history. See full release history for the complete list.
v2.0.0 Auto-creates script and Scheduler; zone schedule toggle; sticky settings
v1.0.0 Initial release

Buy Me A Coffee


License

MIT © HybridRCG

About

A fully self-contained smart irrigation dashboard card for Home Assistant

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages