https://github.com/danzelziggy/srne-solarman
SRNE inverter with Solarman dongle integration via Home Assistant Community Store (HACS)
https://github.com/danzelziggy/srne-solarman
armbian docker energy-monitoring hesp home-assistant homeassistant homeassistant-custom-component homeassistant-integration orange-pi solar-inverter solarman srne
Last synced: 14 days ago
JSON representation
SRNE inverter with Solarman dongle integration via Home Assistant Community Store (HACS)
- Host: GitHub
- URL: https://github.com/danzelziggy/srne-solarman
- Owner: danzelziggy
- Created: 2025-09-11T10:32:13.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-09-28T03:56:33.000Z (15 days ago)
- Last Synced: 2025-09-28T05:41:02.400Z (15 days ago)
- Topics: armbian, docker, energy-monitoring, hesp, home-assistant, homeassistant, homeassistant-custom-component, homeassistant-integration, orange-pi, solar-inverter, solarman, srne
- Language: PowerShell
- Homepage: https://github.com/danzelziggy/srne-solarman
- Size: 364 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
☀️ SRNE - Solarman Dongle for Home Assistant

[](https://github.com/davidrapan/ha-solarman)
[](https://www.home-assistant.io)
[](https://www.docker.com)A comprehensive guide for integrating SRNE/Solarman dongle with Home Assistant using Docker in a home/local network.
🛠️ Prerequisites • ⚡ Quick Start • 📖 Setup Guide • 📊 Dashboard---
# 📋 Table of Contents
Click to expand/collapse
- [💻 Hardware Requirements](#hardware-requirements)
- [🖥️ Software Requirements (Ubuntu Minimal / Armbian IoT)](#software-requirements)
- [⚙️ Prerequisites](#prerequisites)
- [⚡ Quick Start](#quick-start)
- [🚀 Installation](#installation)
- [🤖 Automated Installation](#automated-installation)
- [🐧 Linux - step-by-step](#linux-step-by-step)
- [🪟 Windows - step-by-step](#windows-step-by-step)
- [🏠 Home Assistant Setup](#home-assistant-setup)
- [🖼️ Lovelace Dashboard](#lovelace-dashboard)
- [🧩 Manual Installation](#manual-installation)
- [⚙️ Card Configuration](#card-configuration)
- [📱 Mobile App Installation](#mobile-app-installation)
- [🔧 Advanced Configuration](#advanced-configuration)
- [❗ Troubleshooting](#troubleshooting)
- [📁 Project Structure](#project-structure)
- [📚 References & Credits](#references-credits)💻 Hardware Requirements
Minimum Requirements
- **Orange Pi One (1GB RAM)**
- ✅ Suitable for basic setup
- ✅ Direct ethernet connection to router
- ❌ No built-in WiFi
- 💰 Budget-friendly option
- Perfect for direct cable connection setupsRecommended Alternative
- **Orange Pi Zero 3**
- ✅ Built-in WiFi support
- ✅ Better performance
- ✅ More flexible installation options
- Recommended if wireless connectivity is neededNetwork Requirements
- Orange Pi One: Use direct ethernet cable to router
- Orange Pi Zero 3: Can use either WiFi or ethernet
> Note: Both options are sufficient to run Home Assistant with the Solarman integration. Choose based on your network connectivity needs.
- Your **Home Assistant server** (Orange Pi, PC, or other host) must be connected to the **same local network (LAN)** as the **SRNE/Solarman WiFi dongle**.
- Remote-only setups (e.g., just viewing the plant in the Solarman Cloud app) will **not** work — the integration requires **direct communication with the dongle over your LAN**.
- Make sure the dongle and Home Assistant server are both connected to the same router/switch (via WiFi or Ethernet).Storage
- **MicroSD Card (16GB minimum, 32GB recommended)**
- Required for flashing and running the OS image (Ubuntu Minimal or Armbian)
- Use a high-quality, Class 10 (or better) card for reliability🖥️ Software Requirements (Ubuntu Minimal / Armbian IoT)
When using lightweight OS images such as **Ubuntu Minimal** or **Armbian Linux** (commonly used on Orange Pi boards), you may need to install additional base packages before following the rest of this guide.
Run these commands after first boot:
```bash
# Update package lists
sudo apt update && sudo apt upgrade -y# Essential build and networking tools
sudo apt install -y \
software-properties-common \
apt-transport-https \
ca-certificates \
curl \
wget \
gnupg \
lsb-release \
net-tools \
iputils-ping# Optional but recommended
sudo apt install -y \
htop nano vim unzip
```These ensure:
- SSL certificates, HTTPS transport, and repository tools are available
- Network utilities (ping, net-tools) for troubleshooting
- Basic editors and monitoring tools for configuration
- System is up to date before Docker installationAfter this step, continue with the **⚙️ Prerequisites** section (Docker, Git, etc.).
⚙️ Prerequisites
- Docker (Linux) or Docker Desktop (Windows) - (see automated installation)
- Git (optional - you can download ZIP instead) - (see automated installation)
- Network access to your SRNE/Solarman inverter⚡ Quick Start
Summary (high level)
> Note: Most are part of automated installation.
1. Install Docker and git on your host.
2. Create a Home Assistant config directory on the host.
3. Use Docker Compose to run Home Assistant container mapping the config directory.
4. Copy the `custom_components/solarman` folder from https://github.com/davidrapan/ha-solarman into your HA config's `custom_components` directory.
5. Install the Sunsynk Power Flow card into HA's `www` directory (manual install) and add it as a resource.
6. Open Home Assistant, add the Solarman integration, and add a Lovelace card using the provided example YAML.🚀 Installation
🤖 Automated Installation
The repository includes smart setup scripts that handle the entire installation process automatically:
#### Linux Users
```bash
git clone https://github.com/davidrapan/ha-solarman.git
cd ha-solarman
sudo ./scripts/setup-linux.sh
```The Linux script (`setup-linux.sh`) automatically:
1. **Checks Prerequisites**
- Verifies root/sudo access
- Detects package manager (apt/yum)2. **Installs Dependencies**
- Docker Engine & Docker Compose
- Git
- Required system packages3. **Configures Environment**
- Creates configuration directories
- Sets correct file permissions
- Configures Docker service4. **Installs Components**
- Home Assistant Docker container
- ha-solarman integration
- Sunsynk Power Flow card5. **Handles Permissions**
- Auto-detects Home Assistant container UID
- Sets proper file ownership
- Ensures Docker access rights#### Windows Users
```powershell
# Run PowerShell as Administrator
git clone https://github.com/davidrapan/ha-solarman.git
cd ha-solarman
.\scripts\setup-windows.ps1
```The Windows script (`setup-windows.ps1`) automatically:
1. **Checks Prerequisites**
- Verifies Administrator privileges
- Checks Windows version compatibility2. **Installs Software**
- Downloads & installs Docker Desktop
- Downloads & installs Git
- Handles PATH environment setup3. **Configures System**
- Creates necessary directories
- Sets up Docker Desktop with WSL2
- Configures file sharing4. **Installs Components**
- Home Assistant container
- ha-solarman integration
- Sunsynk Power Flow card5. **Provides Guidance**
- Handles system restart if needed
- Shows clear next steps
- Includes troubleshooting help> 💡 **Note**: Both scripts include error handling, progress indicators, and automatic cleanup. They will guide you through any necessary system restarts or additional steps needed.
Manual Installation
If you prefer manual installation or need to customize the setup, follow the step-by-step instructions below:🐧 Linux - step-by-step
1) Install Docker & git
```bash
sudo apt update && sudo apt install -y docker.io docker-compose git
sudo systemctl enable --now docker
```0) (Optional but required for commands below) Make sure you are in the repository root (where this README and the `templates/` directory live). If you haven't cloned the repo yet, run:
```bash
# Clone the repo and change into it (only needed if you don't already have the files locally)
git clone https://github.com/davidrapan/ha-solarman.git
cd ha-solarman
```2) Create HA config directory
```bash
sudo mkdir -p /root/solarman/homeassistant_config/{custom_components/solarman/inverter_definitions,www/sunsynk-power-flow-card}
sudo chown -R $(whoami):$(whoami) /root/solarman/homeassistant_config
```3) Docker Compose example
Create `docker-compose.yml` (adjust TZ and paths as needed):
```yaml
version: '3.8'
services:
homeassistant:
container_name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
ports:
- "8123:8123"
volumes:
- /root/solarman/homeassistant_config:/config
- /etc/localtime:/etc/localtime:ro
environment:
- TZ=Asia/Singapore
restart: unless-stopped
```4) Copy configuration files
```bash
# Copy base configuration
cp ./templates/configuration.yaml /root/solarman/homeassistant_config/
# Copy SRNE inverter definition
cp ./templates/srne_hesp.yaml /root/solarman/homeassistant_config/custom_components/solarman/inverter_definitions/# Ensure proper permissions
sudo chown -R 1000:1000 /root/solarman/homeassistant_config/custom_components/solarman/inverter_definitions
```Start Home Assistant:
```bash
sudo docker compose up -d
```4) Install ha-solarman (custom component)
```bash
cd /tmp
git clone https://github.com/davidrapan/ha-solarman.git
mkdir -p /root/solarman/homeassistant_config/custom_components
cp -r ha-solarman/custom_components/solarman /root/solarman/homeassistant_config/custom_components/
# Ensure the container can read the files (common HA container UID is 1000)
sudo chown -R 1000:1000 /root/solarman/homeassistant_config/custom_components/solarman || true
sudo docker compose restart homeassistant
```5) Install Sunsynk Power Flow card (manual)
```bash
sudo mkdir -p /root/solarman/homeassistant_config/www/sunsynk-power-flow-card
sudo curl -L -o /root/solarman/homeassistant_config/www/sunsynk-power-flow-card/sunsynk-power-flow-card.js \
https://raw.githubusercontent.com/slipx06/sunsynk-power-flow-card/v7.0.0/dist/sunsynk-power-flow-card.js
sudo chown -R 1000:1000 /root/solarman/homeassistant_config/www || true
sudo docker compose restart homeassistant
```In the Home Assistant UI add this resource (Settings -> Dashboards -> Resources):
/local/sunsynk-power-flow-card/sunsynk-power-flow-card.js
Tip: append `?ver=1` (increment on updates) to bypass browser cache, or clear your browser cache after updating the file.
---
🪟 Windows - step-by-step
Notes:
- Use Docker Desktop with WSL2 backend (recommended) or Hyper-V. Ensure Docker Desktop has access to the host folder used for HA config.
- Example host path: `C:\solarman\homeassistant_config`> This repository includes a ready-made docker-compose.windows.yml and setup scripts:
> - docker-compose.windows.yml (repo root) — Windows-friendly compose file using a C:\\ path.
> - scripts\setup-windows.ps1 — PowerShell script to clone ha-solarman, copy the custom component and download the Sunsynk card.
> - scripts\setup-linux.sh — Bash script for Linux automation.You can use the provided compose file instead of creating one manually. From the repository root run Docker Compose with the file specified (PowerShell / CMD):
```powershell
docker compose -f docker-compose.windows.yml up -d
```1) Install Docker Desktop and Git for Windows
- Docker Desktop: https://www.docker.com/products/docker-desktop
- Git for Windows: https://git-scm.com/download/win0) (Optional but required for commands below) Make sure you have cloned this repository and are running the following commands from the repository root where `templates\` exists. If you haven't cloned it yet, in PowerShell run:
```powershell
# Clone the repo and change into it (only needed if you don't already have the files locally)
git clone https://github.com/davidrapan/ha-solarman.git
Set-Location -Path .\ha-solarman
```2) Create HA config directory (PowerShell as Administrator)
```powershell
New-Item -Path 'C:\solarman\homeassistant_config\custom_components\solarman\inverter_definitions' -ItemType Directory -Force
New-Item -Path 'C:\solarman\homeassistant_config\www\sunsynk-power-flow-card' -ItemType Directory -Force
```3) Docker Compose example (Windows paths)
Create a `docker-compose.yml` (example, adjust TZ if needed):
```yaml
version: '3.8'
services:
homeassistant:
container_name: homeassistant
image: ghcr.io/home-assistant/home-assistant:stable
ports:
- "8123:8123"
volumes:
- "C:\\solarman\\homeassistant_config:/config"
environment:
- TZ=Asia/Singapore
restart: unless-stopped
```4) Copy configuration files
```powershell
# Copy base configuration
Copy-Item -Path ".\templates\configuration.yaml" -Destination "C:\solarman\homeassistant_config\" -Force
# Copy SRNE inverter definition
Copy-Item -Path ".\templates\srne_hesp.yaml" -Destination "C:\solarman\homeassistant_config\custom_components\solarman\inverter_definitions\" -Force
```Start Home Assistant (run in folder with the compose file):
```powershell
docker compose up -d
```---
🏠 Home Assistant Setup
1. Open Home Assistant UI: http://HA-ip-address:8123 and complete the basic onboarding.
2. Settings -> Devices & Services -> Add integration -> search `Solarman` and follow prompts to configure your SRNE inverter.
3. Provide Title: `SRNE`. Profile: `srne_hesp.yaml`. IP address. Its important to provide the Title and Profile correctly to match the sensors names used in the Lovelace card.
4. After adding, check Settings -> Devices & Entities for the entities created by the integration (entity IDs may vary).
> **Note**: If the integration is not available in the UI, confirm the `custom_components/solarman` folder exists inside the active HA config and restart the container.
🖼️ Lovelace Dashboard
Manual Installation
> Important: these manual instructions assume you have the repository files available locally (specifically the `templates/` directory). If you haven't already, clone this repository or download the ZIP and change into the repository root before running the commands below.
>
> Linux / macOS:
>
> ```bash
> git clone https://github.com/davidrapan/ha-solarman.git
> cd ha-solarman
> ```
>
> Windows (PowerShell):
>
> ```powershell
> git clone https://github.com/davidrapan/ha-solarman.git
> Set-Location -Path .\ha-solarman
> ```
>
> If you downloaded the ZIP from GitHub, extract it and `cd` into the extracted folder so `./templates` is available.1. **Download the Card**
```bash
# Linux
sudo mkdir -p /root/solarman/homeassistant_config/www/sunsynk-power-flow-card
sudo curl -L -o /root/solarman/homeassistant_config/www/sunsynk-power-flow-card/sunsynk-power-flow-card.js \
https://raw.githubusercontent.com/slipx06/sunsynk-power-flow-card/v7.0.0/dist/sunsynk-power-flow-card.js# Windows (PowerShell)
New-Item -Path 'C:\solarman\homeassistant_config\www\sunsynk-power-flow-card' -ItemType Directory -Force
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/slipx06/sunsynk-power-flow-card/v7.0.0/dist/sunsynk-power-flow-card.js' -OutFile 'C:\solarman\homeassistant_config\www\sunsynk-power-flow-card\sunsynk-power-flow-card.js'
```2. **Add Resource to Home Assistant**
1. Navigate to Configuration → Dashboards → Resources
2. Click "+ ADD RESOURCE" in the bottom right
3. Click the three dots in the top right
4. 
5. Enter the following:
- URL: `/local/sunsynk-power-flow-card/sunsynk-power-flow-card.js?ver=1`
- Resource type: JavaScript Module
6. ⚙️ Card Configuration
1. Create a new dashboard or edit an existing one
2. Add a new card → Manual
3. Copy this configuration (adjust entity IDs as needed):```yaml
type: custom:sunsynk-power-flow-card
cardstyle: full
show_solar: true
battery:
energy: 28512
shutdown_soc: 20
show_daily: true
inverter:
colour: green
solar:
show_daily: true
mppts: 2
load:
show_daily: true
grid:
show_daily_buy: true
show_daily_sell: false
show_nonessential: false
entities:
battery_current_191: sensor.srne_battery_current
battery_power_190: sensor.srne_battery_power
battery_soc_184: sensor.srne_battery
battery_voltage_183: sensor.srne_battery_voltage
day_battery_charge_70: sensor.srne_today_battery_charge_ampere_hour
day_battery_discharge_71: sensor.srne_today_battery_discharge_ampere_hour
day_grid_import_76: sensor.srne_today_energy_import
day_load_energy_84: sensor.srne_today_load_consumption
day_pv_energy_108: sensor.srne_today_production
dc_transformer_temp_90: sensor.srne_dc_temperature
grid_ct_power_172: sensor.grid_l1_power_signed
grid_power_167: sensor.srne_grid_l1_voltage
inverter_current_164: sensor.srne_output_l1_current
inverter_power_175: sensor.srne_load_l1_power
inverter_voltage_154: sensor.srne_output_l1_voltage
load_frequency_192: sensor.srne_output_frequency
pv1_current_110: sensor.srne_pv1_current
pv1_power_186: sensor.srne_pv1_power
pv1_voltage_109: sensor.srne_pv1_voltage
pv2_current_112: sensor.srne_pv2_current
pv2_power_187: sensor.srne_pv2_power
pv2_voltage_111: sensor.srne_pv2_voltage
radiator_temp_91: sensor.srne_ac_temperature
large_font: true
```### Important Notes
- Replace `energy: 28512` with your actual battery capacity in Wh
- Calculate: Battery voltage × capacity in Ah
- Example: 48V × 594Ah = 28,512 Wh
- Entity IDs (like `sensor.srne_battery_voltage`) must match your actual HA entities
- Add `?ver=1` to the resource URL and increment it when updating the card
- Clear your browser cache if the card doesn't appear after installation### Troubleshooting
1. **Card Not Showing**
- Verify the JS file exists in the correct location
- Check browser console for errors (F12)
- Try adding `?ver=2` to the resource URL
- Clear browser cache and reload2. **No Data Displayed**
- Confirm entity IDs match your system
- Check if entities are available in HA
- Verify Solarman integration is working3. **Permission Issues**
- Linux: Ensure proper ownership with `chown -R 1000:1000`
- Windows: Check Docker Desktop file sharing📱 Mobile App Installation
Installing Home Assistant App
1. **Download the Official App**:
- **Android**: [Google Play Store](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android)
- **iPhone/iPad**: [Apple App Store](https://apps.apple.com/us/app/home-assistant/id1099568401)### Local Network Configuration
1. **Find Your Home Assistant URL**:
- If using Orange Pi One: `http://[ethernet-ip]:8123`
- If using Orange Pi Zero 3: `http://[wifi-or-ethernet-ip]:8123`
> Replace [ethernet-ip] or [wifi-or-ethernet-ip] with your actual device IP2. **Connect Mobile App**:
1. Open Home Assistant app
2. Tap "START"
3. Select "Local Network" connection method
4. Enter your Home Assistant URL
5. Login with your credentials### Mobile App Features
1. **Dashboard Access**:
- View your Sunsynk Power Flow card
- Monitor solar production
- Check battery status
- View grid consumption2. **Push Notifications**:
- Set up alerts for:
- Low battery
- High power consumption
- Grid outages
- System issues3. **Sensors & Location**:
- Enable/disable device sensors
- Configure location tracking
- Set up geofencing (optional)### Troubleshooting Mobile Connection
1. **Can't Connect**:
- Verify you're on the same network
- Check if HA is running (http://localhost:8123)
- Ensure port 8123 isn't blocked
- Try using IP address instead of hostname2. **App Showing Offline**:
- Check network connectivity
- Verify HA server is running
- Restart the app
- Clear app cache3. **Slow Performance**:
- Reduce number of entities
- Optimize update intervals
- Clear app cache
- Check network speed### Optional: Remote Access (Advanced)
For remote access without opening ports:
1. **Nabu Casa** (Paid Service):
- Most secure option
- Supports remote access
- Includes SSL certificate
- Simple setup2. **VPN Solution**:
- Set up WireGuard/OpenVPN on your router
- Connect to home network remotely
- Access HA through local URL
- More technical but free> 💡 **Tip**: For best performance and security, we recommend using the mobile app on your local network.
---
🔧 Advanced Configuration
Customizing Sensor Definitions
- Edit `custom_components/solarman/inverter_definitions/srne_hesp.yaml`
- Adjust Modbus registers as needed
- Refer to SRNE Modbus Register Map for details### Environment Variables
- `TZ`: Set your timezone (e.g., `Asia/Singapore`)
- `HA_CONFIG`: Custom Home Assistant config path (if not using default)### Docker Compose Overrides
- Create `docker-compose.override.yml` for customizations
- Example: change ports, add volumes, etc.```yaml
version: '3.8'
services:
homeassistant:
ports:
- "8124:8123" # Change host port
volumes:
- /path/to/your/config:/config # Add custom volume
```### Backup & Restore
- Regularly back up your Home Assistant config
- Use built-in HA snapshot feature
- Store backups offsite or in cloud storage> ⚠️ **Warning**: Advanced configurations are for users who understand the implications. Incorrect settings may lead to system instability.
---
❗ Troubleshooting
Common Issues
1. **Home Assistant not starting**
- Check Docker container logs: `docker logs homeassistant`
- Ensure no port conflicts on the host
- Verify config file syntax: `ha core check`2. **Integration not found**
- Confirm `custom_components/solarman` folder exists
- Check file permissions
- Restart Home Assistant3. **Data not updating**
- Verify network connection to inverter
- Check Modbus register settings
- Restart the Solarman integration### Getting Help
- **Documentation**: Refer to this guide and linked resources
- **Community Forums**: Home Assistant and SRNE forums
- **GitHub Issues**: Search for similar issues or open a new one> 💡 **Tip**: Before posting for help, gather relevant information:
> - Describe your setup (hardware, OS, Docker version)
> - List steps to reproduce the issue
> - Include error messages or logs---
📁 Project Structure
```
srne-solarman/
├── docker-compose.yml # Linux Docker configuration
├── docker-compose.windows.yml # Windows Docker configuration
├── README.md # This documentation
├── srne-modbus-V2.07.pdf # SRNE Modbus protocol reference
├── img.png # Documentation images
├── img_1.png
├── scripts/
│ ├── setup-linux.sh # Linux automated setup
│ └── setup-windows.ps1 # Windows automated setup
└── templates/
├── configuration.yaml # Home Assistant base config
└── srne_hesp.yaml # SRNE inverter definition
```The configuration files in the `templates` directory are automatically copied to these locations during setup:
**Linux Container Paths:**
- `configuration.yaml` → `/config/configuration.yaml`
- `srne_hesp.yaml` → `/config/custom_components/solarman/inverter_definitions/srne_hesp.yaml`**Windows Host Paths:**
- `configuration.yaml` → `C:\solarman\homeassistant_config\configuration.yaml`
- `srne_hesp.yaml` → `C:\solarman\homeassistant_config\custom_components\solarman\inverter_definitions\srne_hesp.yaml`📚 References & Credits
### Main Projects
- [ha-solarman](https://github.com/davidrapan/ha-solarman) - Core integration for SRNE/Solarman inverters with Home Assistant
- [Sunsynk Power Flow Card](https://github.com/slipx06/sunsynk-power-flow-card) - Beautiful energy monitoring dashboard card
- [Home Assistant](https://www.home-assistant.io/) - The home automation platform we're building on### Documentation
- [SRNE Modbus Register Map](srne-modbus-V2.07.pdf) - Complete protocol reference included in this repository
- [HA Docker Installation](https://www.home-assistant.io/installation/linux#docker) - Official HA Docker setup guide
- [Docker Documentation](https://docs.docker.com/get-started/) - Official Docker documentation### Hardware
- Orange Pi Documentation
- [Orange Pi One](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-One.html)
- [Orange Pi Zero 3](http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero-3.html)### Contributors & Thanks
- **David Rapan** ([@davidrapan](https://github.com/davidrapan))
- Author of the ha-solarman integration
- Core functionality and Modbus implementation- **slipx06** ([@slipx06](https://github.com/slipx06))
- Creator of the Sunsynk Power Flow card
- Beautiful visualization components- **SRNE / Solarman**
- Hardware manufacturers
- Protocol documentation- **Home Assistant Community**
- Testing and feedback
- Bug reports and feature suggestions### License Information
- This guide and setup scripts are provided under MIT License
- Component licenses:
- ha-solarman: Check [repository](https://github.com/davidrapan/ha-solarman)
- Sunsynk Power Flow card: Check [repository](https://github.com/slipx06/sunsynk-power-flow-card)
- Home Assistant: Apache 2.0> 💡 **Contributing**: Found a bug or want to improve this guide? Please open an issue or submit a pull request!
---