Skip to content

Energy dashboard ​

The integration gives you lifetime energy counters for the battery, and for solar on Venus A and Venus D. This page shows where each one belongs on Home Assistant's Energy dashboard. Use it when you set up the dashboard for the first time, or when your battery's charging shows up as grid import.

Add Marstek to the Energy dashboard ​

Open Settings > Dashboards > Energy, then:

  1. Home battery storage: add Total grid input energy as energy going in to the battery and Total grid output energy as energy coming out of the battery. Despite their names, these count energy through the battery's own AC connection, not your house's grid connection. From Home Assistant 2026.10 the usage graph draws each battery's discharge on its own, and these two sensors are what that series reads.
  2. Electricity grid: use your house meter, for example a P1 or utility-meter integration. If your Marstek CT meter reports them, Meter input energy and Meter output energy work too. Compare them with your utility meter once to confirm which is import and which is export.
  3. Solar panels (Venus A and Venus D): see Venus A and Venus D: solar and the battery row first.
  4. Leave Total load energy off this dashboard. What it measures differs between models and firmware.

Earlier versions of this page were wrong

They said to add Total grid input and output energy as grid consumption and return to the grid. That makes every charge count as grid import and every discharge as grid export. If you set it up that way, move the two sensors to Home battery storage and pick a house meter for the grid.

Screenshots of the battery's own Energy tab, which is a different view of the same battery counters, are in the visual tour.

Venus A and Venus D: solar and the battery row ​

On Venus A and Venus D, solar power goes in through the battery and out through the same AC connection. So Total grid output energy includes solar that went straight to the house. If you add both Total solar energy under Solar panels and the battery counters under Home battery storage, that solar is counted twice. Pick one:

  • Solar matters most: add Total solar energy under Solar panels and leave the battery row out.
  • The battery matters most: add the battery counters and leave solar out.

Why the names say "grid" ​

Marstek's Open API calls the battery's AC connection its grid side, so its counters are named total_grid_input_energy and total_grid_output_energy. Tests against Marstek's firmware in an emulator, with no CT meter attached, show them counting the battery's own charge and discharge (firmware analysis). The Battery health card labels the same counters Charged from AC and Delivered to AC. They include inverter losses, so output is lower than input.

Technical details ​

You don't need the rest of this page to set up the dashboard. It explains units, the firmware quirks the integration corrects, and a few templates.

To be accepted by the Energy dashboard, a sensor must have device_class: energy, state_class: total or total_increasing, and a unit such as Wh or kWh. All the energy sensors below meet that.

Why Wh instead of kWh ​

The integration shows energy totals in watt-hours (Wh). 1000 Wh is 1 kWh, the unit on your electricity bill. The Energy dashboard accepts both, so you don't have to convert anything.

The battery itself reports some totals in other units, and those units differ between models and firmware. The integration converts each one to Wh for you.

Technical details

Open API energy fields are not all Wh on the wire. Each field is normalized individually:

FieldTypical wire unitHome AssistantWhen the scale applies
total_pv_energy0.01 kWh on Venus A firmware 1487 (app 148.7) and 149, Venus D 149, and known families at 150+; Wh on older firmwareWh (raw × 10 when 0.01 kWh)Venus A at 1487+ (#35); Venus D at 149+; known families at 150+. Venus A 148 / 148.3 stays Wh.
total_grid_input_energy / total_grid_output_energyWhWh (never scaled with PV)Always
total_load_energyWhWhAlways
EM.GetStatus input_energy / output_energy0.1 Wh from Control generation 148Wh (raw × 0.1)Known family that serves EM.GetStatus at generation 148+; sensors omitted when the fields are absent

0.01 kWh is a wire encoding, not a custom Home Assistant unit. Energy dashboard eligibility still requires device_class: energy, state_class: total or total_increasing, and a supported unit such as Wh or kWh (Energy FAQ).

Energy totals mapping ​

Dashboard inputEntity nameEntity keyUnit
Home battery storage: energy inTotal grid input energytotal_grid_input_energyWh
Home battery storage: energy outTotal grid output energytotal_grid_output_energyWh
Solar production (Venus A, D)Total solar energytotal_pv_energyWh
Grid import or export (CT meter, if reported)Meter input energyem_input_energyWh
Grid import or export (CT meter, if reported)Meter output energyem_output_energyWh

NOTE

Some Marstek firmware versions can stop updating the grid input and output energy counters while the battery is still charging or discharging. When that happens, the integration fills in the missing energy from the battery's power (on_grid_power) between updates, so the totals keep counting up. It keeps the corrected total when Home Assistant restarts. Impossible spikes (above 1 GWh, or more than 5 MWh in one poll) are ignored on every lifetime energy total so they cannot freeze the Energy dashboard at a bogus value.

NOTE

total_load_energy is reported by the Marstek Open API as load or off-grid energy, and its semantics vary by device and firmware. The integration does not recommend it as the Energy dashboard's home consumption source.

Meter input and output energy are measured at the CT meter, so they describe your house's grid connection. The Total grid input and output energy counters above describe the battery. The meter sensors only exist when your battery reports them.

On firmware 148 and newer these counters are stored in 0.1 Wh steps. Older releases showed them 10 times too high. History already in the Energy dashboard stays at that old size, and the first corrected reading is a large drop. Home Assistant treats a drop of 10% or more as a new meter cycle, so that hour can show a spike. Adjust it under Developer tools > Statistics.

Technical details

Meter input/output energy (em_input_energy / em_output_energy) come from the existing fast-tier EM.GetStatus payload when the device reports those lifetime totals. From Control generation 148 the wire unit is 0.1 Wh; Home Assistant exposes watt-hours. Older generations leave a present value unscaled. Unlike the ES counters above, they describe the grid connection. The sensors are omitted when the fields are absent.

Solar energy unit correction ​

This section only matters if your Total solar energy history started before the integration corrected the solar unit. That affects Venus A firmware 149 and other firmware that reports solar energy in 0.01 kWh steps. Older history from those batteries is about 10 times too low, and the first corrected value shows up as one large jump in solar production. That jump is not a meter reset. If the Energy dashboard shows inflated production for that moment, fix it in Developer tools > Statistics (see below).

Technical details

On Venus A firmware 149, ES.GetStatus.total_pv_energy is encoded as 0.01 kWh on the wire (issue #35). That is the solar energy counter, not PV1 power (#57). Known families at firmware 150+ use that solar unit too. Venus A firmware 148 (148.3) or older keeps the value in Wh. PV1 stays deciwatts through 150.9 and is not used here.

The integration converts the 0.01 kWh wire unit to Wh (raw × 10) so a device value of 25742 becomes 257420 Wh (257.42 kWh). Grid and load totals in the same payload stay in Wh and are not scaled.

The Total solar energy entity keeps its existing BLE-MAC unique ID and native unit Wh. After this correction, previously recorded solar states remain about 10× too low. The first corrected state is a large upward jump, not a meter reset: Home Assistant treats a drop of 10% or more in a total_increasing sensor as a new meter cycle (smaller drops are ignored as noise), while an increase is added to long-term statistics and can look like a one-time production spike.

Do not treat that jump as a reset. Review and adjust the transition in Developer tools > Statistics if the Energy dashboard shows inflated production for that interval. See Home Assistant's Statistics tab and the total_increasing state class.

Optional power sensors ​

These show what is happening right now, in watts. The Energy dashboard doesn't need them. Use them for live dashboard cards and to check that the numbers make sense. (They use state_class: measurement.)

Sensor useEntity nameEntity keyUnit
Solar powerPV powerpv_powerW
Battery AC powerOn-grid powerongrid_powerW
Grid power at the CT meterTotal powerem_total_powerW
Battery powerBattery powerbattery_powerW

Unit conversion ​

Home Assistant accepts both Wh and kWh for energy sensors, so conversion is optional. If you prefer kWh, convert by dividing by 1000.

Template examples (Wh to kWh) ​

Replace <battery> with your battery's entity ID prefix, which comes from its device name (for example venus_e_3_0). These examples create kWh sensors that can be selected in the Energy dashboard.

yaml
template:
  - sensor:
      - name: "Marstek total solar energy kwh"
        unique_id: marstek_total_pv_energy_kwh
        state: "{{ (states('sensor.<battery>_total_solar_energy') | float(0)) / 1000 }}"
        availability: "{{ is_number(states('sensor.<battery>_total_solar_energy')) }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
      - name: "Marstek total grid input energy kwh"
        unique_id: marstek_total_grid_input_energy_kwh
        state: "{{ (states('sensor.<battery>_total_grid_input_energy') | float(0)) / 1000 }}"
        availability: "{{ is_number(states('sensor.<battery>_total_grid_input_energy')) }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing
      - name: "Marstek total grid output energy kwh"
        unique_id: marstek_total_grid_output_energy_kwh
        state: "{{ (states('sensor.<battery>_total_grid_output_energy') | float(0)) / 1000 }}"
        availability: "{{ is_number(states('sensor.<battery>_total_grid_output_energy')) }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing

Entity ID examples ​

Home Assistant builds entity IDs from the device name and the sensor name. Replace <battery> with your battery's prefix, and check the exact ID on the entity's settings.

Energy totals ​

  • sensor.<battery>_total_solar_energy
  • sensor.<battery>_total_grid_input_energy
  • sensor.<battery>_total_grid_output_energy
  • sensor.<battery>_meter_input_energy (when reported)
  • sensor.<battery>_meter_output_energy (when reported)

Power sensors ​

  • sensor.<battery>_pv_power
  • sensor.<battery>_on_grid_power
  • sensor.<battery>_total_power
  • sensor.<battery>_battery_power

Other device-reported totals ​

  • sensor.<battery>_total_load_energy

References ​