-
Notifications
You must be signed in to change notification settings - Fork 3
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.
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.
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.
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).
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_markerservice)
See Contributing for general PR guidelines.
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.
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: singleThe blueprint version is functionally equivalent but parameterized. Both work.
Built by SmartGhar · GitHub · Discussions · MIT licensed (code) / Apache-2.0 (protocol)