Advanced Features
API integration, MQTT control, external system integration, and automation
REST API
EOS Connect provides a comprehensive RESTful web API for real-time data access and remote control on port 8081 (configurable). All endpoints return JSON and can be accessed via HTTP requests.
http://<host>:<port>/ (Default port: 8081)
Main Endpoints
| Endpoint | Method | Description |
|---|---|---|
/json/current_controls.json |
GET | Current system control states (AC/DC charge, mode, discharge state) - reflects final combined state after all overrides |
/json/optimize_request.json |
GET | Last optimization request sent to EOS |
/json/optimize_response.json |
GET | Last optimization response from EOS |
/controls/mode_override |
POST | Override system mode, duration, and grid charge power |
/logs |
GET | Retrieve application logs with optional filtering |
/logs/alerts |
GET | Retrieve warning and error logs for alert system |
/logs/clear |
POST | Clear all stored logs from memory (file logs remain intact) |
/logs/alerts/clear |
POST | Clear only alert logs from memory |
/logs/stats |
GET | Get buffer usage statistics for log storage |
/api/update/status |
GET | Get update notification status (Docker installations only) |
API Examples
Get Current Control States
curl http://localhost:8081/json/current_controls.json
Response Example:
{
"current_states": {
"current_ac_charge_demand": 0,
"current_dc_charge_demand": 10000.0,
"current_discharge_allowed": true,
"inverter_mode": "MODE DISCHARGE ALLOWED",
"inverter_mode_num": 2,
"override_active": false,
"override_end_time": 0
},
"battery": {
"soc": 23.8,
"usable_capacity": 3867.11,
"max_charge_power_dyn": 10000,
"max_charge_power_fix": 10000,
"charging_curve_enabled": true,
"temperature": 25.4,
"max_grid_charge_rate": 10000,
"stored_energy": {
"stored_energy_price": 0.000215,
"duration_of_analysis": 96,
"charged_energy": 12450.5,
"charged_from_pv": 8500.0,
"charged_from_grid": 3950.5,
"ratio": 68.3,
"charging_sessions": [
{
"start_time": "2025-12-21T11:58:06+00:00",
"end_time": "2025-12-21T14:03:17+00:00",
"charged_energy": 772.9,
"charged_from_pv": 772.3,
"charged_from_grid": 0.6,
"ratio": 99.9,
"cost": 0.0002,
"is_inventory": true,
"inventory_energy": 772.9
}
],
"last_update": "2025-12-22T10:15:00Z"
}
},
"localization": {
"currency": "EUR",
"currency_symbol": "€",
"currency_minor_unit": "ct"
},
"evcc": {
"charging_state": false,
"current_sessions": [...]
},
"state": {
"request_state": "response received",
"last_request_timestamp": "2024-11-14T22:28:56.678704+02:00",
"last_response_timestamp": "2024-11-14T22:30:01.194684+02:00",
"next_run": "2024-11-14T22:35:01.196502+02:00"
},
"used_optimization_source": "eos_server",
"used_time_frame_base": 3600,
"eos_connect_version": "0.2.01.138-develop",
"timestamp": "2024-06-01T12:00:00+02:00",
"api_version": "0.0.3"
}
current_discharge_allowed field reflects the final effective state after all overrides (EVCC modes, manual overrides) are applied.
Response Field Reference
current_states
| Field | Type | Description |
|---|---|---|
current_ac_charge_demand |
Integer (W) | AC charge power demand from optimizer (after overrides) |
current_dc_charge_demand |
Float (W) | DC charge power demand from optimizer (after overrides) |
current_discharge_allowed |
Boolean | Whether battery discharge is allowed (final state after all overrides) |
inverter_mode |
String | Current inverter mode as human-readable text |
inverter_mode_num |
Integer | Current inverter mode as number (see mode table) |
override_active |
Boolean | Whether manual mode override is currently active |
override_end_time |
Integer (timestamp) | Unix timestamp when override ends (0 if not active) |
battery
| Field | Type | Description |
|---|---|---|
soc |
Float (%) | Battery state of charge percentage |
usable_capacity |
Float (Wh) | Current usable battery capacity |
max_charge_power_dyn |
Integer (W) | Dynamic maximum charge power (adjusted by temperature/SOC) |
max_charge_power_fix |
Integer (W) | Fixed maximum charge power from configuration |
charging_curve_enabled |
Boolean | Whether temperature-based charging curve is enabled |
temperature |
Float (°C) | Current battery temperature (if available) |
max_grid_charge_rate |
Integer (W) | Maximum allowed grid charge rate from configuration |
stored_energy |
Object | Battery price analysis results (see stored_energy section below) |
stored_energy (Battery Price Analysis)
| Field | Type | Description |
|---|---|---|
stored_energy_price |
Float (€/Wh) | Calculated cost per Wh of energy currently in battery |
duration_of_analysis |
Integer (hours) | How far back historical data was analyzed |
charged_energy |
Float (Wh) | Total energy charged in analysis period |
charged_from_pv |
Float (Wh) | Energy charged from solar PV |
charged_from_grid |
Float (Wh) | Energy charged from grid |
ratio |
Float (%) | Percentage of energy from PV vs grid |
charging_sessions |
Array | Detailed list of charging sessions (see charging_sessions below) |
last_update |
ISO timestamp | When this analysis was last updated |
charging_sessions (Individual Sessions)
| Field | Type | Description |
|---|---|---|
start_time |
ISO timestamp | When this charging session started |
end_time |
ISO timestamp | When this charging session ended |
charged_energy |
Float (Wh) | Total energy charged in this session |
charged_from_pv |
Float (Wh) | Energy from PV in this session |
charged_from_grid |
Float (Wh) | Energy from grid in this session |
ratio |
Float (%) | PV percentage for this session |
cost |
Float (€) | Cost of grid energy in this session |
is_inventory |
Boolean | Whether this session's energy is currently in the battery (LIFO model) |
inventory_energy |
Float (Wh) | How much energy from this session is still in the battery |
localization
| Field | Type | Description |
|---|---|---|
currency |
String | Currency code (e.g., EUR, USD, DKK) |
currency_symbol |
String | Currency symbol (e.g., €, $, kr) |
currency_minor_unit |
String | Minor unit name (e.g., ct for cents, øre) |
evcc
| Field | Type | Description |
|---|---|---|
charging_state |
Boolean | Whether any EVCC charger is currently active |
charging_mode |
String | Current EVCC charging mode (off, pv, minpv, now) |
current_sessions |
Array | Detailed data for each configured EVCC charger (vehicle status, charging details, etc.) |
inverter
| Field | Type | Description |
|---|---|---|
inverter_special_data |
Object / null | Fronius-specific telemetry data (temperatures, fan speeds) - only available for Fronius Gen24 inverters |
state (Optimization Scheduler)
| Field | Type | Description |
|---|---|---|
request_state |
String | Current state of optimizer (e.g., "response received") |
last_request_timestamp |
ISO timestamp | When the last optimization request was sent |
last_response_timestamp |
ISO timestamp | When the last optimization response was received |
next_run |
ISO timestamp | When the next optimization will run |
Root Level Fields
| Field | Type | Description |
|---|---|---|
used_optimization_source |
String | Which optimizer backend is being used (eos_server or evopt) |
used_time_frame_base |
Integer (seconds) | Optimization cycle time frame (3600 = 1 hour, 900 = 15 min) |
eos_connect_version |
String | EOS Connect software version |
timestamp |
ISO timestamp | When this response was generated |
api_version |
String | API version (current: 0.0.3) |
Override System Mode
curl -X POST http://localhost:8081/controls/mode_override \
-H "Content-Type: application/json" \
-d '{
"mode": 1,
"duration": "02:00",
"grid_charge_power": 2.0
}'
Request Parameters:
mode- Integer (see mode table below)duration- String, format "HH:MM"grid_charge_power- Float, kW (e.g., 2.0 for 2000 W)
Success Response:
{
"status": "success",
"message": "Mode override applied",
"applied_settings": {
"mode": 1,
"mode_name": "ChargeFromGrid",
"duration": "02:00",
"grid_charge_power": 2000,
"end_time": "2024-06-01T14:00:00+02:00"
}
}
Optimization Request & Response Reference
EOS Connect sends optimization requests to external servers (EOS or EVopt) and receives optimized control signals in return. These JSON files contain the detailed data that drives the energy optimization.
/json/optimize_request.json- Last request data sent to optimization server/json/optimize_response.json- Last optimization results received- Configuration: Set
time_framein config.yaml to control request interval. See Time Slot Configuration for details (default: 3600s)
Optimization Request Structure (optimize_request.json)
The request contains all current system state and forecast data sent to the optimization server:
Top-Level Sections
| Section | Type | Description |
|---|---|---|
ems |
Object | Energy management system data - forecasts and pricing |
pv_akku |
Object | Battery (Akkumulator) specifications and current state |
inverter |
Object | Inverter specifications and power limits |
eauto |
Object | Electric vehicle battery specifications (if EV charging enabled) |
dishwasher |
Object | Flexible load specifications (e.g., dishwasher, heat pump) |
temperature_forecast |
Array | Temperature forecast (array length depends on time_frame config: 192 slots for 15-min or 48 for 60-min intervals) |
start_solution |
Array | Initial optimization hint from previous run (optimization acceleration) |
EMS (Energy Management System) Fields
| Field | Type | Unit | Description |
|---|---|---|---|
pv_prognose_wh |
Array | Wh/slot | PV power forecast (one value per time slot; length varies: 192 for 15-min slots or 48 for 60-min slots) |
strompreis_euro_pro_wh |
Array | €/Wh | Electricity purchase price forecast (length varies by time_frame config) |
einspeiseverguetung_euro_pro_wh |
Array | €/Wh | Feed-in tariff for selling to grid (length varies by time_frame config) |
preis_euro_pro_wh_akku |
Array | €/Wh | Battery storage cost considering wear/efficiency (length varies by time_frame config) |
gesamtlast |
Array | Wh/slot | Total household load forecast (length varies by time_frame config) |
Battery (pv_akku) Fields
| Field | Type | Unit | Description |
|---|---|---|---|
capacity_wh |
Float | Wh | Total battery capacity |
charging_efficiency |
Float | 0-1 | Efficiency during charging (e.g., 0.92 = 92%) |
discharging_efficiency |
Float | 0-1 | Efficiency during discharging |
max_charge_power_w |
Float | W | Maximum charging power capability |
initial_soc_percentage |
Float | % | Current state of charge (0-100%) |
min_soc_percentage |
Float | % | Minimum allowed discharge level for longevity |
max_soc_percentage |
Float | % | Maximum allowed charge level for longevity |
Optimization Response Structure (optimize_response.json)
The response contains time-series control signals and detailed optimization results:
Control Signals (Time Series Arrays)
All control signals are time-series arrays with length determined by the time_frame configuration (typically 192 values for 15-minute slots or 48 for 60-minute slots):
| Signal | Type | Value Range | Description |
|---|---|---|---|
ac_charge |
Array[Float] | 0 - max_power_w | AC Charging Power: Grid-to-battery charging power for each time slot (array length depends on optimizer config) |
dc_charge |
Array[Float] | 0 - max_power_w | DC Charging Power (Fronius Gen24 only): Controls PV-to-battery charging per slot. Value of 0 blocks PV charging (array length depends on optimizer config) |
discharge_allowed |
Array[Boolean] | true / false | Discharge Permission: Whether battery can discharge to the load in this slot |
Result Summary Fields
The result object contains aggregated optimization outcomes:
| Field | Type | Unit | Description |
|---|---|---|---|
Gesamtbilanz_Euro |
Float | € | Net Balance: Total costs minus feed-in revenues (negative = savings) |
Gesamtkosten_Euro |
Float | € | Total Costs: Grid purchased energy cost |
Gesamteinnahmen_Euro |
Float | € | Total Income: Revenue from feeding energy to grid |
Gesamt_Verluste |
Float | Wh | Total Losses: Battery inefficiency losses over the optimization forecast period |
akku_soc_pro_stunde |
Array[Float] | % | Battery SOC Forecast: Predicted state of charge per time slot (array length depends on optimizer config) |
Netzbezug_Wh_pro_Stunde |
Array[Float] | Wh | Grid Import per Slot: Grid energy purchases per time slot (array length depends on optimizer config) |
Netzeinspeisung_Wh_pro_Stunde |
Array[Float] | Wh | Grid Export per Slot: Grid energy feed-in per time slot (array length depends on optimizer config) |
Metadata Fields
| Field | Type | Description |
|---|---|---|
timestamp |
String (ISO 8601) | When this optimization was calculated |
eautocharge_hours_float |
Float or null | Optimized EV charging window duration (if EV charging enabled) |
start_solution |
Array | Optimization hint for next run (internal use) |
Using Response Data for Home Assistant Automations
You can call the /json/optimize_response.json REST API endpoint to extract forecast data for automations:
curl http://localhost:8081/json/optimize_response.json | jq '.result.akku_soc_pro_stunde[0]'
Example Use Cases:
- Forecast SOC: Get
result.akku_soc_pro_stundearray to predict battery charge level across the forecast horizon - Grid Cost Savings: Use
result.Gesamtbilanz_Euroto display savings from optimized operation - Load Shifting Automation: Use
discharge_allowed[next_slot]to schedule flexible loads when battery can discharge - Solar Curtailment: Monitor
result.Netzeinspeisung_Wh_pro_Stundeto optimize PV feed-in patterns
time_frame setting and optimizer backend. See Time Slot Configuration & Optimizer Constraints for details on array lengths and which optimizers support 15-minute vs. 60-minute intervals.
System Mode Reference
| Mode Name | Mode Number | Description |
|---|---|---|
| Auto | -2 | Fully automatic optimization (default mode) |
| StartUp | -1 | System startup state |
| Charge from Grid | 0 | Force battery charging from the grid |
| Avoid Discharge | 1 | Prevent battery discharge. PV charging is controlled by the optimizer's dc_charge signal: if dc_charge=0 the battery is fully isolated (no discharge, no PV charging) — Fronius Gen24 only; on other inverters PV charging is unrestricted. |
| Discharge Allowed | 2 | Allow battery discharge. PV charging is controlled by the optimizer's dc_charge signal: if dc_charge=0 the battery drains but will not be refilled by PV (e.g. during negative PV price slots) — Fronius Gen24 only; on other inverters PV charging is unrestricted. |
| Avoid Discharge EVCC FAST | 3 | Avoid discharge with EVCC fast charge |
| Discharge Allowed EVCC PV | 4 | Allow discharge with EVCC PV mode |
| Discharge Allowed EVCC MIN+PV | 5 | Allow discharge with EVCC MIN+PV mode |
| Charge from Grid EVCC FAST | 6 | Grid charging during fast EV charge |
Logging API
Get Recent Logs
# Get last 50 error logs
curl "http://localhost:8081/logs?level=ERROR&limit=50"
# Get logs since specific time
curl "http://localhost:8081/logs?since=2024-06-01T11:00:00Z"
Query Parameters:
level- Filter by log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)limit- Maximum number of records (default: 100)since- ISO timestamp to get logs since that time
Get System Alerts
curl http://localhost:8081/logs/alerts
Response Example:
{
"alerts": [...],
"grouped_alerts": {
"WARNING": [...],
"ERROR": [...],
"CRITICAL": [...]
},
"alert_counts": {
"WARNING": 1,
"ERROR": 0,
"CRITICAL": 0
}
}
Get Log Buffer Statistics
curl http://localhost:8081/logs/stats
Response Example:
{
"buffer_stats": {
"main_buffer": {
"current_size": 3456,
"max_size": 5000,
"usage_percent": 69.1
},
"alert_buffer": {
"current_size": 23,
"max_size": 2000,
"usage_percent": 1.2
}
}
}
- Main buffer: Stores last 5000 log entries (all levels)
- Alert buffer: Stores last 2000 alerts (WARNING/ERROR/CRITICAL)
- Persistent storage: File-based logs not affected by memory operations
- Thread-safe: Safe for concurrent access from multiple clients
Update Status API (Docker Only)
Docker image installations can check for available updates via the update status API. This endpoint is only active for Docker installations - Home Assistant Add-on users receive updates through the HA Supervisor.
Get Update Status
curl http://localhost:8081/api/update/status
Response Example (Update Available):
{
"update_status": {
"enabled": true,
"is_ha_addon": false,
"current_version": "0.2.30",
"is_develop_branch": false,
"update_available": true,
"latest_version": "0.2.31",
"last_check_time": 1704729600.0,
"last_check_success": true,
"last_error": null,
"next_check_in_seconds": 39847
},
"timestamp": "2024-01-08T14:30:00+00:00",
"api_version": "0.0.1"
}
Response Example (HA Add-on):
{
"update_status": {
"enabled": false,
"is_ha_addon": true,
"current_version": "0.2.30",
"is_develop_branch": false,
"update_available": false,
"latest_version": null,
"last_check_time": null,
"last_check_success": false,
"last_error": null,
"next_check_in_seconds": 0
},
"timestamp": "2024-01-08T14:30:00+00:00",
"api_version": "0.0.1"
}
Response Fields
| Field | Type | Description |
|---|---|---|
enabled |
Boolean | Whether update checking is active (true for Docker, false for HA) |
is_ha_addon |
Boolean | Whether running as Home Assistant Add-on |
current_version |
String | Currently installed EOS Connect version |
is_develop_branch |
Boolean | Whether on develop branch (vs stable) |
update_available |
Boolean | Whether a newer version is available(false always for HA) |
latest_version |
String | Latest available version (null if not checked or no update) |
last_check_time |
Float | Unix timestamp of last update check (null if never checked) |
last_check_success |
Boolean | Whether last check succeeded |
last_error |
String | Error message from last check (null if successful) |
next_check_in_seconds |
Integer | Seconds until next automatic check (0 for HA or immediate check) |
0.2.30) vs develop (0.2.31.236-develop) versions and only shows matching updates.
Sensor Auto-Detection
EOS Connect automatically detects battery and grid sensor polarity using a lightweight energy balance validation. This ensures correct attribution of battery charging between PV and Grid — even if your sensors report inverted signs.
- What it solves: Prevents PV attribution at night when PV≈0 by recognizing inverted grid import sensors
- How it works: Tests 4 sign combinations and selects the one that balances PV + Grid + Battery = Load across recent samples
- Performance: Uses ≤200 samples from the last 48h; detection typically runs in <100 ms
Log Example:
[BATTERY-PRICE] Detected conventions: battery=negative_charging grid=negative_import (counts: 49,2,201,2 from 203 samples)
MQTT Integration
EOS Connect publishes real-time system data and control states to MQTT topics, and subscribes to control commands for remote system management.
Configuration
mqtt:
enabled: true
broker: localhost
port: 1883
user: mqtt_user
password: mqtt_password
tls: false
ha_mqtt_auto_discovery: true
ha_mqtt_auto_discovery_prefix: homeassistant
<mqtt_configured_prefix>/eos_connect/ (e.g., myhome/eos_connect/)
Published Topics (Read System State)
EOS Connect publishes comprehensive real-time data to these topics:
| Topic Suffix | Type | Description |
|---|---|---|
| Optimization & Control | ||
optimization/state |
String | Current optimization request state ("ok", "error") |
optimization/last_run |
ISO timestamp | Timestamp of last optimization run |
optimization/next_run |
ISO timestamp | Timestamp of next scheduled run |
control/overall_state |
Integer | Current system mode (see mode table) |
control/override_active |
Boolean | Whether manual override is active |
control/override_end_time |
ISO timestamp | When override ends |
control/override_charge_power |
Integer (W) | Override grid charge power |
control/eos_ac_charge_demand |
Integer (W) | AC charge demand from optimizer |
control/eos_dc_charge_demand |
Integer (W) | DC charge demand from optimizer |
control/eos_discharge_allowed |
Boolean | Discharge allowed (final effective state after all overrides) |
control/eos_homeappliance_released |
Boolean | Home appliance scheduling released |
control/eos_homeappliance_start_hour |
Integer (hour) | Optimal home appliance start hour |
| Battery Data | ||
battery/soc |
Float (%) | Battery state of charge |
battery/remaining_energy |
Integer (Wh) | Usable battery capacity |
battery/dyn_max_charge_power |
Integer (W) | Dynamic maximum charge power |
| Inverter Data (Fronius Only) | ||
inverter/special/temperature_inverter |
Float (°C) | Inverter ambient temperature |
inverter/special/temperature_ac_module |
Float (°C) | AC module temperature |
inverter/special/temperature_dc_module |
Float (°C) | DC module temperature |
inverter/special/temperature_battery_module |
Float (°C) | Battery module temperature |
inverter/special/fan_control_01 |
Integer | Fan control 1 status |
inverter/special/fan_control_02 |
Integer | Fan control 2 status |
| EVCC Data (if configured) | ||
evcc/[name]/mode |
String | EVCC charging mode (off, pv, minpv, now) |
evcc/[name]/connected |
Boolean | Vehicle connection status |
evcc/[name]/charging |
Boolean | Active charging status |
| System Status | ||
status |
String | Always "online" when running |
control/eos_discharge_allowed topic reflects the final effective state after combining optimizer output, EVCC overrides, and manual overrides. This ensures all outputs (MQTT, Web API, inverter commands) are consistent.
Subscribed Topics (Send Control Commands)
Control EOS Connect by publishing messages to these topics:
| Topic Suffix | Expected Payload | Description |
|---|---|---|
control/overall_state/set |
Integer or String (see table) | Change system mode |
control/override_remain_time/set |
String "HH:MM" | Set override duration (e.g., "02:00") |
control/override_charge_power/set |
Integer (watts) | Set grid charge power (e.g., 2000) |
System Mode Control Reference
When publishing to control/overall_state/set, use either mode name or number:
| Mode Name | Mode Number | Description |
|---|---|---|
| Auto | -2 | Fully automatic optimization (default) |
| Charge from Grid | 0 | Force battery charging from grid |
| Avoid Discharge | 1 | Prevent battery discharge |
| Discharge Allowed | 2 | Allow battery discharge |
MQTT Command Examples
Set System to Automatic Mode
mosquitto_pub -t "myhome/eos_connect/control/overall_state/set" -m "Auto"
# or
mosquitto_pub -t "myhome/eos_connect/control/overall_state/set" -m "-2"
Force Grid Charging
mosquitto_pub -t "myhome/eos_connect/control/overall_state/set" -m "Charge from Grid"
# or
mosquitto_pub -t "myhome/eos_connect/control/overall_state/set" -m "0"
Set Override Duration to 1.5 Hours
mosquitto_pub -t "myhome/eos_connect/control/override_remain_time/set" -m "01:30"
Set Grid Charge Power to 1500W
mosquitto_pub -t "myhome/eos_connect/control/override_charge_power/set" -m "1500"
Monitor Battery SOC
mosquitto_sub -t "myhome/eos_connect/battery/soc"
Update Notification Topics (Docker Only)
For Docker image installations, EOS Connect publishes update status to MQTT. These topics are not published for Home Assistant Add-on installations since updates are managed by the Supervisor.
| Topic Suffix | Type | Description |
|---|---|---|
| Update Status | ||
system/update_available |
Binary (ON/OFF) | Whether an update is available |
system/current_version |
String | Current EOS Connect version |
system/latest_version |
String | Latest available version (empty if none) |
system/update_check_enabled |
Binary (ON/OFF) | Whether update checking is enabled (ON for Docker, OFF for HA) |
MQTT Update Automation Example
Create a Home Assistant automation to notify when updates are available:
automation:
- alias: "EOS Connect Update Notification"
trigger:
- platform: state
entity_id: binary_sensor.eos_connect_update_available
to: 'on'
action:
- service: notify.mobile_app
data:
title: "EOS Connect Update Available"
message: >
New version {{ states('sensor.eos_connect_latest_version') }}
is available (current: {{ states('sensor.eos_connect_current_version') }})
data:
url: https://github.com/Ohand/EOS_connect/pkgs/container/eos_connect
binary_sensor.eos_connect_update_availablesensor.eos_connect_current_versionsensor.eos_connect_latest_versionbinary_sensor.eos_connect_update_check_enabled
Home Assistant MQTT Auto Discovery
When enabled (ha_mqtt_auto_discovery: true), EOS Connect automatically creates Home Assistant entities for all sensors and controls.
sensor.eos_connect_battery_socsensor.eos_connect_battery_remaining_energysensor.eos_connect_optimization_stateswitch.eos_connect_discharge_allowed- And many more...
All entities are automatically organized under the EOS Connect device in Home Assistant.
External Integrations
Home Assistant Integration
Add-on Installation
- Add repository: ohAnd/ha_addons
- Install EOS Connect add-on
- Configure via add-on UI
- Enable MQTT in config for auto-discovery
Using Sensors
Configure sensor sources in config.yaml:
battery:
source: homeassistant
url: http://homeassistant:8123
access_token: "your_long_lived_access_token"
soc_sensor: sensor.battery_soc
OpenHAB Integration
load:
source: openhab
url: http://openhab:8080
load_sensor: Load_Power
battery:
source: openhab
url: http://openhab:8080
soc_sensor: Battery_SOC
EVCC Integration
EOS Connect integrates with EVCC at multiple levels: data ingestion, charging state monitoring, and optimizer decision adaptation.
As Data Source
evcc:
url: http://192.168.1.100:7070
pv_forecast_source:
source: evcc # Use EVCC's PV forecasts
Charging State Monitoring
EOS Connect continuously monitors EVCC's charging state and charging mode. When the system detects that the EV is actively charging (any mode except "off"), it adapts its control strategy to account for the additional load and EV charging priorities:
| EVCC Charging Mode | EOS Connect Reaction | Optimizer Decision Override |
|---|---|---|
| Fast Charge ( now, pv+now, minpv+now, etc.) |
Prioritizes EV charging from grid/available power | Prevents battery discharge to ensure maximum power available for the car. Even if optimizer suggests discharge, battery is held to support immediate EV charging needs. |
| PV Mode ( pv) |
Coordinates battery and PV to support EV charging | Allows battery discharge if needed to support PV-sourced charging. Battery can discharge to help PV power reach the car. |
| Min+PV Mode ( minpv) |
Allows battery discharge for efficient EV charging | Allows battery discharge with minimum grid feed. Battery discharges to supplement PV and minimize grid import while EV charges. |
| Off | Normal optimizer control (no EV charging) | No override — optimizer decisions apply normally |
Example Scenarios
- Time: 14:30, sunny day, PV generating 3kW
- Optimizer decision: "Discharge allowed" (prices favorable for battery use)
- EV charging mode: "now" (fast charge)
- EOS Connect action: Overrides optimizer to "Avoid discharge" — prioritizes grid/PV to charge EV immediately instead
- Control state: "MODE_AVOID_DISCHARGE_EVCC_FAST"
- Time: 16:45, cloudy afternoon, PV generating 1.5kW
- Optimizer decision: "Charge from grid" (low prices)
- EV charging mode: "pv" (prefer solar)
- EOS Connect action: Allows battery to discharge to assist PV charging the EV. Total available for EV = PV (1.5kW) + Battery discharge (up to configured limit)
- Control state: "MODE_DISCHARGE_ALLOWED_EVCC_PV"
- Condition: EV not plugged in or EVCC in "off" mode
- EOS Connect action: Operates in normal optimizer control mode — no EVCC-specific overrides applied
- Control state: "MODE_CHARGE_FROM_GRID", "MODE_AVOID_DISCHARGE", or "MODE_DISCHARGE_ALLOWED" (standard modes)
Configuration
# EVCC server connection (required for monitoring)
evcc:
url: http://192.168.1.100:7070 # EVCC API endpoint
# Car charge is automatically integrated into load calculations
load:
car_charge_load_sensor: sensor.evcc_mqtt_evcc_charge_power # EV charging power in watts
Fronius Inverter Integration
Enhanced Interface (Recommended)
inverter:
type: fronius_gen24
address: 192.168.1.12
user: customer
password: your_password
max_grid_charge_rate: 5000
max_pv_charge_rate: 5000
Legacy Interface
Use type: fronius_gen24_legacy for corner cases or troubleshooting.
EVCC External Battery Control
Universal interface for all EVCC-supported inverters:
inverter:
type: evcc
# Inverter controlled via EVCC's external battery API
Automation Examples
Home Assistant Automations
Charge Battery During Cheap Hours
automation:
- alias: "Charge battery during low prices"
trigger:
- platform: numeric_state
entity_id: sensor.electricity_price
below: 0.15 # €0.15/kWh
condition:
- condition: numeric_state
entity_id: sensor.eos_connect_battery_soc
below: 80
action:
- service: mqtt.publish
data:
topic: "myhome/eos_connect/control/overall_state/set"
payload: "Charge from Grid"
- service: mqtt.publish
data:
topic: "myhome/eos_connect/control/override_remain_time/set"
payload: "02:00"
Stop Discharge During High Load
automation:
- alias: "Preserve battery during high consumption"
trigger:
- platform: numeric_state
entity_id: sensor.house_power
above: 5000 # 5 kW
action:
- service: mqtt.publish
data:
topic: "myhome/eos_connect/control/overall_state/set"
payload: "Avoid Discharge"
Node-RED Flows
Use MQTT nodes to:
- Monitor EOS Connect status
- Trigger controls based on external events
- Create custom dashboards
- Log data to databases
Python Automation Script
import requests
import json
# Get battery status
response = requests.get('http://localhost:8081/api/battery')
battery = response.json()
# If SOC below 20% and prices are low, force charge
if battery['soc'] < 0.20:
requests.post('http://localhost:8081/api/controls/mode',
json={'mode': 'ChargeFromGrid', 'duration_minutes': 120})
Advanced Configuration Tips
Dynamic Battery Price Calculation
Enable for real cost tracking:
battery:
price_calculation_enabled: true
price_update_interval: 900 # 15 minutes
price_history_lookback_hours: 96 # 4 days
battery_power_sensor: sensor.battery_power
pv_power_sensor: sensor.pv_power
grid_power_sensor: sensor.grid_power
price_sensor: sensor.electricity_price
Multiple PV Installations
pv_forecast:
- name: Main_Roof_South
azimuth: 180
tilt: 25
power: 5000
- name: Garage_East
azimuth: 90
tilt: 15
power: 2500
- name: Carport_West
azimuth: 270
tilt: 10
power: 3000
Solcast with Rate Limiting
pv_forecast_source:
source: solcast
api_key: "your_api_key"
# EOS Connect auto-extends to 2.5h intervals for Solcast
# to stay within 10 API calls/day limit
Temperature-Based Battery Protection
battery:
charging_curve_enabled: true
sensor_battery_temperature: sensor.byd_battery_temperature
# Automatic power reduction in extreme temperatures
Next Steps
Detailed configuration for all features
Architecture and contribution info
Ask questions and share ideas