Skip to content

Develop - #272

Merged
ohAnd merged 22 commits into
mainfrom
develop
Jul 16, 2026
Merged

Develop#272
ohAnd merged 22 commits into
mainfrom
develop

Conversation

@ohAnd

@ohAnd ohAnd commented Jul 16, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several important updates to documentation, configuration schema, and user instructions for EOS Connect, focusing on improved optimizer grid limit handling, enhanced data quality management, and clearer guidelines for contributors and users. The changes also include version bumps and improved documentation for both advanced and user-level features.

Key changes include:

Optimizer and Grid Limit Features

  • Added new configuration options eos.external_evopt_max_grid_import_w and eos.external_evopt_max_grid_export_w for external EVopt optimizer grid import/export limits, including validation, help text, and documentation links. These enable smart defaults and explicit override of grid constraints for optimization.
  • Updated advanced documentation to include a dedicated section on "Smart Grid Limits (EVopt)", with explanations, configuration examples, and troubleshooting, helping users correctly set up and verify optimizer grid limits. [1] [2]

Data Quality and User Guidance

  • Documented a new "Robust Data Quality Handling" feature: automatic detection and forward-filling of incomplete Home Assistant sensor data, ensuring the optimizer always receives valid input arrays. [1] [2]
  • Improved and clarified README and user guide navigation for new and advanced features, including explicit guidance on what to include in the README and how to document user-facing features. [1] [2] [3]

Documentation and Versioning

  • Bumped version to v0.3.36 across documentation and workflow files. [1] [2] [3] [4] [5]
  • Updated documentation for Proxmox/KVM64 CPU limitations with clearer troubleshooting steps and solutions for VM users.

Configuration Schema Improvements

  • Improved the description for fixed price arrays in the configuration schema, clarifying format and automatic expansion behavior.

These changes collectively enhance the reliability, usability, and maintainability of EOS Connect for both end users and contributors.

ohAnd and others added 20 commits June 23, 2026 14:59
Update version references across all files:
- src/version.py
- .github/workflows/docker_develop.yml
- docs version badges (6 files)
- Add expert-level config fields external_evopt_max_grid_import/export_w
- Implement smart defaults: grid limits default to inverter limits when 0
- Update OptimizationInterface to receive and apply inverter limits
- Pass inverter limits from eos_connect to optimization backends
- Add comprehensive test coverage (8 new grid limit tests)
- Document smart defaults in user-guide and advanced sections
- Update README with grid limits feature mention
- Maintain full backward compatibility with existing configurations

Fixes: #268
Files changed:
M	src/version.py
Root cause of #267: HA sensor history gaps cause LoadInterface to
skip datapoints, resulting in incomplete 47-value arrays instead of
48. EOS Server validates array length and rejects with 422.

Solution: Forward-fill (LOCF) automatically recovers from gaps.
LoadInterface now guarantees 48 complete values.
Files changed:
M	src/version.py
…ous Infeasible errors

test: update forward-fill logging to use debug level instead of warning - fix Local EVopt backend: tight_M sizing ignores configured grid import/export limits, causing spurious Infeasible (regression from #268 smart defaults)
Fixes #269
Files changed:
M	src/version.py
Add schema-level validation to prevent configuration errors:
- price.fixed_24h_array must be exactly 24 comma-separated numeric values
- Only validated when price.source="fixed_24h"
- Clear error messages on save if validation fails
- Prevents mismatched array lengths from reaching optimization

Fixes: #267
pv_forecast_source.source: timeseries was accepted by config validation
and configurable in the UI (data_url, data_path, data_token), but
PvInterface.__get_pv_forecast() had no case for it, silently falling
back to the synthetic default triangle forecast instead of fetching
data_url.

Adds __get_pv_forecast_timeseries(), reusing the same standardized
[{start, end, value}] format PriceInterface's timeseries source already
uses, with a PV-appropriate twist: 15-min-to-hourly conversion sums
(not averages, since values are energy-per-slot rather than a rate),
and incomplete data pads with 0 instead of the last known value.

Fetched once globally (not per pv_forecast.N array entry) and aligned
by absolute "start" timestamp to a midnight-anchored slot grid - both
match __get_pv_forecast_evcc_api's existing behaviour, and are required
because get_ems_data() in eos_connect.py indexes pv_forcast_array by
slots-since-midnight-today, not by position.

Tested against a self-hosted forecast service returning real
15-minute-resolution PV data; verified end to end against the running
optimizer (matching totals between the service and EOS_connect's own
computed values).
Previously, EVCC data < 192 entries always triggered fallback chain, even for
complete single-day data (96 entries). Now only valid complete days (96/192
for 15-min, 24/48 for hourly) use cyclic padding; invalid counts use fallback.

Also reorganized 125 price tests into 3-level hierarchy under tests/interfaces/price/.
Files changed:
M	src/version.py
- Extract ISO8601 timestamps from EVCC feed-in rate objects
- Detect resolution (15-min, 30-min, hourly) from time deltas
- Filter rates to requested 48-hour window using start_time parameter
- Convert 15-min to hourly using timestamp-aware slot-based averaging
- Always return exactly tgt_duration slots (prevent 588-value arrays)
- Add helper methods: _detect_resolution_from_timeseries(), __convert_15min_to_hourly_feedin_timeseries()

Fixes: #267 (Part 2 - feedin resolution conversion)
Related: #267 (Part 1 - grid price validation)
Files changed:
M	src/version.py
Enhance timeseries PV forecast handling to be truly robust:

Robustness improvement:
- Timestamps now aligned to resolution boundaries before slot lookup
- Handles data starting at midnight, "now", or any arbitrary time
- Maintains midnight-indexed output for optimizer compatibility
- Fixes silent data loss when HA templates generated "now"-aligned slots

Original implementation:
- HTTP fetch with Bearer token auth, 3-retry mechanism
- Auto-detect 15min vs hourly resolution
- 15-to-60min conversion via energy summing
- Validation at startup (data_url checks, URL format)
- Context-aware error messages with recovery status
- Diagnostic logging (entry counts, value ranges, failure hints)

Test coverage:
- 15 parsing tests (format, resolution, alignment)
- 8 validation tests (config scenarios, URL validation)
- 45 existing PV tests (no regressions)
- Full 988-test suite passing

Fixes: #270
Related: #271
Files changed:
M	src/version.py
Comment thread src/interfaces/pv_interface.py Dismissed
Comment thread src/interfaces/pv_interface.py Dismissed
Comment thread src/config_web/api.py Dismissed
@ohAnd
ohAnd merged commit 63684bb into main Jul 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants