fix: align timeseries source with EVCC format - #284
Merged
Conversation
The unified timeseries source was documented as accepting EVCC's
{start, end, value} payload but expected the units EOS Connect uses
internally: EUR/Wh for prices and Wh-per-slot for PV. No real source
publishes either. Pointing the source at EVCC's own /api/tariff/grid
therefore rendered 34660 ct/kWh, and Home Assistant sensors were
rejected over a mandatory `end` field that is never read.
Prices are now read as EUR/kWh and PV as W, matching what EVCC and the
common Home Assistant integrations deliver, with value_unit as an
escape hatch for anything else. `end` is derived from the following
entry. Parsing stays strict otherwise: one malformed entry rejects the
payload, because dropping it would shift every later hourly price a
slot early with nothing in the UI to show for it.
Foreign attribute names remain unsupported by design — the adaptation
path is a Home Assistant template sensor, and the docs now carry
ready-made snippets for the sources reported in the discussion. To make
that strictness workable, the documented but missing
POST /api/config/test-timeseries endpoint now exists and reports the
first slots converted into the unit the schedule shows, so a wrong unit
is visible before saving rather than hours later.
BREAKING CHANGE: existing timeseries configurations inherit the new
default unit and change meaning. Set value_unit to EUR/Wh resp. Wh to
restore the previous behaviour.
Fixes: #214
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The unified timeseries source was documented as accepting EVCC's {start, end, value} payload but expected the units EOS Connect uses internally: EUR/Wh for prices and Wh-per-slot for PV. No real source publishes either. Pointing the source at EVCC's own /api/tariff/grid therefore rendered 34660 ct/kWh, and Home Assistant sensors were rejected over a mandatory
endfield that is never read.Prices are now read as EUR/kWh and PV as W, matching what EVCC and the common Home Assistant integrations deliver, with value_unit as an escape hatch for anything else.
endis derived from the following entry. Parsing stays strict otherwise: one malformed entry rejects the payload, because dropping it would shift every later hourly price a slot early with nothing in the UI to show for it.Foreign attribute names remain unsupported by design — the adaptation path is a Home Assistant template sensor, and the docs now carry ready-made snippets for the sources reported in the discussion. To make that strictness workable, the documented but missing POST /api/config/test-timeseries endpoint now exists and reports the first slots converted into the unit the schedule shows, so a wrong unit is visible before saving rather than hours later.
BREAKING CHANGE: existing timeseries configurations inherit the new default unit and change meaning. Set value_unit to EUR/Wh resp. Wh to restore the previous behaviour.
Fixes: #214