Skip to content

Custom Lovelace card for Home Assistant to visualize Marstek B2500d (and other solar storage systems).

Notifications You must be signed in to change notification settings

Neisi/b2500d-card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

53 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

hacs hacs

B2500D-Card | The Solar Storage Card

A Home Assistant Custom Card for the Marstek B2500d storage system.

Since you can also define individual entities and options, this card is suitable for other storage systems as well!

Large Card:

Example card

Compact Card:

Example card 2

๐Ÿš€ Features

Inspired by the Marstek app, this custom card displays the values of your B2500d storage system โ€“ or, optionally, if the corresponding entities are available, any other storage system.

๐Ÿ’ก Status Visualization

The card displays the current charging/discharging status at the top.
The status also shows the current battery level in %.

Status Meaning
still Battery is neither charging nor discharging.
charging Battery is charging (solar power available and greater than output power, battery not full).
discharging Battery is discharging (output power greater than input power, battery > 0%).

Cards

The following values/cards can currently be displayed:

Large Card

  1. Current solar power total and input 1 & input 2

Solar power

  1. Current total output power

Output power

  1. Battery level / capacity

Battery

  1. Daily power generation

Power generation

You can also configure the following modes:

  1. Charging mode (simultaneous charge/discharge vs. full charge before discharge)
  2. Discharge mode (auto/manual)
  3. Surplus feed-in (on/off)

Mode

Each of these cards can optionally be hidden (see section Parameters).

Note: The settings card is hidden by default when using entities mode.

Compact Card

This card cannot be customized.

Example card 2

โš™๏ธ Installation

Optional Dependencies

Optionally, the b2500d-card works best with a device provided by this add-on:

This way, you can easily pass the whole device, as the card uses the standard entities.
For this, use the device parameter.

If entities have been renamed, this method wonโ€™t work. You can still pass individual entities manually (see Parameters section).

HACS

Community Store

The card is available in HACS (Home Assistant Community Store).

Add HACS Repository

Custom Repositories

  1. Open HACS
  2. Frontend โ†’ top right menu โ†’ Custom Repositories โ†’ Neisi/b2500d-card
  3. Select type: Dashboard
  4. Install

Manual Installation (without HACS)

  1. Copy b2500d-card.js to /config/www/
  2. Add it in Lovelace:
resources:
  - url: /local/b2500d-card.js
    type: module

๐Ÿ› ๏ธ Parameters

Here are the available parameters for this Lovelace card.

๐Ÿ”’ Required Parameters

You must provide exactly one of the following parameters:

Name Type Description
device string The name of your device. Example: if the sensor for battery percentage is sensor.speicher_1_links_battery_percentage, then <speicher_1_links> is the device name.
entities object A collection of individual entities if you donโ€™t want to provide a full device. In this mode, the settings card is hidden automatically by default.

๐Ÿ“ฆ entities Object

If you provide individual entities instead of device, the object looks like this:

Key Type Description
battery_percentage string Battery charge sensor (%)
battery_capacity string Available battery capacity (Wh or kWh)
solar_power string Total solar power sensor
p1_power string PV string 1 sensor
p2_power string PV string 2 sensor
output_power string Total output power sensor
production_today string Daily PV generation sensor (Wh or kWh)

โ„น๏ธ Note:
The card automatically detects the unit of measurement (Wh or kWh) for battery_capacity and production_today and converts values to kWh internally.


You donโ€™t have to provide all entities. Missing entities are automatically set to 0.
For the compact card, itโ€™s enough to provide e.g. battery_percentage, solar_power, and output_power.

๐Ÿงฉ Optional Parameters

Name Type Description Default
name string Display name of your storage system (shown top left) Device name (e.g. speicher_1_links)
output boolean Show output power card true
battery boolean Show battery card true
production boolean Show production card true
settings boolean Show settings card true
solar boolean Show solar card true
icon boolean Show storage icon true
compact boolean Show compact version false
max_input_power number Maximum input power for scaling P1 bar 600
max_input_power2 number Maximum input power for scaling P2 bar 600
max_input_power3 number Maximum input power for scaling P3 bar 600
max_input_power4 number Maximum input power for scaling P4 bar 600
p3_power string PV string 3 sensor null
p4_power string PV string 4 sensor null
last_update string ISO 8601 string for last update n/a

โš™๏ธ Custom Settings (custom_settings)

If you want to add your own switches or select entities to the settings card, even in entities mode, you can use the optional custom_settings parameter.

Each item in the array can define:

Key Type Description
entity string The entity ID of the switch or select you want to show.
name string Optional: Display name for the entity.
icon string Optional: Icon to display (mdi: format).

โ„น๏ธ Note:
settings paramter will be ignored or automatically set to true.

๐Ÿ“˜ Configuration

The card can be configured either with the code editor or (since v1.4.0) with the visual editor.

Manual Configuration with Code Editor

With Device

Add the complete card to your dashboard:

type: custom:b2500d-card
device: speicher_2_rechts
name: Storage 2 right

Hide settings:

type: custom:b2500d-card
device: speicher_2_rechts
name: Storage 2 right
settings: false

Show only solar power:

type: custom:b2500d-card
device: speicher_2_rechts
name: Storage 2 right
settings: false
output: false
production: false
battery: false

Show only status card:

type: custom:b2500d-card
device: speicher_2_rechts
name: Storage 2 right
settings: false
output: false
production: false
battery: false
solar: false

Show compact card:

type: custom:b2500d-card
device: speicher_1_links
name: Storage 1 left
compact: true
With Entities

Example using entities instead of device:

type: custom:b2500d-card
name: My Storage
entities:
  solar_power: sensor.my_storage_total_input_power
  battery_capacity: sensor.my_storage_battery_capacity
  ...

with custom settings:

type: custom:b2500d-card
settings: true
name: My Storage
entities:
  battery_percentage: sensor.my_battery_percentage
  battery_capacity: sensor.my_battery_capacity
  solar_power: sensor.my_solar_power
  output_power: sensor.my_output_power
  ....
custom_settings:
  - entity: switch.my_storage_surplus_feed_in
    name: "Surplus Feed-in"
    icon: mdi:transmission-tower-import
  - entity: select.my_charging_mode
    name: "Charging Mode"

Configuration with Visual Editor (since v1.4.0)

The configuration can also be done using the built-in form editor (visual editor).

Visual Editor