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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ This project is in its early stages and is actively being developed and enhanced

### Base

EOS Connect is a self-running system that periodically collects:
**EOS Connect** is a self-running system that periodically collects:
- Local energy consumption data.
- PV solar forecasts for the next 48 hours.
- Upcoming energy prices.

Using this data, a request is sent to EOS, which creates a model predicting the energy needs based on different energy sources and loads (grid, battery, PV).

EOS Connect waits for the response from EOS (e.g., ~2 min 15 sec for a full 48-hour prediction on a Raspberry Pi 5). After receiving the response, it is analyzed to extract the necessary values.
**EOS Connect** waits for the response from EOS (e.g., ~2 min 15 sec for a full 48-hour prediction on a Raspberry Pi 5). After receiving the response, it is analyzed to extract the necessary values.

Finally, the system sets up the inverter based on the following states:
- `MODE_CHARGE_FROM_GRID` with a specific target charging power (based on your configuration).
Expand Down Expand Up @@ -103,11 +103,15 @@ Energy price forecasts are retrieved from the chosen source (TIBBER or AKKUDOKTO

## Webpage Example

The dashbaord of **EOS connect** is available at `http://localhost:8081`.

![webpage screenshot](doc/screenshot.PNG)

## Configuration

Configuration is described here [CONFIG_README](src/CONFIG_README.md)
With the first start of **EOS connect** a default `config.yaml` will be generated in the `\src` folder. For full documentation for the different entries go to [CONFIG_README](src/CONFIG_README.md)

*Note: With the default config and a valid EOS server IP/DNS name entry ('eos -> server') - **EOS connect** should be running out of the box with some static defaults as a start point for a step-by-step commissioning.*

## Useful Information

Expand Down
Binary file modified doc/screenshot.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
348 changes: 212 additions & 136 deletions src/CONFIG_README.md

Large diffs are not rendered by default.

233 changes: 125 additions & 108 deletions src/config.py

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions src/interfaces/eos_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ def eos_set_optimize_request(self, payload, timeout=180):
logger.error("[EOS] OPTIMIZE Request timed out after %s seconds", timeout)
return {"error": "Request timed out - trying again with next run"}
except requests.exceptions.RequestException as e:
logger.error("[EOS] OPTIMIZE Request failed: %s - response: %s", e, response)
logger.error(
"[EOS] OPTIMIZE Request failed: %s - response: %s", e, response
)
return {"error": str(e)}

def examine_response_to_control_data(self, optimized_response_in):
Expand Down Expand Up @@ -347,7 +349,6 @@ def __retrieve_eos_version(self):
"""
try:
response = requests.get(self.base_url + "/v1/health", timeout=10)
# response = requests.get(self.base_url + "/v1/config", timeout=10)
response.raise_for_status()
eos_version = response.json().get("status")
if eos_version == "alive":
Expand All @@ -365,8 +366,21 @@ def __retrieve_eos_version(self):
"[EOS] HTTP error occurred while getting EOS version: %s", e
)
return None
except requests.exceptions.ConnectTimeout:
logger.error(
"[EOS] Failed to get EOS version - Server not reachable:"+
" Connection to %s timed out",
self.base_url,
)
return "Server not reachable"
except requests.exceptions.ConnectionError as e:
logger.error(
"[EOS] Failed to get EOS version - Server not reachable: Connection error: %s",
e,
)
return "Server not reachable"
except requests.exceptions.RequestException as e:
logger.error("[EOS] Failed to get EOS version: %s", e)
logger.error("[EOS] Failed to get EOS version - Error: %s", e)
return None
except json.JSONDecodeError as e:
logger.error("[EOS] Failed to decode EOS version response: %s", e)
Expand Down
7 changes: 5 additions & 2 deletions src/interfaces/evcc_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def start_update_service(self):
"""
Starts the background thread to periodically update the charging state.
"""
if self.url == "http://yourEVCCserver:7070":
logger.warning("[EVCC] Update service not started. URL is not set.")
return
if self._update_thread is None or not self._update_thread.is_alive():
self._stop_event.clear()
self._update_thread = threading.Thread(
Expand Down Expand Up @@ -133,7 +136,7 @@ def __request_charging_state(self):
"""
Fetches the EVCC state from the API and returns the charging state.
"""
data = self.fetch_evcc_state_via_api()
data = self.__fetch_evcc_state_via_api()
if not data or not isinstance(data.get("result", {}).get("loadpoints"), list):
logger.error("[EVCC] Invalid or missing loadpoints in the response.")
return None
Expand Down Expand Up @@ -172,7 +175,7 @@ def __request_charging_state(self):

return charging_state, charging_mode

def fetch_evcc_state_via_api(self):
def __fetch_evcc_state_via_api(self):
"""
Fetches the state of the EVCC (Electric Vehicle Charging Controller) via its API.

Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = 'snapshot-v0.1.6'
__version__ = 'develop-v0.1.36'
Loading