You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(teslemetry): correct _tesla_dow - Tesla's day-of-week is Monday=0, not Sunday=0
_tesla_dow() mapped Python's weekday() (Monday=0) to a wrongly-assumed Tesla
convention of Sunday=0, via (python_weekday + 1) % 7. Tesla's tariff_content_v2
fromDayOfWeek/toDayOfWeek actually use the same Monday=0 convention as
datetime.weekday(), so every ON_PEAK boost band (and the day's real-tier
layout) landed one day late. During the actual export window the Powerwall
saw only the ordinary off-peak tariff, so it never had a price reason to
export - it just covered house load, which is why every prior symptom
(load-following with grid=0 during "Exporting", raising the boost price
changing nothing) looked like something else. optimization_strategy (#4600)
was a red herring; this is the actual cause.
Fixed by making _tesla_dow the identity function. Test changes pin absolute
expected day indices instead of deriving them from _tesla_dow itself (the
previous self-referential pattern passed under any mapping), plus a new
resolver-style test that independently resolves the built tariff's price at
a moment inside the boost window using Tesla's real day convention.
Confirmed live: correcting only the day index took a Powerwall from grid=0
to grid=-5156 (full 5kW export) within 50 seconds, no other change.
Fixes#4610
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments