⚠️ EXPERIMENTAL INTEGRATION - USE AT YOUR OWN RISKThis is an unofficial custom integration for HomeAssistant to monitor Sunlit Solar systems. This integration is not affiliated with, endorsed by, or supported by Sunlit.
No warranty or support is provided. Use of this integration is entirely at your own risk.
This custom integration connects HomeAssistant to the Sunlit Solar API, enabling real-time monitoring of your solar installation including solar panels, inverters, batteries, and energy meters. It provides comprehensive sensor data for monitoring energy production, consumption, and battery status.
- 📊 Monitoring - Updates every 30 seconds
- 🏠 Family/Space Aggregation - Combined metrics across all devices
- 🔌 Device-Specific Sensors - Individual monitoring for each component
- 🔋 Battery Management - SOC limits, strategies, and status tracking
- ⚡ Energy Dashboard Ready - Compatible with HA Energy Dashboard
- 🚨 Fault Detection - Binary sensors for system health monitoring
- 📈 Strategy History - Track battery charging strategy changes
- HomeAssistant 2025.1.0 or newer
- Sunlit Solar Bearer API key (obtain from your Sunlit Solar account)
- Active internet connection for API access
- Open HACS in your Home Assistant instance
- Click on Integrations
- Click the three dots menu in the top right corner and select Custom repositories
- Add this repository URL:
https://github.com/cedricziel/ha-sunlit - Select Integration as the category
- Click Add
- Search for "Sunlit Solar" in HACS
- Click Download and select the latest version
- Restart Home Assistant
- Add the integration through the UI: Settings → Devices & Services → Add Integration → Search for "Sunlit"
- Download or clone this repository
- Copy the
custom_components/sunlitfolder to your HomeAssistant configuration directory:<config_dir>/custom_components/sunlit/ - Restart HomeAssistant
- Add the integration through the UI: Settings → Devices & Services → Add Integration → Search for "Sunlit"
custom_components/
└── sunlit/
├── __init__.py
├── api_client.py
├── binary_sensor.py
├── config_flow.py
├── const.py
├── manifest.json
├── sensor.py
└── strings.json
- Navigate to Settings → Devices & Services
- Click Add Integration and search for "Sunlit"
- Enter your API key when prompted
- Select the families/spaces you want to monitor
- Click Submit
The integration will create devices and sensors automatically based on your Sunlit Solar system configuration.
| Sensor | Description | Unit | Update |
|---|---|---|---|
device_count |
Total number of devices | count | 30s |
online_devices |
Number of online devices | count | 30s |
offline_devices |
Number of offline devices | count | 30s |
total_ac_power |
Combined AC power from all meters | W | 30s |
average_battery_level |
Average SOC across all batteries | % | 30s |
total_input_power |
Total battery charging power | W | 30s |
total_output_power |
Total battery discharging power | W | 30s |
battery_strategy |
Current battery charging strategy | text | 30s |
battery_status |
Overall battery system status | text | 30s |
rated_power |
System rated power capacity | W | 30s |
max_output_power |
Maximum output power limit | W | 30s |
hw_soc_min |
Hardware minimum SOC limit | % | 30s |
hw_soc_max |
Hardware maximum SOC limit | % | 30s |
strategy_soc_min |
Strategy minimum SOC | % | 30s |
strategy_soc_max |
Strategy maximum SOC | % | 30s |
last_strategy_change |
Timestamp of last strategy change | datetime | 30s |
strategy_changes_today |
Number of strategy changes in 24h | count | 30s |
total_solar_energy |
Total solar energy production | kWh | 30s |
total_solar_power |
Total solar power production | W | 30s |
daily_grid_export_energy |
Daily energy exported to grid | kWh | 30s |
total_grid_export_energy |
Total energy exported to grid | kWh | 30s |
ev3600_auto_strategy_mode |
EV3600 inverter strategy mode | text | 30s |
storage_strategy |
Storage strategy configuration | text | 30s |
normal_charge_box_mode |
Normal charge box mode | text | 30s |
inverter_sn_list |
Inverter serial numbers list | text | 30s |
| Sensor | Description | Unit |
|---|---|---|
total_ac_power |
Current power flow | W |
daily_buy_energy |
Energy imported today | kWh |
daily_ret_energy |
Energy exported today | kWh |
total_buy_energy |
Total energy imported | kWh |
total_ret_energy |
Total energy exported | kWh |
| Sensor | Description | Unit |
|---|---|---|
current_power |
Current power production | W |
total_power_generation |
Total energy produced | kWh |
daily_earnings |
Earnings today | € |
| Sensor | Description | Unit |
|---|---|---|
battery_level |
Current state of charge | % |
batterySoc |
System battery SOC | % |
input_power_total |
Current charging power | W |
output_power_total |
Current discharging power | W |
chargeRemaining |
Time until fully charged | minutes |
dischargeRemaining |
Time until fully discharged | minutes |
batteryMppt1InVol |
Main unit MPPT1 voltage | V |
batteryMppt1InCur |
Main unit MPPT1 current | A |
batteryMppt1InPower |
Main unit MPPT1 power | W |
batteryMppt2InVol |
Main unit MPPT2 voltage | V |
batteryMppt2InCur |
Main unit MPPT2 current | A |
batteryMppt2InPower |
Main unit MPPT2 power | W |
For modular battery systems with B215 extension modules, each additional battery module (1-3) appears as a separate virtual device with:
| Sensor | Description | Unit |
|---|---|---|
Soc |
Module state of charge | % |
Mppt1InVol |
Module MPPT voltage | V |
Mppt1InCur |
Module MPPT current | A |
Mppt1InPower |
Module MPPT power | W |
| Sensor | Description | Device Class |
|---|---|---|
has_fault |
Any device has a fault | problem |
battery_full |
Battery fully charged | battery |
battery_bypass |
Battery bypass mode active | None |
battery_heater_1 |
Battery heater 1 active | heat |
battery_heater_2 |
Battery heater 2 active | heat |
battery_heater_3 |
Battery heater 3 active | heat |
boost_mode_enabled |
Boost mode enabled | None |
boost_mode_switching |
Boost mode switching | running |
ev3600_auto_strategy_exist |
EV3600 auto strategy configured | None |
ev3600_auto_strategy_running |
EV3600 auto strategy active | running |
tariff_strategy_exist |
Tariff strategy configured | None |
enable_local_smart_strategy |
Local smart strategy enabled | None |
ac_couple_enabled |
AC coupling enabled | None |
charging_box_boost_on |
Charging box boost active | None |
| Sensor | Description | Device Class |
|---|---|---|
fault |
Device has fault | problem |
power |
Device is powered on | power |
To integrate with HomeAssistant's Energy Dashboard:
- Go to Settings → Dashboards → Energy
- Under Solar Panels, click Add Solar Production
- Select sensor:
sensor.inverter_[ID]_total_power_generation
- Under Grid, click Add Consumption
- Select sensor:
sensor.meter_[ID]_total_buy_energy
- Under Grid, click Add Return
- Select sensor:
sensor.meter_[ID]_total_ret_energy
Since the integration provides power sensors but not energy sensors for batteries:
- Create a helper: Settings → Devices & Services → Helpers → Create Helper → Integration - Riemann sum
- Configure:
- Name: "Battery Energy Input"
- Input sensor:
sensor.battery_[ID]_input_power_total - Integration method: Trapezoidal
- Metric prefix: k (kilo)
- Time unit: Hours
- Repeat for output power
- Add these helpers to Energy Dashboard under Battery Storage
All entities follow a consistent naming pattern to ensure uniqueness across multiple families and devices:
Pattern: sensor.sunlit_{family_id}_{sensor_key}
Example: sensor.sunlit_12345_battery_level
Pattern: sensor.sunlit_{family_id}_{device_type}_{device_id}_{sensor_key}
Example: sensor.sunlit_12345_battery_456_input_power_total
Pattern: sensor.sunlit_{family_id}_battery_{device_id}_module{N}_{sensor_key}
Example: sensor.sunlit_12345_battery_456_module1_soc
The integration creates a hierarchical device structure:
-
Family Hub - Virtual device representing the entire solar system
- Contains aggregate sensors and system-wide metrics
- All physical devices are linked to this hub
-
Physical Devices - Actual hardware components
- Smart meters (SHELLY_3EM_METER)
- Inverters (YUNENG_MICRO_INVERTER)
- Battery units (ENERGY_STORAGE_BATTERY)
-
Virtual Devices - Logical representations for better organization
- Battery modules (1-3) for modular battery systems
- Each module appears as a separate device linked to the main battery unit
- Prevents sensor overload on single devices (30+ sensors)
For battery systems with expansion modules:
- Main Unit (BK215): Contains system-wide sensors and dual MPPT inputs
- B215 Module 1-3: Additional battery packs (2.15 kWh each) with individual MPPT solar inputs
- Each module tracks its own SOC and solar production independently
- Virtual devices ensure clean organization in HomeAssistant UI
- No Dynamic Device Discovery: New devices added to your Sunlit system require a HomeAssistant restart to appear
- No Historical Data: The integration cannot backfill historical data from before it was installed
- API Rate Limits: The 30-second update interval is fixed to avoid API rate limiting
- Read-Only: All sensors are read-only; device control is not supported
Add to your configuration.yaml:
logger:
default: info
logs:
custom_components.sunlit: debugSensors showing "unavailable"
- Check your internet connection
- Verify API key is correct
- Ensure devices are online in Sunlit Solar app
Missing devices after adding new hardware
- Restart HomeAssistant to discover new devices
- Check if devices appear in Sunlit Solar app first
Energy Dashboard not showing data
- Ensure sensors have
state_class: total_increasing(check Developer Tools) - Wait for at least one update cycle (30 seconds)
- Verify units are in kWh for energy sensors
# Clone the repository
git clone https://github.com/cedricziel/ha-sunlit.git
cd ha-sunlit
# Install dependencies
make setup
# Format code
make format
# Run linters (without making changes)
make lint
# Clean up cache files
make clean
# Show all available commands
make help# Start HomeAssistant in development mode
hass -c configContributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This integration is provided "as is" without warranty of any kind. The authors and contributors are not responsible for any damages or losses that may result from using this integration.
This is an experimental, unofficial integration that:
- May stop working if Sunlit Solar changes their API
- Could potentially impact your Sunlit Solar warranty (check your terms)
- Is not endorsed or supported by Sunlit Solar GmbH
- May contain bugs that could affect your HomeAssistant installation
Use at your own risk and always maintain backups of your HomeAssistant configuration.
This project is licensed under the MIT License - see the LICENSE file for details.
This is a community project with no official support. For issues and questions:
- Check existing GitHub Issues
- Open a new issue with detailed information about your problem
- Join HomeAssistant community forums for general help
Remember: This is an experimental integration maintained by volunteers in their spare time.