Repository navigation
v0.5.0: peak and off-peak prices, payback date - #7
Merged
Merged
Conversation
The price sensor stays the primary source. Without one, or while it is unavailable, a fixed all-in price (with an optional night price and hours) is used. The payback sensor gets a paid_back_on date, shown on the card.
Single-rate users are told to add a feed-in price and grid power, since without them only charging losses show. README gets a table of what each contract type usually earns, and the card screenshots show the payback date.
Owner
Author
|
The new |
PeterSlijkhuis
marked this pull request as ready for review
September 26, 2026 22:23
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.
Before: Battery ROI required a dynamic price sensor, so people on a fixed or peak/off-peak contract couldn't use it. When the price sensor was unavailable, no profit was booked. Payback was shown only as a number of years.
After:
paid_back_onattribute (the expected date). The card shows "Paid back by Mar 2031 (4.5 y)".How:
_buildfalls back to_fixed_price(local time)when the sensor gives no value. Surcharge and VAT still apply only to the sensor price, because typed-in prices are all-in. The same path is used when replaying history. Version 0.5.0.Tests: 26 pass, including peak/off-peak and weekend switching, the no-price error, the sensor-unavailable fallback and the payback date.