A custom Home Assistant integration that provides energy usage, cost, and meter data from National Grid utility accounts. It uses the aionatgrid library to communicate with National Grid's API.
This integration polls your National Grid account once per hour and creates sensor and binary sensor entities for each meter linked to your account, giving you visibility into your electricity and gas billing data directly in Home Assistant.
- Open HACS in your Home Assistant instance.
- Go to Integrations and select the three-dot menu in the top right corner.
- Select Custom repositories.
- Add the URL
https://github.com/ryanmorash/ha_nationalgridwith category Integration. - Find National Grid in the HACS integration list and click Download.
- Restart Home Assistant.
- Download the
custom_components/national_gridfolder from this repository. - Copy the
national_gridfolder into your Home Assistantconfig/custom_components/directory. - Restart Home Assistant.
Configuration is done entirely through the Home Assistant UI.
- Go to Settings > Devices & Services > Add Integration.
- Search for National Grid.
- Enter your National Grid account username and password.
- If your account has multiple billing accounts linked, select which accounts to monitor. If only one account is linked, it is selected automatically.
| Parameter | Description |
|---|---|
| Username | Your National Grid online account email or username |
| Password | Your National Grid online account password |
| Selected Accounts | Which linked billing accounts to monitor (shown only if multiple accounts exist) |
- Go to Settings > Devices & Services.
- Find the National Grid integration entry.
- Click the three-dot menu and select Delete.
- Optionally, remove the
custom_components/national_gridfolder and restart Home Assistant.
The integration creates the following entities for each meter on your account:
| Entity | Description | Unit | Device Class |
|---|---|---|---|
| Last Billing Usage | Most recent monthly billing usage | kWh (electric) / CCF (gas) | Energy / Gas |
| Last Billing Cost | Most recent monthly billing cost | $ | Monetary |
| Entity | Description | Category |
|---|---|---|
| Smart Meter | Whether the meter is an AMI smart meter | Diagnostic |
The integration polls National Grid's API every hour. Each update fetches:
- Billing account information and meter details
- Energy usage records for the last 12 months
- Energy cost records for the current billing period
- AMI (smart meter) energy usage data for meters that support it
- Interval reads (15-minute granularity) for electric smart meters
The integration imports external statistics into Home Assistant's recorder on every update. These statistics can be used in the Energy dashboard and for long-term trend analysis.
| Statistic ID | Description | Unit | Source Data |
|---|---|---|---|
national_grid:{service_point}_electric_hourly_usage |
Electric hourly AMI usage | kWh | AMI smart meter readings |
national_grid:{service_point}_gas_hourly_usage |
Gas hourly AMI usage | CCF | AMI smart meter readings |
national_grid:{service_point}_electric_interval_usage |
Electric 15-minute interval usage (aggregated to hourly) | kWh | Electric interval reads |
{service_point} is replaced with your meter's service point identifier (e.g. SP1).
To add these to the Energy dashboard, go to Settings > Dashboards > Energy and select the relevant statistics under Electricity grid or Gas consumption.