Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1,129 Commits

Repository files navigation

SPAN Panel Integration for Home Assistant

Home Assistant Integration for SPAN Panel, a smart electrical panel that provides circuit-level monitoring and control of your home's electrical system.

hacs_badgeGitHub ReleaseGitHub ActivityLicense

PythonRuffMypyprettierprek

The software is provided as-is with no warranty or guarantee of performance or suitability to your particular setting.

IMPORTANT: This integration controls real electrical equipment. Circuit switches open and close physical relays. The GFE override button changes how the panel manages load shedding during power outages. These actions carry the same consequences as operating the panel manually — because they are. Automations can execute these actions without user presence; design them with the same care you would apply to any unattended electrical control. This integration is not a safety device and must not be relied upon for life-safety applications. Use this software at your own risk. If you cannot accept that risk, do not use this software. See LICENSE for the full warranty disclaimer.

The SPAN Client documentation has warnings regarding the use of the API (the API used by this integration) which should be heeded just as if you were using that API directly:

An API client that attempts to implement its own load-shedding decisions, grid-state detection, or other critical automation is operating outside the scope of what SPAN API was designed and engineered for. Such use is entirely at the client developer's and homeowner's own risk and may void the SPAN Panel Limited Warranty. See the SPAN API Scope & Responsibility Model in the SPAN API documentation.

This integration provides sensors and controls for understanding an installation's power consumption, energy usage, and controlling user-manageable panel circuits.

The integration includes a built-in dashboard accessible from the Home Assistant sidebar, providing real-time circuit-level power visualization, current monitoring with configurable alerts, and circuit settings for relays and load shedding. See Frontend Dashboard for details. You can optionally use the span-card Lovelace card for visualization and switch control.

The SPAN Panel Simulator HA App lets you clone your panel's circuit layout for testing, or model an upgrade to evaluate firmware or integration changes in a sandbox before applying them to your real panel.

This integration communicates with the SPAN Panel over your local network using SPAN's official Electrification Bus (eBus) framework — an open, multi-vendor integration standard for home energy infrastructure. eBus uses the Homie Convention for MQTT topics and messages, with the panel's built-in MQTT broker delivering real-time state updates without polling.

1.1.x Integration Sunset (v1)

Users MUST upgrade by the end of 2026 to avoid disruption. Upgrade to the latest 1.1.x version BEFORE upgrading to 2.0.x.

2.0.x Breaking Changes (v2)

Do NOT upgrade unless your panel is running firmware spanos2/r202603/05 or later.

What you need:

  • SPAN Panel firmware spanos2/r202603/05 or later
  • Panel passphrase (found in the SPAN mobile app, On-premise settings) or physical access to the panel door for proof-of-proximity authentication

Breaking:

  • Requires firmware spanos2/r202603/05 or later — panels on older firmware will not work
  • Cellular binary sensor removed — replaced by Vendor Cloud sensor

Running older firmware? See v1 Legacy Documentation.

See CHANGELOG.md for all additions or value changes.

Prerequisites

  • Home Assistant installed
  • HACS installed
  • SPAN Panel with firmware spanos2/r202603/05 or later
  • SPAN Panel integration v1.3.0 or later
  • Panel passphrase (found via the SPAN app) or physical access to the panel door

Installation

  1. Install HACS
  2. Go to HACS in the left side bar of your Home Assistant installation
  3. Search for "Span"
  4. Open the repository and click "Download"
  5. Restart Home Assistant (you will be prompted by a repair notification)
  6. Go to Settings > Devices & Services
  7. Click + Add Integration and search for "Span"
  8. Enter the IP address of your SPAN Panel
  9. The integration detects the panel as v2 and presents an authentication choice:
    • Enter Panel Passphrase — type the passphrase found in the SPAN mobile app under On-premise settings
    • Proof of Proximity — open and close the panel door 3 times, then click Submit
  10. Choose your entity naming pattern
  11. Optionally adjust the snapshot update interval — 0 is real-time, up to 15 seconds based on CPU

Upgrade Process

When upgrading through HACS:

  1. Create a backup of your Home Assistant configuration and database
  2. Review the changes in this README and CHANGELOG
  3. Check your automations — review any references to removed entities
  4. Update during a quiet period when you can monitor the upgrade

If you encounter issues, restore from your backup or check the troubleshooting section below.

Key Terms

The following terms appear throughout this document and in the integration's sensors:

  • Grid-forming entity (GFE) — The power source that sets the voltage and frequency reference for the home. When the utility grid is up, it is the GFE. When islanded on battery, the battery inverter becomes the GFE.
  • Islanded — The home is electrically disconnected from the utility grid and running on its own power source, typically battery. Circuits may be shed to conserve battery life.
  • Microgrid — When the home is islanded, the battery inverter creates a small, self-contained electrical grid for the home. This local grid functions independently of the utility — the inverter generates AC power at the correct voltage and frequency, and the home's circuits run on it just as they would on utility power.
  • Microgrid Interconnect Device (MID) — A switch, part of or alongside the battery system, that disconnects the home from the utility grid during an outage. While open, the panel's sensors can only see the home side.
  • Shedding — Automatically turning off lower-priority circuits to conserve battery during an outage, based on each circuit's configured shed priority.

Entity Reference

Panel-Level Sensors

SensorDevice ClassUnitNotes
Current PowerPowerWTotal panel power (grid import/export)
Feed Through PowerPowerWFeedthrough (non-breaker) power
Main Meter Produced EnergyEnergyWhGrid energy exported
Main Meter Consumed EnergyEnergyWhGrid energy imported
Main Meter Net EnergyEnergyWhConsumed minus produced
Feed Through Produced EnergyEnergyWhFeedthrough energy exported
Feed Through Consumed EnergyEnergyWhFeedthrough energy imported
Feed Through Net EnergyEnergyWhFeedthrough net energy
DSM Statedsm_on_grid (grid connected), dsm_off_grid (islanded), unknown. Derived from multiple eBus signals
Current Run Configpanel_on_grid (grid connected), panel_off_grid (islanded on PV/generator), panel_backup (islanded on battery), unknown
Grid Forming Entity(v2) GRID, BATTERY, PV, GENERATOR, NONE, UNKNOWN. See Grid Forming Entity
Main Relay Stateclosed (power flowing), open (disconnected), unknown
Vendor Cloud(v2) CONNECTED, UNCONNECTED, UNKNOWN
Software VersionFirmware version string

Panel Diagnostic Sensors (v2 only)

SensorDevice ClassUnitNotes
L1 VoltageVoltageVL1 leg actual voltage
L2 VoltageVoltageVL2 leg actual voltage
Upstream L1 CurrentCurrentAUpstream lugs L1 current
Upstream L2 CurrentCurrentAUpstream lugs L2 current
Downstream L1 CurrentCurrentADownstream lugs L1 current
Downstream L2 CurrentCurrentADownstream lugs L2 current
Main Breaker RatingCurrentAMain breaker amperage

Power Flow Sensors (v2 only)

SensorDevice ClassUnitNotes
Grid PowerPowerWGrid power flow
Site PowerPowerWTotal site power (grid + PV + battery)
Battery PowerPowerWBattery charge/discharge (+discharge, -charge). Only when BESS commissioned
PV PowerPowerWPV generation (+producing). Only when PV commissioned

PV Metadata Sensors (v2 only, on main panel device)

SensorDevice ClassUnitNotes
PV VendorPV inverter vendor (e.g., "Enphase", "Other")
PV ProductPV inverter product (e.g., "IQ8+")
Nameplate CapacityPowerkWRated inverter capacity

Deprecated:

SensorReason
DSM Grid StateDeprecated — still available, but users should rely on DSM State as DSM Grid State may be removed in a future version

Power Sensor Attributes

Applies to Current Power, Feed Through Power, Battery Power, PV Power, Grid Power, and Site Power sensors.

AttributeTypeNotes
voltagestringNominal panel voltage ("240")
amperagestringCalculated current (power / voltage)

Software Version Sensor Attributes

AttributeTypeNotes
panel_sizeintTotal breaker spaces (e.g., 32, 40)
wifi_ssidstringCurrent Wi-Fi network

EVSE (EV Charger) Entities

Created automatically when a SPAN Drive or other EVSE is commissioned on the panel. Each EVSE appears as a separate sub-device linked to the panel via via_device. Vendor, product, serial number, and software version are surfaced as device info attributes — not separate entities.

EVSE Device Naming

The EVSE device name includes the panel device name prefix for collision avoidance across multi-panel installations and to support HA's bulk device rename feature. A display suffix differentiates multiple chargers on the same panel:

  • Friendly names (USE_CIRCUIT_NUMBERS=False): suffix is the fed circuit's panel name (e.g., "Garage")
  • Circuit numbers (USE_CIRCUIT_NUMBERS=True): suffix is the EVSE serial number (e.g., "SN-EVSE-001")
  • No suffix available: the display suffix is omitted entirely (no empty parentheses)
Naming ModeExample Device NameExample Entity ID
Friendly namesMain House SPAN Drive (Garage)sensor.main_house_span_drive_garage_charger_status
Circuit numbersMain House SPAN Drive (SN-EVSE-001)sensor.main_house_span_drive_sn_evse_001_charger_status
No suffixMain House SPAN Drivesensor.main_house_span_drive_charger_status

EVSE Sensors (per charger)

SensorDevice ClassUnitNotes
Charger StatusEnumOCPP-based states: AVAILABLE, PREPARING, CHARGING, SUSPENDED_EV, etc. Translated
Advertised CurrentCurrentAAmps offered to the vehicle
Lock StateEnumLOCKED, UNLOCKED, UNKNOWN. Translated

EVSE Binary Sensors (per charger)

SensorDevice ClassNotes
ChargingBattery ChargingON when status is CHARGING
EV ConnectedPlugON when status is PREPARING, CHARGING, SUSPENDED_*, or FINISHING

EVSE Device Info Attributes

AttributeSource
Manufacturervendor-name
Modelproduct-name
Serial Numberserial-number
Software Versionsoftware-version

BESS Sub-Device (v2 only, conditional)

When a Battery Energy Storage System (BESS) is commissioned, the integration creates a separate BESS sub-device linked to the panel via via_device. The BESS device uses manufacturer, model, serial number, and software version from battery metadata as device info attributes.

BESS Sensors

SensorDevice ClassUnitNotes
Battery LevelBattery%State of energy as percentage
Battery PowerPowerWSame entity as Power Flow Battery Power, shown on BESS sub-device
BESS VendorBattery system vendor (diagnostic)
BESS ModelBattery system model (diagnostic)
BESS Serial NumberBattery system serial number (diagnostic)
BESS FirmwareBattery system firmware (diagnostic)
Nameplate CapacityEnergy StoragekWhRated battery capacity (diagnostic)
Stored EnergyEnergy StoragekWhCurrent stored energy (diagnostic)

BESS Binary Sensors

SensorDevice ClassNotes
BESS ConnectedConnectivityWhether the BESS is communicating with panel

Panel Energy Sensor Attributes

Applies to Main Meter and Feed Through energy sensors.

AttributeTypeNotes
voltagestringNominal panel voltage ("240")

Circuit-Level Sensors (per circuit)

SensorDevice ClassUnitNotes
PowerPowerWInstantaneous circuit power (+producing for PV, +consuming otherwise)
Produced EnergyEnergyWhCumulative energy produced
Consumed EnergyEnergyWhCumulative energy consumed
Net EnergyEnergyWhNet energy (sign depends on device type — PV circuits invert)
CurrentCurrentA(v2) Measured circuit current. Only when panel reports current_a
Breaker RatingCurrentA(v2) Circuit breaker amperage (diagnostic). Only when reported

Circuit Power Sensor Attributes

AttributeTypeNotes
tabsstringBreaker slot position(s)
voltagestring120 or 240 (derived from tab count)
always_onboolWhether circuit is always-on
relay_statestringOPEN / CLOSED / UNKNOWN
relay_requesterstringWho requested relay state
shed_prioritystringAPI value: NEVER / SOC_THRESHOLD / OFF_GRID / UNKNOWN
is_sheddableboolWhether circuit can be shed

Circuit Energy Sensor Attributes

AttributeTypeNotes
tabsstringBreaker slot position(s)
voltagestring120 or 240 (derived from tab count)

Binary Sensors

SensorDevice ClassNotes
Door StateTamperPanel door open/closed
Ethernet LinkConnectivityWired network status
Wi-Fi LinkConnectivityWireless network status
Panel StatusConnectivityOverall panel online/offline
Grid Islandable(v2) Whether the panel can island from the grid. Only when reported

Removed from binary sensors:

SensorReason
Cellular (wwan)Replaced by Vendor Cloud sensor (cloud connectivity)

Circuit Controls (per user-controllable circuit)

EntityTypeNotes
BreakerSwitchOn/off relay control
Circuit Shed PrioritySelect(v2) Controls when circuit is shed during off-grid (translated, see below)

Panel Controls

EntityTypeNotes
GFE Override: Grid ConnectedButton(v2) Tell the panel the grid is up when BESS communication interrupted

BESS & Grid Management

This section explains how the SPAN panel manages power sources and load shedding when a Battery Energy Storage System (BESS) is installed, and what the integration can and cannot tell you about grid status.

Grid Forming Entity

The Grid Forming Entity (GFE) sensor identifies which power source provides the voltage and frequency reference for the home — not which source is producing the most watts. When GFE is Grid, the utility grid sets the reference and all circuits remain on, even if 100% of consumption comes from solar. When GFE is Battery, the battery inverter is the reference and circuits are shed based on each circuit's configured shed priority.

GFE ValueMeaning
GRIDPanel is grid-connected (includes generator power, see deep dive)
BATTERYPanel is islanded, running on battery
PVPanel is islanded, running on solar (future)
GENERATORPanel is islanded, running on generator (future)
NONEPanel is islanded with no power source
UNKNOWNState not yet determined or fault condition

When a BESS is installed, the panel relies on the BESS to determine whether the grid is online and to set the GFE accordingly. If BESS communication is lost while the panel is islanded, the GFE value becomes stale — it may show Battery when the grid has actually been restored, causing unnecessary shedding to continue.

What the Panel Can Detect

Grid loss — The panel independently detects grid loss via its own voltage monitoring, even if BESS communication is already lost. The MID is still closed at this point, so the panel's sensors see the real voltage drop and respond immediately.

Grid restoration while islanded — Not detectable by the panel. While the MID is open, the panel's sensors are on the home side and measure only battery-supplied power. Grid restoration on the utility side of the open MID is invisible to any panel-side measurement. This is a physical limitation, not a software gap. A utility-side sensor — such as a current clamp (e.g., Emporia Vue), ATS/MTS contact closure, or any device that can see the grid side of the MID — integrated into Home Assistant as a binary sensor can provide this signal.

DSM State Sensor

The integration's DSM State sensor combines multiple panel signals to provide defense-in-depth for grid status detection. It corroborates the Grid Forming Entity with BESS grid state and power measurements, which adds confidence during transient inconsistencies and detects some edge cases — for example, when BESS communication is lost while on-grid and the grid subsequently drops, the panel self-corrects via voltage detection and the corroborating signals confirm it.

However, when the panel is islanded and the MID is open, all of the panel's signals measure the home side. No combination of panel-sourced data can detect grid restoration in this state. Only an external signal (utility-side sensor) or manual confirmation via the GFE Override button can resolve it.

GFE Override Button

The GFE Override: Grid Connected button tells the panel that the grid is back and shedding can stop. When the BESS restores communication, it automatically reclaims control and the override is superseded — no manual undo is needed.

Risk asymmetry — Telling the panel to shed (conservative direction) is low-risk; worst case is unnecessary circuit disruption. Telling the panel the grid is back when it is not means unmanaged battery drain and reduced runtime, which could affect critical equipment. The battery protects itself by disconnecting when depleted, so there is no overload risk, but runtime will be reduced. Use the override button only with confidence that the grid has actually been restored — via a utility-side sensor or manual confirmation.

WARNING — Do not automate the GFE override button based on DSM State — it inherits the same MID blind spot described above and will read dsm_off_grid even after the grid is restored. Manual confirmation or an external sensor is required before pressing the button.

When bess_connected returns to on, no action is needed — firmware resumes normal GFE management automatically.

For a detailed discussion of failure scenarios, the MID topology, generator and non-integrated BESS behavior, and /set risk analysis, see BESS & Grid Management Deep Dive.

Configuration Options

Snapshot Update Interval

Controls how often the integration rebuilds the panel snapshot from incoming MQTT data. The SPAN panel publishes high-frequency MQTT messages (~100/second), but each individual message is a cheap dictionary write. The expensive operation — rebuilding the full snapshot and dispatching entity updates — is rate-limited by this timer.

  • Default: 1 second
  • Range: 0–15 seconds
  • Set to 0 for no debounce (every MQTT message triggers a snapshot rebuild)
  • Increase on low-power hardware (e.g., Raspberry Pi) to reduce CPU usage

Configure via Settings > Devices & Services > SPAN Panel > Configure > General Options.

Entity Naming Pattern

The integration provides flexible entity naming patterns, configured during initial setup:

  1. Friendly Names (Recommended for new installations)

    • Entity IDs use descriptive circuit names from your SPAN panel
    • Example: sensor.span_panel_kitchen_outlets_power
    • Automatically updates when you rename circuits in the SPAN panel
    • More intuitive for automations and scripts
  2. Circuit Numbers (Stable entity IDs)

    • Entity IDs use generic circuit numbers
    • Example: sensor.span_panel_circuit_15_power
    • Entity IDs remain stable even when circuits are renamed
    • Friendly names still sync from SPAN panel for display

Energy Dip Compensation

SPAN panels occasionally report lower energy readings for cumulative energy sensors after firmware updates or resets. Home Assistant's statistics engine interprets any decrease as a counter reset, creating negative spikes in the energy dashboard.

When enabled, the integration automatically detects these dips and maintains a cumulative offset per sensor so Home Assistant always sees a monotonically increasing value.

  • Default for new installs: ON
  • Default for existing installs: OFF (enable via General Options)
  • Threshold: 1.0 Wh minimum to avoid false triggers from float precision noise
  • Disabling: Clears all accumulated offsets (starts fresh if re-enabled)

When a dip is detected, a persistent notification lists the affected sensors and their dip amounts.

Diagnostic attributes (visible when compensation is active):

AttributeDescription
energy_offsetCumulative Wh compensation applied (when > 0)
last_dip_deltaSize of the most recent dip in Wh

Configure via Settings > Devices & Services > SPAN Panel > Configure > General Options.

Customizing Entity Precision

The power sensors report with the exact precision from the SPAN panel, which may be more decimal places than you need. By default, sensors display with precision 2 (e.g., 0.00), except battery percentage which uses precision 0 (e.g., 39).

You can change the display precision for any entity via Settings > Devices & Services > Entities tab. Find the entity, click on it, click the gear wheel, and select your preferred precision from the "Display Precision" menu.

WebSocket API

The integration provides a span_panel/panel_topology WebSocket command that returns the full physical layout of a panel in a single call — circuits with their breaker slot positions, entity IDs grouped by role, and sub-devices (BESS, EVSE) with their entities.

See WebSocket API Reference for the full schema, response format, and usage examples.

Troubleshooting

IssueSymptomsResolution
Energy Dashboard spikes after firmware updatesHuge energy-consumption spikes after panel firmware updates; charts showing untracked values that dwarf normal usage; negative energy values in statistics. Caused by the panel reporting decreased values on otherwise TOTAL_INCREASING sensors.Prevention: enable Energy Dip Compensation in General Options (on by default for new installs). Fix existing spikes: in Developer Tools → Statistics, search for the affected sensor (e.g. sensor.span_panel_main_meter_consumed_energy) and use Adjust sum to correct the errant entry. The integration also notifies when a decrease in the main meter consumed sensor is detected.
High CPU usageElevated CPU on low-power hardware (e.g. Raspberry Pi). The integration rebuilds a full panel snapshot from MQTT messages at a configurable interval (default 1 s).Increase Snapshot Update Interval in General Options. 10–15 s is recommended for resource-constrained systems. Setting it to 0 disables debouncing and rebuilds on every MQTT message — not recommended.
Replaced sub-device shows the old serial numberAfter replacing a SPAN sub-device (Drive / EVSE, BESS, PV inverter), the device entry in Home Assistant keeps showing the previous hardware's serial number. The integration keys entities off the panel-assigned node identity, which is intentionally stable across hardware swaps so long-term history (e.g. lifetime charging kWh for a Drive) is preserved. The device-registry serial number, however, does not auto-refresh.In Settings → Devices & Services → Span Panel, open the affected sub-device and delete it, then reload the integration (or restart Home Assistant). The device re-registers with the new serial number. Entity IDs and their recorded history are preserved.
Door sensor unavailableThe SPAN API returns UNKNOWN if the cabinet door has not been operated recently. This is a defect in the SPAN API.The integration reports the sensor as unavailable until a proper value arrives. Opening or closing the door publishes the correct state. The door is classified as a tamper sensor (Detected / Clear) to differentiate it from a normal entry door.
No switch on a circuitA circuit has no switch entity exposed in Home Assistant.The circuit is configured in the SPAN App as one of the "Always on Circuits". The API does not permit user control of those circuits, so no switch is created.

Development

See Developer Documentation for setup instructions, prerequisites, and tooling.

License

This integration is published under the MIT license.

Attribution and Contributions

This repository is set up as part of an organization so a single committer is not the weak link. The repository is a fork in a long line of SPAN forks that may or may not be stable (from newer to older):

  • SpanPanel/span (current GitHub organization, current repository, currently listed in HACS)
  • SpanPanel/Span (was moved to SpanPanel/SpanCustom)
  • cayossarian/span
  • haext/span
  • gdgib/span
  • thetoothpick/span-hacs
  • wez/span-hacs
  • galak/span-hacs

Additional contributors:

  • pavandave
  • sargonas
  • NickBorgersOnLowSecurityNode

Issues

If you have a problem with the integration, feel free to open an issue, but please know that issues regarding your network, SPAN configuration, or home electrical system are outside of our purview.

For those motivated, please consider offering suggestions for improvement in the discussions or opening a pull request. We're generally very happy to have a starting point when making a change.

About

Default SPAN Integration for HomeAssistant/HACS

Topics

Resources

Stars

45 stars

Watchers

7 watching

Forks

Releases

Used by

Contributors

Languages