Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
__pycache__/
src/config.bak.yaml
src/config.yaml
src/json/optimize_request.json
src/json/optimize_response.json
src/json/*.json
src/interfaces/__pycache__
src/interfaces/config/battery_config.json
src/interfaces/config/timeofuse_config.json
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# EOS Connect

**EOS Connect** is an open-source tool for intelligent energy management and optimization.
It connects to various smart home platforms (like Home Assistant and OpenHAB) to monitor, forecast, and control your energy flows.
EOS Connect fetches real-time and forecast data (PV, load, prices), processes it via the [EOS (Energy Optimization System)](https://github.com/Akkudoktor-EOS/EOS), and automatically controls devices (such as Fronius inverters or batteries supported by [evcc](https://docs.evcc.io/docs/devices/meters)) to optimize your energy usage and costs.
It supports two optimization backends: the full-featured Akkudoktor EOS (default) and the lightweight EVCC Opt (optional, very fast).
EOS Connect fetches real-time and forecast data, processes it via your chosen optimizer, and controls devices to optimize your energy usage and costs.

**Key Features:**
- **Automated Energy Optimization:**
Expand Down Expand Up @@ -159,8 +159,10 @@ Get up and running with EOS Connect in just a few steps!
### 2. Install via Home Assistant Add-on

- Add the [ohAnd/ha_addons](https://github.com/ohAnd/ha_addons) repository to your Home Assistant add-on store.
- [if needed] Add the [Duetting/ha_eos_addon](https://github.com/Duetting/ha_eos_addon) (or [thecem/ha_eos_addon](https://github.com/thecem/ha_eos_addon)) repository to your Home Assistant add-on store.
- Install both the **EOS Add-on** and the **EOS Connect Add-on**.
- select your preferred optimization backend:
- [if needed] Add the [Duetting/ha_eos_addon](https://github.com/Duetting/ha_eos_addon) (or [thecem/ha_eos_addon](https://github.com/thecem/ha_eos_addon)) repository to your Home Assistant add-on store.
- [if needed] Add [thecem/hassio-evopt](https://github.com/thecem/hassio-evopt) repository to your Home Assistant add-on store. ([found here](https://github.com/evcc-io/evcc/discussions/23213#3-optimizer-im-home-assistant-ha-addon-nutzen))
- Install both the **EOS Add-on** (or **evcc opt**) and the **EOS Connect Add-on**.
- Configure both add-ons via the Home Assistant UI.
- Start both add-ons.
The EOS Connect web dashboard will be available at [http://homeassistant.local:8081](http://homeassistant.local:8081) (or your HA IP).
Expand Down
9 changes: 7 additions & 2 deletions src/CONFIG_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ A default config file will be created with the first start, if there is no `conf

### EOS Server Configuration

- **`eos.source`**:
EOS server source - eos_server, evcc_opt, default (default uses eos_server)

- **`eos.server`**:
EOS server address (e.g., `192.168.1.94`). (Mandatory)
EOS or evcc opt server address (e.g., `192.168.1.94`). (Mandatory)

- **`eos.port`**:
Port for the EOS server. Default: `8503`. (Mandatory)
port for EOS server (8503) or evcc opt server (7050) - default: `8503` (Mandatory)

- **`timeout`**:
Timeout for EOS optimization requests, in seconds. Default: `180`. (Mandatory)
Expand Down Expand Up @@ -389,6 +392,7 @@ load:
additional_load_1_consumption: 1500 # consumption for additional load 1 in Wh - default: 0 (If not needed set to `additional_load_1_sensor: ""`)
# EOS server configuration
eos:
source: eos_server # EOS server source - eos_server, evcc_opt, default (default uses eos_server)
server: 192.168.1.94 # EOS server address
port: 8503 # port for EOS server - default: 8503
timeout: 180 # timeout for EOS optimize request in seconds - default: 180
Expand Down Expand Up @@ -470,6 +474,7 @@ load:
car_charge_load_sensor: Wallbox_Power # item / entity for wallbox power data in watts. (If not needed, set to `load.car_charge_load_sensor: ""`)
# EOS server configuration
eos:
source: eos_server # EOS server source - eos_server, evcc_opt, default (default uses eos_server)
server: 192.168.1.94 # EOS server address
port: 8503 # port for EOS server - default: 8503
timeout: 180 # timeout for EOS optimize request in seconds - default: 180
Expand Down
14 changes: 10 additions & 4 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ def create_default_config(self):
),
"eos": CommentedMap(
{
"server": "192.168.100.100", # Default EOS server address
"port": 8503, # Default port for EOS server
"source": "default", # EOS server source - eos_server, evcc_opt, default
"server": "192.168.100.100", # EOS or evcc opt server address
"port": 8503, # port for EOS server (8503) or evcc opt server (7050) - default: 8503
"timeout": 180, # Default timeout for EOS optimize request
}
),
Expand Down Expand Up @@ -194,9 +195,14 @@ def create_default_config(self):
config.yaml_set_comment_before_after_key(
"eos", before="EOS server configuration"
)
config["eos"].yaml_add_eol_comment("EOS server address", "server")
config["eos"].yaml_add_eol_comment(
"port for EOS server - default: 8503", "port"
"EOS server source - eos_server, evcc_opt, default (default uses eos_server)",
"source",
)
config["eos"].yaml_add_eol_comment("EOS or evcc opt server address", "server")
config["eos"].yaml_add_eol_comment(
"port for EOS server (8503) or evcc opt server (7050) - default: 8503",
"port",
)
config["eos"].yaml_add_eol_comment(
"timeout for EOS optimize request in seconds - default: 180", "timeout"
Expand Down
13 changes: 8 additions & 5 deletions src/eos_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from interfaces.inverter_fronius import FroniusWR
from interfaces.inverter_fronius_v2 import FroniusWRV2
from interfaces.evcc_interface import EvccInterface
from interfaces.eos_interface import EosInterface
from interfaces.optimization_interface import OptimizationInterface
from interfaces.price_interface import PriceInterface
from interfaces.mqtt_interface import MqttInterface
from interfaces.pv_interface import PvInterface
Expand Down Expand Up @@ -106,11 +106,11 @@ def formatTime(self, record, datefmt=None):
LOGLEVEL,
)
# initialize eos interface
eos_interface = EosInterface(
eos_server=config_manager.config["eos"]["server"],
eos_port=config_manager.config["eos"]["port"],
eos_interface = OptimizationInterface(
config=config_manager.config["eos"],
timezone=time_zone,
)

# initialize base control
base_control = BaseControl(config_manager.config, time_zone)
# initialize the inverter interface
Expand Down Expand Up @@ -747,7 +747,7 @@ def __run_optimization_loop(self):
mqtt_interface.update_publish_topics(
{"optimization/state": {"value": self.get_current_state()["request_state"]}}
)
optimized_response, avg_runtime = eos_interface.eos_set_optimize_request(
optimized_response, avg_runtime = eos_interface.optimize(
json_optimize_input, config_manager.config["eos"]["timeout"]
)
# Store the runtime for use in sleep calculation
Expand Down Expand Up @@ -1364,6 +1364,9 @@ def get_controls():
"currency_minor_unit": currency_minor_unit,
},
"state": optimization_scheduler.get_current_state(),
"used_optimization_source": config_manager.config.get("eos", {}).get(
"source", "eos_server"
),
"eos_connect_version": __version__,
"timestamp": datetime.now(time_zone).isoformat(),
"api_version": "0.0.2",
Expand Down
Loading
Loading