Send your PV system data (grid power, solar production, battery status) to the clever-PV Push API and receive control commands for your battery as needed.
Features
- Push data to us (grid power, solar production, battery status)
- Optional battery control: Receive charge/discharge instructions from us
- Supports grid power, solar production, battery SOC, and charging power
- Configurable push interval (10-300 seconds, default: 30)
- Various sensors for monitoring push status and battery control state
Installation
HACS (Recommended)
- Install HACS in Home Assistant by following the steps (https://my.home-assistant.io/redirect/supervisor_addon/?addon=cb646a50_get&repository_url=https%3A%2F%2Fgithub.com%2Fhacs%2Faddons)
- Once HACS is installed, restart Home Assistant (Settings -> System -> Power icon in the top right).
- Go to Settings -> Devices & Services
- Click "Add Integration" in the bottom right
- Search for HACS, select it, check the options, and confirm.
- Link your GitHub account
- Select HACS from the list on the left
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add
https://github.com/clever-PV/home-assistant-clever-PVwith the category "Integration" - Click "Add"
- Search for "clever-PV" and install it
- Restart Home Assistant
- Go to the "Settings" tab - "Devices & Services"
- Click the "+ Add Integration" button
- Search for "clever-PV" and add it
- Follow the setup process
Manual Installation
- Copy the
custom_components/cleverpvfolder to theconfig/custom_components/directory of your Home Assistant - Restart Home Assistant
Configuration in Home Assistant
- Go to Settings > Devices & Services
- Click Add Integration
- Search for "clever-PV"
- Enter your push URL
- Select the entities to be transmitted:
- Grid Power (required): Sensor displaying grid power in watts (positive = import, negative = export)
- Solar Production (optional): Sensor displaying current solar production in watts
- Battery SOC (optional): Sensor displaying the battery state of charge in percent
- Battery Power (optional): Sensor displaying the battery charge/discharge power in watts
- Configure optional features:
- Enable battery control (optional): If enabled, we can send control commands back to Home Assistant
Entities
The integration creates the following diagnostic sensors:
| Sensor | Description |
|---|---|
| Push Status | Success or error status of the last push operation |
| Last Push | Timestamp of the last successful push operation |
| Last Response | Response message from the clever-PV API |
| Last Payload | JSON data (payload) of the last push operation |
| Push Count | Total number of successful push operations |
If battery control is enabled, additional sensors are created:
| Sensor | Description |
|---|---|
| Battery Control State | Current command from us: Normal, Idle, Force Charge, Force Discharge, or Limit Charge Power |
| Battery Force Power | Target power in watts (only set during Force Charge/Discharge) |
Data Format
The integration sends the following data to us:
| Field | Description |
|---|---|
watt |
Grid power (positive = import, negative = export) |
producingWatt |
Solar production in watts |
soc |
Battery state of charge (0-100%) |
chargingPower |
Battery power in watts |
powerStorageState |
0=Standby, 1=Charging, 2=Disabled, 3=Discharging |
batteryControlEnabled |
If "true", control commands are requested |
Battery Control
If battery control is enabled, we can send commands to optimize your battery based on electricity prices and solar forecasts. These commands are held in two sensors:
-
Battery Control State: Normal, Idle (pause), Force Charge, Force Discharge, or Limit Charge Power -
Battery Force Power: Desired power for the battery (except in Normal or Idle mode)
Requirements
- An account with Smart Battery Price Control enabled
- A configured dynamic tariff
How it works
- The integration sends
batteryControlEnabled: truewith every push - We respond with control commands (if available)
- The commands appear as sensor values in Home Assistant
Control States
| State | Description |
|---|---|
| Normal | Self-consumption mode (default behavior) |
| Idle | Pause charging and discharging |
| Force Charge | Charge battery at specified power |
| Force Discharge | Discharge battery at specified power |
| Limit Charge Power | Self-consumption with limited charging power |
Using the Sensors
You can use the battery control sensors in Home Assistant automations to control your inverter. For example, create an automation that reads the Battery Control State sensor and sends the corresponding command to your inverter.
Reconfiguration
To change settings after the initial setup:
- Go to Settings > Devices & Services
- Find the clever-PV integration
- Click Configure
- Update the push URL or entity selection
Troubleshooting
Enable debug logging by adding the following lines to your configuration.yaml:
logger:
default: info
logs:
custom_components.cleverpv: debug