Skip to content

Multi Hub Setup

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

Multi-Hub Setup

The integration is designed for households with multiple hubs — a Rooftop hub for the main building, a Garden hub for irrigation, a Farmhouse hub at a second property, etc. Each hub appears as its own Home Assistant device, so management stays clean as you scale.

How it works

Each hub broadcasts its own _smartghar._tcp.local. mDNS service with a unique hub_id. Home Assistant's zeroconf scanner fires a discovery event per hub independently. You'll see something like:

🔔 New devices discovered:
   • SmartGhar Hub at 192.168.1.42
   • SmartGhar Hub at 192.168.1.51
   • SmartGhar Hub at 192.168.0.30

Click each one to add it. Each becomes a separate config entry under the SmartGhar integration. No coordination logic in the integration — HA handles multi-device hubs natively.

Entity naming

Entity unique IDs always include the hub's MAC-derived hub_id, so multiple hubs never collide:

Hub Tank Entity ID
Rooftop (a1b2c3d4) Drinking sensor.smartghar_a1b2c3d4_tank_1_level
Rooftop (a1b2c3d4) Bath sensor.smartghar_a1b2c3d4_tank_2_level
Garden (5e6f7a8b) Irrigation sensor.smartghar_5e6f7a8b_tank_1_level
Farmhouse (9c0d1e2f) Sump sensor.smartghar_9c0d1e2f_tank_1_level

The visible entity name combines the hub's user-set name and the tank's user-set name, so in HA's UI you'll see "Rooftop Drinking Level", "Garden Irrigation Level", etc.

When you rename a hub or tank in the SmartGhar PWA or hub web UI, the change propagates to HA via the WebSocket config_changed event — no manual sync needed.

Areas

When configuring each hub, HA suggests a default area. We recommend mapping each hub to a distinct HA area for cleaner dashboards and automations:

  • Rooftop Hub → "Roof" or "Rooftop" area
  • Garden Hub → "Garden" or "Outdoor" area
  • Farmhouse Hub → "Farmhouse" area

Each tank can be in its own area too. For example, Drinking Tank in "Kitchen" area, Bath Tank in "Bathroom" area — both still belong to the same hub device.

Lovelace dashboard examples

Single-hub default (HA auto-generates)

Each hub gets a device card under Settings → Devices & Services → SmartGhar. The auto-generated dashboard shows all entities for that hub. No custom cards needed.

Multi-hub vertical stack

type: vertical-stack
cards:
  - type: entities
    title: Rooftop Hub
    entities:
      - sensor.smartghar_a1b2c3d4_tank_1_level
      - sensor.smartghar_a1b2c3d4_tank_2_level
      - sensor.smartghar_a1b2c3d4_uptime
  - type: entities
    title: Garden Hub
    entities:
      - sensor.smartghar_5e6f7a8b_tank_1_level
      - sensor.smartghar_5e6f7a8b_uptime
  - type: entities
    title: Farmhouse Hub
    entities:
      - sensor.smartghar_9c0d1e2f_tank_1_level
      - sensor.smartghar_9c0d1e2f_uptime

Aggregate "total water across all hubs"

Add to configuration.yaml:

template:
  - sensor:
      - name: "Total household water"
        unit_of_measurement: "%"
        state: >
          {% set tanks = [
            states('sensor.smartghar_a1b2c3d4_tank_1_level') | float(0),
            states('sensor.smartghar_5e6f7a8b_tank_1_level') | float(0),
            states('sensor.smartghar_9c0d1e2f_tank_1_level') | float(0)
          ] %}
          {{ (tanks | sum / tanks | length) | round(1) }}

Then expose it on Lovelace:

type: gauge
entity: sensor.total_household_water
min: 0
max: 100
severity:
  red: 0
  yellow: 25
  green: 50

Auto-discovery using auto-entities

If you have auto-entities (HACS frontend card), this automatically lists every SmartGhar tank across all hubs:

type: custom:auto-entities
card:
  type: entities
  title: All SmartGhar tanks
filter:
  include:
    - integration: smartghar
      attributes:
        device_class: water
sort:
  method: state
  numeric: true
  reverse: true

Add a hub later? It auto-appears in this list — no YAML edit needed.

Tips

Different time zones (multi-property)

If your Farmhouse is in a different time zone than your main home, set up two HA areas with their respective time zones via HA's Customize. Insights / automations scoped per area can then respect local time.

Different Wi-Fi networks

Each hub talks only to HA on its own LAN. If your Farmhouse hub is on a separate VLAN, ensure HA can reach that subnet (or run a satellite HA at the Farmhouse and federate).

Identifying the right hub physically

Use the button.smartghar_<hub>_identify entity — it blinks the hub's status LED for ~1.5 seconds. Useful when "is this Rooftop or Garden?" comes up while debugging hardware.

For per-tank identification: button.smartghar_<hub>_tank_<n>_identify blinks that tank's specific LED. Requires hub strip ≥8 LEDs.

Energy dashboard with multiple tanks

Add each tank's sensor.tank_<n>_water_consumed as a separate water source under Settings → Energy → Water consumption. The dashboard sums them in totals view; you can also filter to per-tank views in HA's Statistics.

Common questions

Q: Will the same TX be discovered twice if it talks to two hubs?
No. A TX is paired to exactly one hub. If you re-pair it to a different hub, the old hub's tank entity becomes unavailable; the new hub gets the entity.

Q: Can two hubs share the same tank?
No. The pairing is one-to-one (one TX → one hub). If you want redundancy, that's a separate product question — currently not supported.

Q: Does multi-hub increase WebSocket load?
Each hub maintains its own WebSocket connection to HA. Three hubs = three connections, each pushing snapshots every ~3 seconds. Negligible network load (maybe 5 KB/min total).

Clone this wiki locally