Skip to content

Releases: Techposts/smartghar-homeassistant

v0.8.0 — Buzzer alerts + sensor health binary sensors

23 May 12:58

Choose a tag to compare

v0.8.0 — Buzzer alerts + sensor health binary sensors

Three-surface parity for the buzzer feature: HA users can now toggle
the hub's audible alerts, change the volume profile, and preview alert
patterns directly from Home Assistant — same controls the PWA and the
hub's local web UI already had.

Two long-overdue per-tank binary sensors land too:

  • sensor_not_responding (ultrasonic failed to echo)
  • sensor_stuck (constant reading regardless of actual water level)

Requires hub firmware rx-v2.8.4+ for buzzer entities. Older firmware
silently skips them (no permanent-unavailable clutter — the integration
just doesn't register the entity). Sensor_error works from rx-v2.8.0+;
sensor_stuck from rx-v2.8.3+.

  • switch.smartghar__buzzer_alerts — master mute (CONFIG category).
    Off silences every alert except the boot tone, which always plays on
    power-up (matches hub local web UI behavior).

  • select.smartghar__buzzer_volume — Quiet / Standard / Loud.
    Applies uniformly to every alert.

  • smartghar.test_buzzer service — preview an alert pattern.
    Bypasses master_enable + quiet hours. Useful for "does the buzzer
    work" smoke tests + confirming volume choice.

  • binary_sensor.smartghar_tank_sensor_not_responding
    PROBLEM device class, DIAGNOSTIC category. True when the TX is alive
    but its ultrasonic sensor failed to echo on the last read.

  • binary_sensor.smartghar_tank_sensor_stuck
    PROBLEM device class, DIAGNOSTIC category. True when the sensor has
    reported a constant value across 20 wakes regardless of water level
    — typical of a defective JSN-SR04M / AJ-SR04M module.

  • MAC-anchored unique_id + async_migrate_entry. Renaming live unique_ids
    breaks HA entity history (entity_id derives from unique_id), so this
    deserves its own release with careful migration paths for users on
    rx-v2.7.10+ (MAC available) vs pre-v2.7.10 (legacy numeric id).

  • Coordinator entity cleanup when devices disappear from /api/v1/devices.

  • Optional "Unpair tank" button.

  • No config migration. Existing entities preserve their unique_id and history.

  • Buzzer entities register only when the hub responds to /api/v1/hub/buzzer
    (rx-v2.8.4+). OTA-update the hub first if you want buzzer controls in HA.

  • Sensor health binary sensors register for every tank regardless of firmware.
    Pre-v2.8.0 firmware doesn't emit the field; the entities read Off
    permanently — no false positives.

The integration's icon will appear in HA's Settings → Devices & Services
card once home-assistant/brands#10365 merges
(typically 1-3 days). No integration change required after merge —
HA pulls the icon from brands.home-assistant.io automatically.

v0.7.2 — honour info.stream contract (gate WS startup + use declared path)

08 May 11:46

Choose a tag to compare

Bug-fix release on top of v0.7.1. No new entities, no breaking changes — closes a contract-correctness gap discovered during code review.

What's fixed

v0.7.1 hardcoded the WebSocket path to /api/v1/stream and started the WS task unconditionally. That broke the smartghar protocol promise that info.stream.ws_path (added in schema 1.1) is the source of truth for where the integration should connect.

Two concrete bugs:

  1. Hubs that declare a different ws_path were ignored. Future products advertising e.g. /api/v2/events would never be followed even though the spec says they should be.
  2. Hubs that don't declare info.stream at all (TankSync schema 1.0 hubs, or future opt-out-of-push products) still got WS connection attempts → 404 → exponential backoff capped at 60s → infinite reconnect loop, polluting HA logs with one failed connect per minute, forever.

What changed

  • coordinator.start_ws() now reads info.stream.ws_path from the cached /api/v1/info. If present and valid → spawn the WS task using that path. If absent → log once at INFO level ("Hub … does not declare info.stream — staying on polling-only mode") and don't spawn anything. The 30s polling channel handles all updates as before.
  • client.connect_ws(ws_path) accepts the path explicitly. Default kept for backward compat, but coordinator now passes the contract-declared path.
  • Logs now show which path was used: "WS connected to hub … at /api/v1/stream" — better diagnostics when debugging future products.

Compat

Firmware Before After
AmbiSense ≥ v6.2.0-alpha.4 (schema 1.1) WS push works WS push works (same path, same behaviour)
TankSync schema 1.0 (no info.stream) Reconnect loop every minute, log spam Polling-only, clean logs
Future product with custom ws_path Would silently fall back to polling Connects at the declared path

Pairs with AmbiSense firmware ≥ v6.2.0-alpha.4. No firmware changes required.

How to install

HACS users: SmartGhar → ⋮ → Redownload → 0.7.2 → Restart HA.

No need to delete + re-add the integration entry this time — the change is internal to the WS code path; device registry is untouched.

v0.7.1 — topology-aware rendering + WS event frames

07 May 15:10

Choose a tag to compare

What's new

Two architectural fixes for cross-product fleet support, plus a cleanup sweep.

Topology-aware device rendering

The integration now reads info.topology from the hub's /api/v1/info (introduced in smartghar protocol schema 1.1) and dispatches via two helpers in the new device_info.py:

  • hub_device_info(coordinator) — hub-level entities (OTA-available, LED brightness, uptime, firmware update)
  • subdevice_device_info(coordinator, dev, sub_model=..., fallback_name=...) — kind-specific entities (presence, tank, future lock/power)

For topology: "standalone" (AmbiSense), sub-device entities collapse onto the hub's HA card → one device shown in Settings → Devices. For topology: "hub" (TankSync), each sub-device renders as its own HA device with via_device link → unchanged behavior. Older firmware without the field defaults to "hub" for backwards compatibility.

Net effect for AmbiSense users: AmbiSense now shows as a single HA device with all radar/presence/diagnostic entities under it, instead of the previous "AmbiSense Hub" + "Presence Sensor" two-card split.

WebSocket event frames

coordinator._handle_ws_msg now dispatches three frame kinds:

  • hello — schema validation (existing)
  • snapshot — full hub + devices state, periodic (existing)
  • event — single-device state delta, applied immediately (new)

event frames let event-driven kinds (locks, gas leaks, doorbells) update HA in <100 ms without waiting for the next snapshot tick. AmbiSense doesn't emit them yet (3 s snapshot is fast enough for occupancy), but RidgeSync will.

Cleanup

  • Drop MODEL_HUB = MODEL_HUB_TANKSYNC alias — three platforms hardcoded it, which mislabeled AmbiSense as TankSync regardless of info.product
  • hub_model_for_product fallback: unknown products → MODEL_HUB_GENERIC (was silently → TankSync)
  • Drop dead info.get("hub_name") or f"SmartGhar Hub (...)" fallbacks in 8 sites — schema 1.1 makes hub_name a required field
  • Same dead fallback removed from config_flow.py
  • update.py release notes: product-agnostic copy (was TankSync-specific "TX devices keep transmitting")
  • PROTOCOL_VERSION bumped 1.0 → 1.1

Pair with

  • AmbiSense firmware ≥ v6.2.0-alpha.4 — required for topology + stream fields and the /api/v1/stream WS endpoint
  • TankSync hub firmware — works as-is on protocol 1.0 (defaults to topology: "hub" rendering)

Installation

HACS

If you already have the integration installed: HACS → Integrations → SmartGhar → ⋮ → Redownload → 0.7.1.

Fresh install via HACS

HACS → Integrations → ⋮ → Custom repositories → Add https://github.com/Techposts/smartghar-homeassistant as Integration → install.

After install

  1. Restart Home Assistant
  2. Settings → Devices & Services → SmartGhar → ⋮ → Delete (clears cached topology data from old version)
  3. Wait ~30 s for zeroconf re-discovery, or click + Add Integration → SmartGhar and enter the device IP

Documentation

Full protocol spec at https://github.com/Techposts/AmbiSense/blob/main/docs/SMARTGHAR-PROTOCOL.md (schema 1.1 section).

Architectural decisions: D-009 (topology field) and D-010 (split WS endpoints) at https://github.com/Techposts/AmbiSense/blob/main/docs/DECISIONS.md.

v0.7.0 — AmbiSense presence support

07 May 13:51
f09c049

Choose a tag to compare

What's new

The integration is no longer TankSync-only. AmbiSense (radar presence + LED follow-me) on firmware v6.2.0-alpha.2+ is auto-discovered and rendered as a fully native HA device alongside any TankSync hubs on the same network.

Added

  • Presence sub-device support (DEVICE_KIND_PRESENCE)
    • binary_sensor: occupancy with stationary, target_count, nearest_cm, seconds_since_seen as attributes
    • sensor: distance (cm), target_count, seconds_since_seen (diagnostic), rssi_dbm (diagnostic, disabled by default)
  • Hub model dispatch — AmbiSense devices show as "AmbiSense Hub", TankSync as "TankSync Hub", anything else as "SmartGhar Hub"
  • New translations: occupancy, presence_nearest, presence_target_count, presence_seconds_since_seen, presence_rssi

Multi-device

  • Two AmbiSense units on one network → two distinct HA devices, zero entity-id collisions. hub_id (derived from MAC) is the integration's primary key.
  • AmbiSense + TankSync co-existing → both render correctly with their respective product labels.

Backward compatibility

  • No breaking changes for TankSync. MODEL_HUB constant preserved as alias to MODEL_HUB_TANKSYNC.
  • Older AmbiSense firmware (no product field in /api/v1/info) falls back to TankSync labelling — degrades gracefully but update firmware to v6.2.0-alpha.2+ for the full presence experience.

Fixed

  • HACS validation: dropped invalid keys (iot_class, documentation, issue_tracker, _iot_class_note) from hacs.json — those belong in manifest.json (where they already correctly are).
  • HACS validation: added brand assets at custom_components/smartghar/brand/icon.png + icon@2x.png.
  • HACS validation: added repo topics (hacs, home-assistant, local-push, smartghar, tanksync, ambisense, etc.).

Spec reference

SmartGhar protocol v1.0 — wire contract, device-kind taxonomy, "adding a new product" checklist for future Techposts products (RidgeSync, PowerSync, etc.).

Install

HACS → Integrations → ⋮ → Custom repositories → URL https://github.com/Techposts/smartghar-homeassistant, Category Integration → Update.

Then restart HA. AmbiSense units on v6.2.0-alpha.2+ auto-discover.

v0.6.1 — Hub address fix (HAOS-on-Proxmox / Docker bridge)

01 May 13:21

Choose a tag to compare

Critical fix for users hitting MDNS lookup failed / Timeout while contacting DNS servers errors.

What this fixes

If you saw an error like:

Cannot connect to host tanksync-f6dc.local:80 ssl:default
[MDNS lookup failed, Timeout while contacting DNS servers]

…it's because v0.3.1 stored the hub's .local hostname, expecting the OS resolver to translate it on every request. On HAOS-in-Proxmox, Docker bridge networking, and some VLAN setups, that resolution path is unreliable.

v0.6.1 stores the hub's IP address instead. aiohttp talks to it directly. No per-request mDNS lookup.

DHCP resilience is preserved

DHCP changes are still handled transparently — zeroconf re-discovery fires when the hub re-broadcasts (boot, WiFi reconnect, periodic mDNS announce — typically within 1 hour). The integration's existing _abort_if_unique_id_configured(updates={CONF_HOST: new_ip}) line auto-updates the stored IP without user action.

If you're hit by this

  1. Settings → Devices & Services → SmartGhar → ⋮ → Delete
  2. Settings → System → Restart Home Assistant
  3. Re-add via auto-discovery (or manually with the hub's IP)

After this, the integration stores the IP and works reliably.

Changelog

CHANGELOG.md

v0.6.0 — Energy dashboard + refill_marker + blueprints

01 May 13:04

Choose a tag to compare

Three globally-useful additions: HA Energy dashboard integration, manual refill logging, and one-click automation blueprints.

✨ Highlights

💧 HA Energy dashboard integration

New sensor.tank_<n>_water_consumed per tank — device_class: water + state_class: total_increasing. Configure under Settings → Energy → Water consumption to get HA's native daily/weekly/monthly consumption charts, just like electricity/gas. Persists across HA restarts.

📝 smartghar.refill_marker service

Manually log a refill (volume, source, cost, note). Fires a smartghar_refill_marker HA event for automations to act on. Useful when auto-detection misses a fast fill, or when you want to track tanker cost / vendor.

🎯 Two automation blueprints

  • low-water-alert — one-click "notify when tank below X%" with cooldown
  • refill-confirmation — one-click notification when fill_complete fires

Install: HA → Settings → Automations & scenes → Blueprints → Import Blueprint → paste blueprint URL.

Why globally relevant

Open-core deployment means SmartGhar's user base extends well beyond Indian customers. Energy dashboard integration matters for off-grid (well + storage tank), RV/boat, agricultural, drought-sensitive areas, and sustainability-conscious users worldwide. Most water-tank integrations can't do consumption tracking because they lack continuous metering data; the SmartGhar protocol's continuous level + capacity gives us exactly that.

Algorithm note

Consumption sensor uses a 0.5% noise floor — drains below that don't update the baseline immediately, but accumulate across ticks. Real consumption is captured; sensor noise is filtered. Fills reset the baseline without incrementing.

Full changelog

CHANGELOG.md

v0.5.0 — Identify, reboot, diagnostic tuning, friendlier copy

01 May 12:30

Choose a tag to compare

Power-user feature drop with friendlier UI copy.

✨ New entities

Entity Where What it does
Identify button Per hub Blinks the hub's status LED (~1.5 s) — find which hub is which
Identify button Per tank Blinks the tank's specific LED — works with hub strips of 8+ LEDs
Reboot button Per hub (diagnostic) Cleanly restarts the hub. Unreachable for ~30 s.
TX sleep interval Per tank (diagnostic) 60–3600 s. Battery vs freshness tradeoff.
TX samples per wake Per tank (diagnostic) 1–10 readings averaged.
LoRa TX power Per tank (diagnostic) 1–22 dBm. Range vs battery.

Diagnostic-category entities sit in HA's Diagnostic section under each device card — visible to power users, hidden from casual dashboards.

🧹 Friendlier UI copy

The zeroconf confirmation dialog used to explain MAC + DHCP behaviour at length. Now it's simply: "Add this hub to Home Assistant?" — what 99% of users actually need.

🎨 Lovelace card decision

Made it explicit: no native smartghar-lovelace custom card planned. The community fluid-level-background-card + our tank-silhouette.svg covers the visual need today. See docs/lovelace-beautification.md.

We'll revisit if (a) PowerSync ships and a unified multi-product visual is needed, or (b) the community-card setup proves friction-heavy.

Requires

Hub firmware rx-v2.7.0 Phase 1.4 (the identify + reboot endpoints). On older firmware those buttons silently fail; the rest of the integration is unaffected.

Full changelog

CHANGELOG.md

v0.4.0 — Beautification + native firmware-update UX

01 May 11:56

Choose a tag to compare

Visual polish + UX upgrade. Brings HA-native firmware-update treatment, the missing computed sensors that fluid-level cards need, and a comprehensive guide for making your tanks look amazing.

✨ Highlights

🌊 Wavy-water fill animation guide

docs/lovelace-beautification.md walks you through the popular lovelace-fluid-level-background-card setup with copy-paste YAML. Pairs with the new transparent tank-silhouette.svg in assets/ — drop it into your /config/www/ and your tanks render with proper rooftop-tank shape + animated fill.

🆕 HA update entity per hub

Firmware OTA now appears in HA's sidebar Updates section with a native Install button — same UX as HACS, ESPHome, Tasmota updates. Click Install → hub flashes + reboots in the background.

💧 Tank water volume sensor

New sensor.tank_<n>_water_volume (litres) — computed from capacity × level%. Lets you display "X / Y L" alongside the percentage and feeds visual cards that need a volume value.

What's coming in v0.5.0+

A native smartghar-lovelace custom card with brand-consistent capsule visualization will live in a separate repo. Until then, the community fluid-level card paired with our tank silhouette gets you the same look.

Migration

Existing installs upgrade cleanly — the new entities just appear after restart. The OTA binary_sensor is preserved for backwards compatibility (you can disable it if you prefer the new update entity only).

Full changelog

CHANGELOG.md

v0.3.1 — DHCP resilience + broken icon fix

01 May 11:49

Choose a tag to compare

Polish release fixing the things users hit on first install of v0.3.0.

Fixed

🌐 DHCP-resilient hub addressing

Zeroconf flow now stores the mDNS hostname (tanksync-XXXX.local) instead of the resolved IP. The hostname is MAC-derived and stable across DHCP lease renewals — your hub keeps working when the router rotates IPs.

🖼️ Broken icon in HACS UI

README + info.md icon switched from relative SVG path to absolute raw.githubusercontent.com PNG. HACS's README rendering can now resolve and display the SmartGhar icon properly.

📝 Zeroconf form {name} placeholder

The confirmation form was showing literal {name} instead of the hub name. Copy rewritten — drops the brittle placeholder and adds explicit reassurance about DHCP changes.

📡 LoRa signal visible by default

The per-tank LoRa signal sensor is now visible out-of-the-box. It's the field most users actually want to monitor — "is my TX still close enough to the hub?".

Migration

Existing v0.3.0 installs are fine. Re-discovery via zeroconf will replace the stored IP with hostname automatically. To force-update immediately, remove and re-add the hub.

Changelog

CHANGELOG.md

v0.3.0 — Real-time push via WebSocket

01 May 11:33

Choose a tag to compare

Highlights

  • iot_class: local_push. Integration subscribes to the hub's /api/v1/stream WebSocket and receives state updates every ~3 seconds.
  • Brand icon added (SVG + 256px / 512px PNGs).
  • Three new entity types: binary_sensor for OTA-available, event for fill_complete, plus full diagnostics download for bug reports.
  • Multi-hub native — each hub auto-discovers, gets its own device card, entities namespaced by hub_id.

What's new

Type What it does
WebSocket push Subscribes to /api/v1/stream; pushes state every ~3s. Falls back to 30s polling if WS drops.
binary_sensor per hub Firmware update available indicator with HA's update device class
event per tank fill_complete fires when level rises ≥5% between coordinator ticks — automation-ready
Diagnostics Settings → Devices & Services → SmartGhar → Download diagnostics (redacts host / hub_id / token)
Icon First brand identity for the integration (assets/icon.svg)

Requirements

Hub firmware rx-v2.7.0 with Phase 1.3 (CONFIG_HTTPD_WS_SUPPORT=y + /api/v1/stream WebSocket endpoint). Older firmware silently falls back to polling-only — WS task fails to connect and just retries quietly.

Installation

HACS → Integrations → ⋮ → Custom repositories → add https://github.com/Techposts/smartghar-homeassistant (Integration) → Download → Restart HA.

After restart, your hub should auto-discover via mDNS. If it doesn't, add manually via Settings → Devices & Services → Add Integration → SmartGhar.

See docs/installation.md for detailed steps and troubleshooting.

Full changelog

CHANGELOG.md