-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Energy demand profile: improve prediction accuracy for heating loadpoints #28232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
daniel309
wants to merge
216
commits into
evcc-io:master
Choose a base branch
from
daniel309:feature/temperature-correction
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 191 commits
Commits
Show all changes
216 commits
Select commit
Hold shift + click to select a range
53510e8
fix power scale
daniel309 957325d
add limittemp
daniel309 eea11a7
add LPC mode register values as comment
daniel309 d8c4ac2
Merge branch 'master' into master
daniel309 686fa41
Merge branch 'master' into master
daniel309 024ec33
Merge branch 'evcc-io:master' into master
daniel309 42adbdc
Merge branch 'master' of https://github.com/daniel309/evcc
daniel309 29c516f
Merge branch 'master' of https://github.com/daniel309/evcc
daniel309 053eab6
Merge remote-tracking branch 'upstream/master'
daniel309 0fc1f68
feat: add temperature-based household load correction
daniel309 dcc047d
Implement heater profile separation for temperature correction
daniel309 91ba003
fix: remove incorrect temperature correction fallback
daniel309 c35e440
feat: add debug logging for heater profile separation
daniel309 0050874
feat: require explicit configuration for temperature correction
daniel309 2e73f28
chore: remove documentation files
daniel309 1b0fe62
refactor: remove unnecessary nearestRate() function
daniel309 c3a7988
refactor: add meter type constants for clarity
daniel309 c5629bb
feat: use _household constant with GORM default value
daniel309 ebe56c9
fix: address code review comments
daniel309 807d967
refactor: pre-index rates for clearer temperature lookup
daniel309 d7fd335
fix: remove trailing whitespace for linter
daniel309 8dcdc6a
fix: correct indentation for gci linter
daniel309 7c9ab6c
fix: remove all trailing whitespace from blank lines
daniel309 2ce3d68
feat: add loadpoint-specific energy tracking to metrics
daniel309 1618227
Increase loadpoint meter ID offset to 1000 and extract as constant
daniel309 ce86770
Fix formatting (golangci-lint)
daniel309 2c5affb
Extract 24h average temperature calculation into separate function
daniel309 346f54c
Improve heater profile debug message with slot count
daniel309 976c63e
Add debug logging for temperature correction adjustments
daniel309 40796d5
Fix temperature correction debug message units (kWh -> Wh)
daniel309 9976bcb
Merge branch 'master' into feature/temperature-correction
daniel309 ecd3cf7
Merge branch 'master' of https://github.com/evcc-io/evcc into feature…
daniel309 55225da
fix: scale kWh to Wh in 15min consumption debug logs
daniel309 1521829
Merge branch 'feature/temperature-correction' of https://github.com/d…
daniel309 e632bd0
test: add temperature correction tests
daniel309 297cf68
fix: format test file
daniel309 61f8ae0
Remove heatingThreshold configuration and logic
daniel309 0e8a216
Replace heatingCoefficient with per-charger OutdoorTemperatureSensiti…
daniel309 bd67797
Shorten comments to match codebase style
daniel309 194671e
Merge branch 'master' into feature/temperature-correction
daniel309 841cd7f
Add safety bounds to temperature correction factor
daniel309 027c7fd
Merge branch 'feature/temperature-correction' of https://github.com/d…
daniel309 9bc25d1
Merge branch 'master' into feature/temperature-correction
daniel309 5416b94
Merge branch 'master' into feature/temperature-correction
daniel309 d90f825
Merge branch 'master' into feature/temperature-correction
daniel309 8a0ef6f
Merge branch 'master' into feature/temperature-correction
daniel309 a466035
Merge branch 'master' into feature/temperature-correction
daniel309 7fc4cec
Merge branch 'master' into feature/temperature-correction
daniel309 823e05d
Merge branch 'master' into feature/temperature-correction
daniel309 717e40b
Merge branch 'master' into feature/temperature-correction
daniel309 2cd27e3
Merge branch 'master' into feature/temperature-correction
daniel309 51ea81d
Merge branch 'master' into feature/temperature-correction
daniel309 fac693d
Merge branch 'master' into feature/temperature-correction
daniel309 3373291
Merge branch 'master' into feature/temperature-correction
daniel309 142d8b1
Merge master into feature/temperature-correction
daniel309 18a8414
fix: resolve duplicate features key in luxtronik template
daniel309 6ed26b6
merge upstream/master, adapt to entity-based metrics, improve error m…
daniel309 00ee4fa
Merge branch 'master' into feature/temperature-correction
daniel309 eac0554
fix loadpoint energy tracking: use AddEnergy instead of manual calcul…
daniel309 56106d3
Merge branch 'master' into feature/temperature-correction
daniel309 4c6a36a
Merge branch 'master' into feature/temperature-correction
daniel309 22d2d5f
fix: skip temp correction log when load is 0
daniel309 b2c68c8
Merge branch 'feature/temperature-correction' of https://github.com/d…
daniel309 85da0d5
Merge branch 'master' into feature/temperature-correction
daniel309 1e43c89
Merge branch 'master' into feature/temperature-correction
daniel309 30bbead
refine temp correction debug logging
daniel309 a645f38
Merge branch 'feature/temperature-correction' of https://github.com/d…
daniel309 3d92c9f
Merge branch 'master' into feature/temperature-correction
daniel309 67d8626
merge upstream/master
daniel309 2d9da3c
Merge branch 'feature/temperature-correction' of https://github.com/d…
daniel309 bf69bd1
Merge branch 'master' into feature/temperature-correction
daniel309 6fa1b5a
fix error handling for metrics.ErrIncomplete
daniel309 761fbc0
Merge branch 'master' into feature/temperature-correction
daniel309 b764419
Merge branch 'master' into feature/temperature-correction
daniel309 23e0aa2
Merge branch 'master' into feature/temperature-correction
daniel309 31c9a54
Merge branch 'master' into feature/temperature-correction
daniel309 d0e0e80
fix formatting
daniel309 dac3e8b
Merge remote-tracking branch 'upstream/master' into feature/temperatu…
daniel309 192e22f
Merge upstream/master: resolve conflicts, simplify heating energy tra…
daniel309 19b0fb1
Merge branch 'master' into feature/temperature-correction
daniel309 23d9675
Merge branch 'master' into feature/temperature-correction
daniel309 c190abd
Merge branch 'master' into feature/temperature-correction
daniel309 a81c013
Merge branch 'master' into feature/temperature-correction
daniel309 fb8ed10
Merge branch 'master' into feature/temperature-correction
daniel309 d0881fa
Merge branch 'master' into feature/temperature-correction
daniel309 4573f71
Merge branch 'master' into feature/temperature-correction
daniel309 80fc47e
Merge branch 'master' into feature/temperature-correction
daniel309 8bc72ec
Merge branch 'master' into feature/temperature-correction
daniel309 3c78534
skip temp correction when forecast near room temp
daniel309 922d73e
Merge branch 'master' into feature/temperature-correction
daniel309 8bb7fc7
Merge branch 'master' into feature/temperature-correction
daniel309 e40a64d
Merge master
daniel309 5c6d961
Core: rename temperature forecast feature
daniel309 b9f73ef
Merge master
daniel309 b972f8b
Fix feature enum text parsing
daniel309 bc1a710
Fmt feature enum
daniel309 237576a
Merge branch 'master' into feature/temperature-correction
daniel309 893781b
Merge branch 'master' into feature/temperature-correction
daniel309 22be5ac
Merge remote-tracking branch 'origin/master' into feature/temperature…
daniel309 0d7223a
Merge upstream/master into feature/temperature-correction
daniel309 e5a9a58
Merge branch 'master' into feature/temperature-correction
daniel309 28bf49b
Merge remote-tracking branch 'upstream/master' into feature/temperatu…
daniel309 b7ca036
Merge branch 'feature/temperature-correction' of https://github.com/d…
daniel309 1ca6c09
merge upstream/master
daniel309 a0f8f4b
revert loadpoint.go comment to upstream
daniel309 16abb22
remove redundant loadpoint energy tracking from site.go
daniel309 3698f95
fix redundant nil checks and shadowed lp variable
daniel309 2d7edef
refactor: replace ScaleLoadByTemperatureForecast with DemandProfileWe…
daniel309 56ad6fa
Merge branch 'master' into feature/temperature-correction
daniel309 689fc94
reduce base load history window from 30 to 7 days
daniel309 f5782c0
revert: restore 30-day base load history window
daniel309 bdf69a1
merge upstream/master
daniel309 c443bf8
Merge remote-tracking branch 'upstream/master' into feature/temperatu…
daniel309 74ec58f
add warmwaterswitch.tpl; enforce mutual exclusion of demand profiles
daniel309 3fc8000
rename DemandProfileTemperature to DemandProfileDailyTemperature
daniel309 736d2e8
rename DemandProfileWeekly to DemandProfileSameWeekday
daniel309 299d18f
DemandProfileSameWeekday: average over past 4 same-weekday occurrences
daniel309 b1c842e
homeProfile: use same-weekday avg for base load instead of 30-day all…
daniel309 cda9e20
extract load prediction logic into site_load_predictor.go
daniel309 570f945
openapi: add chargerFeatureDailyTemperature and chargerFeatureSameWee…
daniel309 7727ec1
fix gci formatting
daniel309 1a6d18c
openapi: generate chargerFeatureDailyTemperature and chargerFeatureSa…
daniel309 e5b48a2
openapi: update mcp/openapi.json with new charger features
daniel309 bac2104
openapi: fix charger feature key names to match Go enum strings
daniel309 767a637
fix enumer header to match go:generate directive
daniel309 a056e19
Merge branch 'master' into feature/temperature-correction
daniel309 99b4463
Simplify home load profile and weekday energy query
andig 5874492
Fix weekday energy profile never matching any row
andig 0a90e81
Make weekday profile filter type-safe
andig 420f2fe
Move heating demand profile to loadpoint
andig 9a7a611
Stop heating demand above threshold, simplify profile tiling
andig b7e47b2
Move demandProfile to loadpoint_load_predictor.go
andig e9bf4d4
Remove unused warmwaterswitch template include
andig 7e7b051
Add heating demand after measured blend, exclude heaters from unmodel…
andig 85ca398
Simplify
andig 819e63e
Merge branch 'master' into feature/temperature-correction
daniel309 b4fb1b3
Simplify
andig 139f391
Merge branch 'master' into feature/temperature-correction
daniel309 68992dc
Tariff (Energy-Charts): cache forecast requests for 1h (#32800)
github-actions[bot] 7b6b8da
Deye: simplify curtailment scaling (#32798)
andig 3569ffc
Sonnenbatterie: cache repeated http status requests (#32797)
github-actions[bot] c4d2d14
Atmoce: remove battery curtailment (#32803)
github-actions[bot] 3e9239e
chore: add api.CurrentLimiter (#32804)
andig 6316948
Voltie: add the firmware 352 capabilities (#32783)
voltie-eu c597263
MCP: expose state, sessions and experimental endpoints (#32806)
andig 446195e
Config UI: mobile optimized section navigation (#32810)
naltatis 96cc567
UI: fix auto power unit for negative values (#32813)
naltatis 9b31cf4
Fronius Gen24: add PV curtailment support (#32823)
tilalx a63ddac
ioBroker: update installation and auth details (#32817)
kscholty 63a850b
Goodwe: add curtailment (BC) (#32795)
github-actions[bot] 9ab5146
SunEnergyXT: add SunEnergyXT 500 template (#30852)
ThorbenCarl 1264475
Battery Boost: allow scaling to 3p while active (#32776)
mfuchs1984 d7b2258
UI: fix sessions table covering heading in app (#32830)
naltatis 03ebcff
Optimizer UI: migrate charts to echarts, remove chart.js (#32837)
naltatis df7bb70
Config UI: prevent accidental modal close with unsaved changes (#32826)
naltatis 4c5f33a
PV: reserve only min power for higher-priority loadpoints starting up…
andig 8833cf5
Alpitronic: update handling for power absorption and fix status logic…
premultiply 7f50952
EEBus: fix stated limit duration expiring at half its length (#32856)
andig 425c581
Optimizer: consider planner precondition (late charging) (#32872)
andig 3811447
Kia/Hyundai EU: add OneApp/CCI login to fix new-login WAF block (#32868)
TMA84 4b219b6
SunEnergyXT 500: fix battery control (#32866)
epplea e815894
chore: publish the homebrew package as a cask (#32874)
andig e24d1b1
chore: fix release notes changelog template (#32877)
andig 3606078
chore: make the restored docker cache mounts writable (#32882)
andig 78645c6
chore: build the release and nightly images on depot (#32883)
andig 2e63480
GoodWe: list ESA series under hybrid template (#32884)
andig 08ef55c
Modbus templates: share block reads (#32887)
andig ce7eac0
Optimizer: respect session energy limit when vehicle soc is unknown (…
andig 97783e8
Add CHINT ECH10K-TH-EU inverter (#32858)
Wolle141 e2c59cf
Optimizer chart: day boundaries with weekday at 00:00 (#32894)
andig e82e744
Add Solplanet hybrid inverter (Modbus TCP) (#32888)
andig c698074
Site: feed the optimizer a trailing percentile solar scale (#32849)
iseeberg79 0fc384d
Loadpoint: fix config error for disabled loadpoints (#32880)
github-actions[bot] ab74ddb
Optimizer: extend horizon to 48h plus end of day (#32893)
andig 3cfb7cd
fix: address review comments and merge upstream/master
daniel309 f279e8d
Merge upstream/master - resolve conflicts
daniel309 e9807d2
Update api/feature.go
daniel309 d06ceeb
EnergyProfileWeekday: fix 4x7 day window, remove from param
daniel309 7700045
rename DemandProfile to PredictorProfile
daniel309 c0fe4fc
warmwaterswitch.tpl: always-DHW devices use predictorprofileweekday
daniel309 954ca5f
fix gci formatting
daniel309 5a357c3
EnergyProfileWeekday: use now.BeginningOfDay for DST correctness
daniel309 4ae52b4
heatpumpswitch: always predictorprofiletemperature - combined heatpum…
daniel309 8e874e4
Merge remote-tracking branch 'upstream/master' into feature/temperatu…
daniel309 6eaba77
move warmwaterswitch.tpl to charger includes dir (upstream #32871)
daniel309 fa42758
Merge branch 'master' into feature/temperature-correction
daniel309 a97ef2b
rename PredictorProfileWeekday to PredictorProfileSameWeekday
daniel309 71d22b7
fix gci alignment for PredictorProfileSameWeekday
daniel309 152db5f
Merge branch 'master' into feature/temperature-correction
daniel309 b64c434
Merge branch 'master' into feature/temperature-correction
daniel309 53493f4
homeProfile: prefer same-weekday profile, fall back to all-days avg
daniel309 47832d7
Merge branch 'master' into feature/temperature-correction
daniel309 6d932b4
homeProfile: log weekday profile path and fallback reason
daniel309 1e41dd6
rename feature flags: PredictorProfile* -> Demand*
daniel309 c7a1843
Merge branch 'master' into feature/temperature-correction
daniel309 ee7d8b3
rename feature flags in mcp openapi.json
daniel309 8e9e998
rename feature flags in device templates
daniel309 206f07c
Merge branch 'master' into feature/temperature-correction
daniel309 add6ede
Merge branch 'master' into feature/temperature-correction
daniel309 c8db2ea
demand forecast: use 7-day window for demandtemperature profile
daniel309 c783add
Merge branch 'master' into feature/temperature-correction
daniel309 b8339e1
Askoheat: add warmwaterswitch tpl as demandWeekday example
daniel309 1d20681
chore: revert warmwaterswitch to heatpumpswitch in emsesp, lg-therma,…
daniel309 dcea485
Demand forecast: set demandtemperature/demandweekday directly in temp…
daniel309 925ebb0
Demand forecast: set demandtemperature/demandweekday directly in temp…
daniel309 89f182e
Merge remote-tracking branch 'upstream/master' into feature/temperatu…
daniel309 3d4edba
Demand forecast: remove template tags, add DemandDaily feature, clean…
daniel309 7110617
Optimizer: restore now.With(horizon).EndOfDay() from master
daniel309 37403de
openapi: regenerate mcp/openapi.json for DemandDaily
daniel309 89f7d8d
Charger: add predictor config key for demand forecast features
daniel309 06b4e57
Demand forecast: fix temperature correction and weekday profile tiling
daniel309 426704b
Demand forecast: fix temperature correction and weekday profile tiling
daniel309 82aa3f7
Merge branch 'master' into feature/temperature-correction
daniel309 8428799
Merge branch 'feature/temperature-correction' of https://github.com/d…
daniel309 fae766b
Demand forecast: fix TestApplyTemperatureCorrection after heating thr…
daniel309 e83027a
Update core/site_load_predictor.go
daniel309 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package core | ||
|
|
||
| import ( | ||
| "time" | ||
|
|
||
| "github.com/evcc-io/evcc/api" | ||
| ) | ||
|
|
||
| // demandProfile returns the heating demand profile of a heating loadpoint and whether | ||
| // it needs to be scaled by the outdoor temperature forecast. Returns nil when unavailable. | ||
| func (lp *Loadpoint) demandProfile(from time.Time) (*[96]float64, bool) { | ||
| if lp.chargeEnergy == nil || !lp.chargerHasFeature(api.Heating) { | ||
| return nil, false | ||
| } | ||
|
|
||
| var profile *[96]float64 | ||
| var err error | ||
|
|
||
| // daily avg scaled by outdoor temp | ||
| temp := lp.chargerHasFeature(api.PredictorProfileTemperature) | ||
|
|
||
| switch { | ||
| case temp: | ||
| profile, err = lp.chargeEnergy.EnergyProfile(from) | ||
|
|
||
| case lp.chargerHasFeature(api.PredictorProfileSameWeekday): | ||
| profile, err = lp.chargeEnergy.EnergyProfileWeekday(time.Now().Weekday()) | ||
|
andig marked this conversation as resolved.
Outdated
|
||
|
|
||
| default: | ||
| return nil, false | ||
| } | ||
|
|
||
| if err != nil { | ||
| lp.log.DEBUG.Printf("demand profile: %v", err) | ||
| return nil, false | ||
| } | ||
|
|
||
| return profile, temp | ||
| } | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| package metrics | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/evcc-io/evcc/server/db" | ||
| "github.com/evcc-io/evcc/tariff" | ||
| "github.com/jinzhu/now" | ||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestEnergyProfileWeekday(t *testing.T) { | ||
|
daniel309 marked this conversation as resolved.
|
||
| require.NoError(t, db.NewInstance("sqlite", ":memory:")) | ||
| require.NoError(t, SetupSchema()) | ||
|
|
||
| e := entity{Id: 2, Name: "pv1", Group: PV} | ||
| require.NoError(t, db.Instance.Create(&e).Error) | ||
|
|
||
| // 4 weeks of full days, today's weekday carries a distinct energy value | ||
| today := time.Now().Weekday() | ||
| for day := -28; day < 0; day++ { | ||
| base := now.BeginningOfDay().AddDate(0, 0, day) | ||
|
|
||
| energy := 1.0 | ||
| if base.Weekday() == today { | ||
| energy = 2.0 | ||
| } | ||
|
|
||
| for slot := range 96 { | ||
| ts := base.Add(time.Duration(slot) * tariff.SlotDuration) | ||
| require.NoError(t, persist(e, ts, energy, 0, nil, false)) | ||
| } | ||
| } | ||
|
|
||
| weekday := int(today) | ||
| res, err := energyProfileFiltered(e, now.BeginningOfDay().AddDate(0, 0, -28), &weekday) | ||
| require.NoError(t, err) | ||
|
|
||
| // only same-weekday slots must be averaged | ||
| for i, v := range res { | ||
| require.Equal(t, 2.0, v, "slot %d", i) | ||
| } | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.