Skip to content

Automation Blueprints

Ravi Singh edited this page May 1, 2026 · 1 revision

Automation Blueprints

The integration ships pre-built HA automation blueprints for the most-asked-for use cases. Install in one click via the HA Blueprints UI — customize entities + thresholds via dropdowns. No YAML editing required for newcomers.

Available blueprints (v0.6.0+)

🔔 Low water alert

Notify when a tank's level drops below a threshold. Includes cooldown to prevent spam.

Source: blueprints/automation/smartghar/low-water-alert.yaml

Inputs:

  • Tank level sensor (entity)
  • Alert threshold % (default: 20)
  • Notification service (e.g. notify.mobile_app_iphone)
  • Cooldown minutes (default: 60)

Behavior: Fires when level drops below threshold AND stays below for ≥1 minute (debounce). Cooldown prevents re-fires within the configured window.

✅ Refill confirmation

Notify when a tank's fill_complete event fires (auto-detected refill).

Source: blueprints/automation/smartghar/refill-confirmation.yaml

Inputs:

  • Fill event entity (e.g. event.smartghar_<hub>_tank_<n>_fill_event)
  • Notification service

Behavior: When the integration's auto-detection sees a tank level rise ≥5%, fires the configured notification with delta percentage and volume in litres.

How to install a blueprint

1. Settings → Automations & scenes → Blueprints
2. Click "Import Blueprint" (top right)
3. Paste the URL of the YAML file:
   https://github.com/Techposts/smartghar-homeassistant/blob/main/blueprints/automation/smartghar/low-water-alert.yaml
4. Click "Preview blueprint" → "Import blueprint"
5. Click "Create automation" on the imported blueprint
6. Fill in the dropdowns
7. Save

That's it. Blueprints are reusable — you can create multiple automations from the same blueprint with different inputs (e.g. one alert per tank).

Writing your own blueprint

If you build a custom automation that others might want, contribute it back. Open a GitHub PR adding a new file under blueprints/automation/smartghar/. Follow the patterns in the existing two — the boilerplate at the top (blueprint: block with name, description, domain, source_url, input) is the important part.

Common community-relevant patterns we'd accept:

  • TX battery critical alert (when v0.7.0 ships the binary_sensor)
  • Hub offline watchdog
  • Pump dry-run protection (cross-integration with Shelly relays)
  • Refill cost tracking (using smartghar.refill_marker service)

See Contributing for general PR guidelines.

Blueprints planned for v0.7.0

These are slated for the next release once a small batch of supporting binary_sensors lands:

Blueprint What it does Why it's globally relevant
tx-battery-critical Notify when a TX battery drops below 3.5 V Universal — every TX is battery-powered
hub-offline-watchdog Notify when hub goes unavailable for 5+ min Universal — hub down = no telemetry
pump-dry-run-protect Auto-disable a Shelly relay when sump tank empties Off-grid + RV + agricultural users worldwide

See the v0.7.0 plan in the project's auto-memory for the full design.

Pre-blueprint approach (manual YAML)

If you want to write the same logic without using a blueprint:

alias: Drinking water below 20%
trigger:
  - platform: numeric_state
    entity_id: sensor.smartghar_<hub>_tank_1_level
    below: 20
    for: "00:01:00"
condition:
  - condition: template
    value_template: >
      {{ trigger.from_state.state | float(100) >= 20 }}
action:
  - service: notify.mobile_app_my_phone
    data:
      title: 💧 Low water alert
      message: >
        Drinking tank at {{ states('sensor.smartghar_<hub>_tank_1_level') }}%.
mode: single

The blueprint version is functionally equivalent but parameterized. Both work.

Clone this wiki locally