Connect your Marstek battery system to Home Assistant and take control of your energy. Monitor battery levels, track power flows, optimize energy usage, and save money on electricity - all from your Home Assistant dashboard.
Why Choose This Integration:
- 🔋 Real-time Battery Monitoring - See your battery status at a glance
- 📊 Energy Dashboard Integration - Beautiful visualizations of power flows
- 🔄 Automatic Updates - Set it and forget it, no manual polling
- 💰 Track Your Savings - Monitor profit and optimize energy usage
- 🚀 2-Minute Setup - Easy configuration via Home Assistant UI
- 🛡️ Reliable - Tested and production-ready
See everything about your Marstek battery system:
- Battery Level - Current charge percentage and stored energy (kWh)
- Power Flows - Live view of charging, discharging, solar production, grid usage, and home consumption
- Energy Statistics - Track total energy stored across all your batteries
- System Health - See when data was last updated and connection status
Make smart decisions about your energy:
- Profit Tracking - See how much money your battery system is saving
- Optimize Usage - Create automations based on battery level and electricity prices
- Peak Shaving - Avoid expensive grid electricity during peak hours
- Smart Charging - Charge during cheap off-peak times, discharge during expensive peaks
Integrate with Home Assistant's powerful visualization features:
- Energy Dashboard - Official Home Assistant energy dashboard support
- Custom Cards - Create stunning Lovelace dashboards with graphs and gauges
- Historical Data - Long-term statistics and trends
- Mobile Access - Monitor your battery from anywhere
Create intelligent home automations:
- Turn on appliances when battery is full and sun is shining
- Get notified when battery is low
- Switch to battery power during expensive grid hours
- Optimize heating/cooling based on available solar energy
- Automatic Updates - Data syncs every minute (configurable)
- Re-authentication - Seamless credential updates if they change
- Multi-Battery Support - Manage multiple Marstek batteries
- Device Integration - Each battery appears as a proper Home Assistant device with all its sensors
- Open HACS in Home Assistant
- Click the three dots menu → Custom repositories
- Add
https://github.com/thomasgriebner/marstek_cloudas an Integration - Click Explore & Download Repositories and search for Marstek Cloud
- Click Download
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration → Search Marstek Cloud
- Download the latest release from GitHub Releases
- Copy the
custom_components/marstek_cloudfolder to your Home Assistantconfig/custom_components/directory - Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration → Search Marstek Cloud
- Navigate to Settings → Devices & Services → Add Integration
- Search for Marstek Cloud and select it
- Enter your Marstek Cloud credentials:
- Email - Your Marstek Cloud account email
- Password - Your Marstek Cloud password
- Configure Scan Interval (10-3600 seconds, default: 60s)
- How often the integration fetches data from the API
- Lower values = more frequent updates but higher API load
- Set Default Battery Capacity (default: 5.12 kWh)
- Used to calculate total stored energy (SOC × Capacity)
- Can be adjusted per battery later in Options
- Click Submit
The integration validates your credentials before saving. If successful, all sensors will be created automatically.
| Parameter | Type | Range | Default | Description |
|---|---|---|---|---|
email |
string | - | Required | Marstek Cloud account email |
password |
string | - | Required | Marstek Cloud account password |
scan_interval |
integer | 10-3600 | 60 | Update interval in seconds |
default_capacity_kwh |
float | > 0 | 5.12 | Default battery capacity in kWh |
After initial setup, you can adjust settings via Settings → Devices & Services → Marstek Cloud → Configure:
- Scan Interval - Change update frequency (10-3600 seconds)
- Battery Capacities - Adjust capacity for each discovered battery individually
- Changes take effect immediately with automatic integration reload
If your credentials expire or change, Home Assistant will display a notification:
- Click Authenticate in the notification, or go to Settings → Devices & Services → Marstek Cloud
- Enter your new credentials
- Click Submit
The integration continues working seamlessly without losing entity IDs, history, or automations.
The integration creates multiple sensor entities for each battery device, plus global sensors.
Each configured Marstek battery provides the following sensors:
| Sensor | Entity ID Pattern | Unit | Device Class | Update Interval |
|---|---|---|---|---|
| State of Charge | sensor.<battery_name>_state_of_charge |
% | Battery | Scan Interval |
| Charge Power | sensor.<battery_name>_charge_power |
W | Power | Scan Interval |
| Discharge Power | sensor.<battery_name>_discharge_power |
W | Power | Scan Interval |
| Solar Power | sensor.<battery_name>_solar_power |
W | Power | Scan Interval |
| Grid Power | sensor.<battery_name>_grid_power |
W | Power | Scan Interval |
| Load Power | sensor.<battery_name>_load_power |
W | Power | Scan Interval |
| Profit | sensor.<battery_name>_profit |
€ | Monetary | Scan Interval |
| Report Time | sensor.<battery_name>_report_time |
- | Timestamp | Scan Interval |
| Firmware Version | sensor.<battery_name>_firmware_version |
- | - | Scan Interval |
| Serial Number | sensor.<battery_name>_serial_number |
- | - | Scan Interval |
| Sensor | Entity ID Pattern | Unit | Formula | Description |
|---|---|---|---|---|
| Calculated Charge Power | sensor.<battery_name>_calculated_charge_power |
W | max(0, pv - discharge) |
Actual charge power considering PV |
| Calculated Discharge Power | sensor.<battery_name>_calculated_discharge_power |
W | max(0, discharge - pv) |
Actual discharge power when PV insufficient |
Attributes: Both calculated sensors include:
pv_power- Current PV powerdischarge_power- Current discharge powerraw_calculation- Unfiltered calculation resultcalculation_method- Formula used
| Sensor | Entity ID Pattern | Unit | Formula | Description |
|---|---|---|---|---|
| Total Charge | sensor.<battery_name>_total_charge |
kWh | (soc / 100) × capacity_kwh |
Stored energy in battery |
Attributes:
device_name- Battery device namecapacity_kwh- Configured battery capacity
| Sensor | Entity ID Pattern | Unit | Category | Description |
|---|---|---|---|---|
| Last Update | sensor.<battery_name>_last_update |
- | Diagnostic | Timestamp of last successful update |
| API Latency | sensor.<battery_name>_api_latency |
ms | Diagnostic | API response time |
| Connection Status | sensor.<battery_name>_connection_status |
- | Diagnostic | online/offline |
These sensors aggregate data across all battery devices:
| Sensor | Entity ID | Unit | Formula | Description |
|---|---|---|---|---|
| Total Charge Across Devices | sensor.total_charge_across_devices |
kWh | Sum of all battery total_charge | Total stored energy |
| Total Power Across Devices | sensor.total_power_across_devices |
W | Sum of all (charge - discharge) | Net power flow |
Attributes: Both include device_count - Number of batteries
Entities are named based on the battery name configured in the Marstek Cloud system:
- Device name in Marstek Cloud:
Battery 1 - Entity example:
sensor.battery_1_state_of_charge
- All sensors update together when the coordinator refreshes (based on
scan_interval) - If API call fails, sensors retain last known values and show as
unavailableafter timeout - Diagnostic sensors update on every coordinator refresh attempt (success or failure)
Simple and secure:
- Setup - Enter your Marstek Cloud credentials in Home Assistant (same email and password as in the Marstek app)
- Authentication - Integration connects securely to Marstek Cloud API
- Data Sync - Battery data is fetched automatically every minute (you can change this to any interval between 10 seconds and 1 hour)
- Sensors - All metrics appear as Home Assistant sensors
- Enjoy - Use in dashboards, automations, or the Energy panel
Privacy & Security:
- Your credentials are stored securely in Home Assistant's encrypted storage
- All communication with Marstek Cloud is encrypted (HTTPS)
- No data is shared with third parties
- Works completely locally within your Home Assistant instance - only communicates with Marstek Cloud
Internet Required:
- This integration requires internet access to communicate with Marstek Cloud
- Your batteries must be connected to Marstek Cloud and showing data in the Marstek app
- If Marstek Cloud is down, sensors will show as unavailable until the service is back
- The integration automatically reconnects when the service is restored
Supported Battery Types:
- HME-5 series (and similar compatible Marstek battery systems)
- If your battery works with the Marstek Cloud app (eu.hamedata.com), it should work with this integration
- Some older device types may be automatically filtered if incompatible
Cause: Incorrect email or password
Solution:
- Verify your Marstek Cloud credentials at eu.hamedata.com
- Ensure you're using the email address registered with Marstek Cloud
- Check for typos in email/password
- Try again with correct credentials
Cause: Network issue or Marstek API temporarily unavailable
Solution:
- Check your Home Assistant internet connection
- Verify
eu.hamedata.comis accessible from your network - Check for firewall or proxy blocking the connection
- Wait a few minutes and try again
- Check Marstek status page for API outages
Cause: No compatible battery devices in your Marstek Cloud account
Solution:
- Log in to Marstek Cloud and verify your battery is registered
- Ensure your device type is supported (HME-5, etc.)
- Check device is online and reporting data in Marstek Cloud app
- Some device types (e.g., "HME-3") are automatically filtered - verify compatibility
Cause: API connection issues or integration not loaded
Solution:
- Check Home Assistant logs: Settings → System → Logs
- Look for errors from
custom_components.marstek_cloud - Try reloading: Settings → Devices & Services → Marstek Cloud → ⋮ → Reload
- Check internet connection
- Verify Marstek Cloud API is accessible
Cause: Credentials expired or changed in Marstek Cloud
Solution:
- Click Authenticate in the notification
- Enter your current Marstek Cloud credentials
- If using HACS, ensure integration is up-to-date
- If issue persists:
- Remove integration: Settings → Devices & Services → Marstek Cloud → Delete
- Re-add integration with current credentials
Cause: Scan interval too high or API rate limiting
Solution:
- Check current scan interval: Settings → Devices & Services → Marstek Cloud → Configure
- Lower scan interval (minimum 10 seconds recommended)
- Check API latency in diagnostic sensors (
sensor.<battery>_api_latency) - If latency is high (>5000ms), consider increasing scan interval
Cause: Incorrect capacity configuration
Solution:
- Go to Settings → Devices & Services → Marstek Cloud → Configure
- Adjust capacity for each battery individually
- Changes apply immediately after saving
Enable detailed logging for troubleshooting:
- Add to
configuration.yaml:
logger:
default: info
logs:
custom_components.marstek_cloud: debug- Restart Home Assistant
- Reproduce the issue
- Check logs: Settings → System → Logs
Log entries to look for:
Token expired, refreshing...- Normal token refreshAPI error code 8- Permission issues, check credentialsInvalid response from API- API communication problemDevice filtering: excluded X devices- Shows filtered devices
If issues persist:
- Check existing GitHub Issues
- Open a new issue with:
- Home Assistant version
- Integration version
- Debug logs (remove sensitive data)
- Steps to reproduce
- Join Home Assistant Community for community support
Latest Release: 0.5.0 (2026-01-22)
- Complete test suite with 100% coverage for rock-solid reliability
- Enhanced error handling and automatic recovery
- New calculated sensors for accurate power tracking
- Global statistics across all batteries
- Performance improvements and bug fixes
See CHANGELOG.md for full version history.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Community: Home Assistant Community Forum
This project is provided as-is under MIT License for personal and commercial use.
- Home Assistant Community for excellent documentation and tools
- Marstek for their battery systems and cloud API
- All contributors who help improve this integration