About GridMate

GridMate is a fully open-source Home Assistant addon that gives you full insight into your home energy usage and helps you minimize costs.

It connects to your existing Home Assistant sensors — smart meters, solar inverters, batteries, appliances — and provides dashboards for real-time monitoring, cost tracking, and automated device scheduling.

How it works

GridMate uses EMHASS (Energy Management for Home Assistant) under the hood for optimization. EMHASS is an open-source optimizer that takes your energy prices, solar forecast, and device constraints to compute the cheapest schedule for your deferrable loads and battery.

Prerequisites

  • A running Home Assistant instance
  • A smart meter integration (e.g., DSMR, P1 Monitor, or similar)
  • For optimization: the EMHASS addon installed in Home Assistant
New to Home Assistant? Follow the official getting started guide to set up your smart home platform first.

Getting Started

Follow these guides in order to configure GridMate step by step:

  1. Installation — Install GridMate in Home Assistant
  2. Energy Feed — Connect your smart meter sensors (required)
  3. Solar Panels — Add solar production and forecast sensors (if applicable)
  4. Devices — Register smart devices for monitoring and automation
  5. Energy Contract — Model your energy pricing for cost calculations
  6. Optimization — Set up EMHASS for automated energy optimization (optional)

Installation

Click the button below to add the GridMate repository to your Home Assistant Add-on Store:

Open your Home Assistant instance and show the add-on store with a specific repository URL pre-filled.

Or manually:

  1. In Home Assistant go to Settings → Add-ons → Add-on Store
  2. Click the three dots in the top right and select Repositories
  3. Add this repository URL: https://github.com/lennertcl/gridmate
  4. Find GridMate in the store and click Install
  5. In the addon Configuration tab, set your Home Assistant Token (long-lived access token)
  6. Start the addon — it will appear as a panel in the sidebar

Energy Feed

Configure your smart meter sensors so GridMate can track energy consumption and injection.

Key Concepts

Consumption vs. Injection
Energy flowing to or from the grid as measured by your smart meter. Consumption = energy bought from grid (grid → home). Injection = energy fed back to grid, typically from solar (home → grid).
Usage vs. Production
Usage = actual energy consumed by your appliances, regardless of source (grid or solar). Production = energy generated by solar panels or other sources.
Power Units
Always configured in kW for instantaneous power measurements.
Energy Units
Always configured in kWh for cumulative energy counters.

Total Energy (Cumulative)

Total Consumption High/Low Tariff
Cumulative kWh counters from your smart meter for energy consumed from the grid, split by tariff period. These are ever-increasing counter sensors (e.g., sensor.electricity_used_tariff_1).
Total Injection High/Low Tariff
Cumulative kWh counters for energy delivered back to the grid, split by tariff period.

Current Power (Live)

Actual Consumption
Instantaneous power being drawn from the grid right now, in kW. Updates every few seconds.
Actual Injection
Instantaneous power being fed back to the grid right now, in kW.

Energy Usage

Usage Mode
Auto: GridMate calculates usage as consumption + production − injection. Requires solar sensors. Manual: Provide a dedicated usage sensor directly.
Actual Usage / Total Usage Sensors
Only needed in manual mode. Provide your own sensor for instantaneous usage (kW) and cumulative usage counters (kWh) per tariff.

Solar Panels

Configure solar production and forecast sensors from your inverter integration.

Solar Panel Sensors

Actual Production
Instantaneous power output of your solar panels in kW. Primary sensor for live dashboards and auto-calculated usage.
Energy Production Today
Cumulative solar energy produced today in kWh. Resets at midnight.
Energy Production Lifetime
Total cumulative solar energy produced over the system's lifetime in kWh.

Solar Estimation Sensors

Forecast sensors provide predicted solar production. Recommended integrations are Solcast or Forecast.solar.

Estimated Actual Production
Predicted power output right now (kW).
Estimated Energy Production Today
Total predicted production for today (kWh).
Estimated Remaining Today
Predicted remaining production until end of day (kWh).
Estimated This Hour / Next Hour
Predicted production for the current and next hour (kWh).
Estimated Tomorrow / Next Day
Predicted values for 24 hours from now.

Devices

Register and configure your smart devices for monitoring and automation.

How Devices Work

Each device has exactly one primary type that determines its main function (e.g. washing machine). A device may also have any number of secondary types that add extra capabilities. Any device type can serve as primary or secondary.

Device Name
A friendly name shown throughout the UI (e.g., "Heat pump", "Volkswagen ID.4").
Primary Type
The main category of the device.
Secondary Types
Additional capabilities. Examples:
  • Washing Machine + Energy Reporting + Deferrable Load → tracked power, optimized scheduling
  • Electric Vehicle + Battery Device + Energy Reporting → battery level and consumption monitoring
  • Home Battery + Battery Device + Energy Reporting → charge/discharge monitoring

Device Types

Washing Machine / Dryer / Dishwasher

Household appliances. Add Energy Reporting Device to track consumption and Deferrable Load for optimized scheduling.

Electric Vehicle

Range Sensor
HA entity reporting estimated driving range (km, optional).
Charging State Sensor
HA entity reporting if the vehicle is currently charging (optional).

Charging Station

Max Charge Rate (kW)
Maximum charging rate (optional).
Session Energy Sensor
HA entity for energy used in current session (kWh, optional).

Water Heater

Temperature Sensor
HA entity reporting water temperature (°C, optional). Ideal candidate for Deferrable Load scheduling.

Electric Heating / Heat Pump

Temperature / Thermostat / COP Sensors
HA entities for temperature, thermostat control, and coefficient of performance (all optional).

Home Battery

Optimization Enabled
Whether this battery participates in EMHASS optimization (default: off).
Max Charge / Discharge Power (kW)
Maximum power the battery can absorb or deliver.
Charge / Discharge Efficiency
Efficiency factors between 0 and 1 (default: 0.95).
Min / Max / Target SOC (%)
State of charge limits (defaults: 20% min, 80% max, 80% target).

Battery Device

Battery Level Sensor
HA entity reporting SOC as percentage (required).
Max Capacity (kWh)
Total usable capacity (required).

Energy Reporting Device

Power Sensor
HA entity reporting current power consumption (kW, required).
Energy Sensor
HA entity reporting cumulative energy (kWh, optional).

Deferrable Load

Makes the device available for EMHASS optimization scheduling.

Nominal Power (W)
Power consumption when active. E.g., 2000W for a water heater.
Operating Duration (hours)
How long the device needs to run per cycle. The optimizer finds the cheapest window.
Constant Power
When enabled, the device always runs at its full nominal power (on/off only). Most household appliances should have this enabled.
Continuous Operation
When enabled, the device runs in one uninterrupted block. When disabled, the optimizer may split operation across cheaper time slots.
Earliest Start / Latest End
The allowed operating window. E.g., 08:00–22:00 prevents overnight operation.
Startup Penalty (€)
Cost penalty per start-up to discourage frequent cycling.
Priority (1–10)
Lower numbers are scheduled first when devices compete for the same cheap slots. Default: 5.

Energy Contract

Model your energy pricing so GridMate can calculate accurate costs and optimize against real prices.

How It Works

Your energy contract is modeled as a list of components. Each component represents one line item on your energy bill.

Component Types

Constant
A fixed fee charged per period regardless of usage. Examples: monthly network fee, yearly grid access fee. Configure: price (€) and period (monthly/yearly).
Fixed
A per-kWh charge at a fixed price. Used for fixed-rate consumption or injection rewards. Configure: price (€/kWh), energy sensor, and whether it's an injection reward.
Variable
A per-kWh charge where the price comes from a dynamic HA sensor (e.g., sensor.nordpool_kwh_be_eur). Formula: multiplier × sensor_price[t] × usage[t] + constant.
Capacity
A charge based on your peak power usage (capacity tariff). Typical in Belgian energy contracts. Billed per kW of your highest 15-minute average demand per period.
Percentage
A percentage surcharge on top of other components. Commonly used for VAT or levies. Select which components it applies to.

Multiplier

Every component has a multiplier (default: 1.0) that scales its contribution. Use this to blend pricing mechanisms, e.g., set two components to 0.5 each for a 50/50 fixed/variable split.

Examples

Simple Fixed-Rate Contract

A basic contract for households with predictable consumption.

Network Fee
Constant €12.00 / month
Energy Consumption
Fixed €0.225/kWh
Solar Injection Reward
Fixed €0.15/kWh injection reward

Combined Fixed + Variable Pricing

Advanced contract combining fixed rates, dynamic pricing, and capacity charges.

50% Fixed Consumption
Fixed €0.07/kWh, multiplier: 0.5
50% Variable Market Price
Variable 1.1 × BELPEX + €0.04/kWh, multiplier: 0.5
Capacity Charge
Capacity €53.00/kW/year
VAT (6%)
Percentage 6% on all components except injection reward

Optimization

Set up EMHASS to automatically find the cheapest schedule for your devices.

Prerequisites

  • Install and start EMHASS from the HA Add-on Store
  • Configure your energy contract
  • If applicable, configure solar panels
  • Add devices with the Deferrable Load type in device settings
  • If applicable, enable optimization on your Home Battery device

EMHASS Connection

EMHASS URL
REST API URL of the EMHASS addon. Can be left blank for autofill.
Actuation Mode
Manual: shows schedule only. Automatic: controls devices directly (coming soon).
Day-Ahead Run Time
Time of day to run the day-ahead optimization (e.g., 05:30 before morning consumption starts).
Enable Optimization
Master switch for automated runs. Manual optimization is always available from the dashboard.

Grid & Load

Max Grid Import (W)
Maximum power to pull from the grid. The optimizer respects this limit.
Max Grid Export (W)
Maximum power to feed to the grid.
Load Power Source
How household base load is provided to the optimizer: via a Home Assistant sensor or a fixed daily schedule with constant power values per time block.

Battery

Battery optimization is controlled per-device. Enable opt_enabled on your Home Battery device. SOC limits and efficiency settings are configured on the device itself. EMHASS currently supports a single battery in optimization.

EMHASS Configuration

GridMate pushes a complete configuration to EMHASS via the set-config API whenever you save settings. Runtime parameters (energy cost forecasts, load power forecasts, current battery SOC) are passed automatically during each optimization call.