Skip to content
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

Unable to calculate cost of some charges #68

Open
Chimpepe opened this issue Nov 7, 2024 · 6 comments
Open

Unable to calculate cost of some charges #68

Chimpepe opened this issue Nov 7, 2024 · 6 comments

Comments

@Chimpepe
Copy link

Chimpepe commented Nov 7, 2024

Hello Matt,
since the changeover to winter time, I have had the problem that the prices are no longer calculated.
I have seen that there have been problems in the past. [https://github.com//issues/41]

Do you have the chance to take a look at this?

Release v1.16.0

Thanks,
Dawid

teslamateagile-1  | 2024-11-07 21:48:03.189 dbug: TeslaMateAgile.PriceService[0]
teslamateagile-1  |       Updating prices
teslamateagile-1  | 2024-11-07 21:48:03.264 info: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Looking for finished charging processes with no cost set in the 'Home' geofence (id: 1)
teslamateagile-1  | 2024-11-07 21:48:03.345 info: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Calculating cost for charges 11/03/2024 10:04:56 UTC - 11/03/2024 13:00:16 UTC
teslamateagile-1  | 2024-11-07 21:48:03.501 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Retrieved 4 prices:
teslamateagile-1  | 2024-11-07 21:48:03.501 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       11/03/2024 09:00:00 UTC - 11/03/2024 10:00:00 UTC: 0.2679
teslamateagile-1  | 2024-11-07 21:48:03.501 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       11/03/2024 10:00:00 UTC - 11/03/2024 11:00:00 UTC: 0.2561
teslamateagile-1  | 2024-11-07 21:48:03.501 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       11/03/2024 11:00:00 UTC - 11/03/2024 12:00:00 UTC: 0.2464
teslamateagile-1  | 2024-11-07 21:48:03.501 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       11/03/2024 12:00:00 UTC - 11/03/2024 13:00:00 UTC: 0.2564
teslamateagile-1  | 2024-11-07 21:48:03.501 info: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Phase correction: 2 -> 3
teslamateagile-1  | 2024-11-07 21:48:03.513 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Calculated charge cost for 11/03/2024 10:00:00 UTC - 11/03/2024 11:00:00 UTC (unit cost: 0.2561, fee per kWh: 0): 2.530155393897083300453508 for 9.87956030416666653828 energy
teslamateagile-1  | 2024-11-07 21:48:03.525 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Calculated charge cost for 11/03/2024 11:00:00 UTC - 11/03/2024 12:00:00 UTC (unit cost: 0.2464, fee per kWh: 0): 2.691978432938666663210496 for 10.92523714666666665264 energy
teslamateagile-1  | 2024-11-07 21:48:03.537 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Calculated charge cost for 11/03/2024 12:00:00 UTC - 11/03/2024 13:00:00 UTC (unit cost: 0.2564, fee per kWh: 0): 2.786099471221333349428416 for 10.86622258666666672944 energy
teslamateagile-1  | 2024-11-07 21:48:03.537 fail: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Failed to calculate charging cost / energy for charging process 287
teslamateagile-1  |       System.Exception: Charge calculation failed, pricing calculated for 499 / 500, likely missing price data
teslamateagile-1  |          at TeslaMateAgile.PriceHelper.CalculateDynamicChargeCost(IEnumerable`1 charges, DateTimeOffset minDate, DateTimeOffset maxDate) in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 151
teslamateagile-1  |          at TeslaMateAgile.PriceHelper.CalculateChargeCost(IEnumerable`1 charges) in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 98
teslamateagile-1  |          at TeslaMateAgile.PriceHelper.Update() in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 75
teslamateagile-1  | 2024-11-07 21:48:03.538 info: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Calculating cost for charges 11/07/2024 10:35:28 UTC - 11/07/2024 12:00:05 UTC
teslamateagile-1  | 2024-11-07 21:48:03.606 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Retrieved 3 prices:
teslamateagile-1  | 2024-11-07 21:48:03.606 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       11/07/2024 09:00:00 UTC - 11/07/2024 10:00:00 UTC: 0.3609
teslamateagile-1  | 2024-11-07 21:48:03.606 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       11/07/2024 10:00:00 UTC - 11/07/2024 11:00:00 UTC: 0.3442
teslamateagile-1  | 2024-11-07 21:48:03.606 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       11/07/2024 11:00:00 UTC - 11/07/2024 12:00:00 UTC: 0.3445
teslamateagile-1  | 2024-11-07 21:48:03.606 info: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Phase correction: 2 -> 3
teslamateagile-1  | 2024-11-07 21:48:03.608 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Calculated charge cost for 11/07/2024 10:00:00 UTC - 11/07/2024 11:00:00 UTC (unit cost: 0.3442, fee per kWh: 0): 1.535331128878666432185006 for 4.46057852666666598543 energy
teslamateagile-1  | 2024-11-07 21:48:03.621 dbug: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Calculated charge cost for 11/07/2024 11:00:00 UTC - 11/07/2024 12:00:00 UTC (unit cost: 0.3445, fee per kWh: 0): 3.790141417660000047237840 for 11.00186188000000013712 energy
teslamateagile-1  | 2024-11-07 21:48:03.622 fail: TeslaMateAgile.PriceHelper[0]
teslamateagile-1  |       Failed to calculate charging cost / energy for charging process 288
teslamateagile-1  |       System.Exception: Charge calculation failed, pricing calculated for 247 / 248, likely missing price data
teslamateagile-1  |          at TeslaMateAgile.PriceHelper.CalculateDynamicChargeCost(IEnumerable`1 charges, DateTimeOffset minDate, DateTimeOffset maxDate) in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 151
teslamateagile-1  |          at TeslaMateAgile.PriceHelper.CalculateChargeCost(IEnumerable`1 charges) in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 98
teslamateagile-1  |          at TeslaMateAgile.PriceHelper.Update() in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 75
teslamateagile-1  | 2024-11-07 21:48:03.636 dbug: TeslaMateAgile.PriceService[0]
teslamateagile-1  |       Price update complete
teslamateagile-1  | 2024-11-07 21:48:03.636 info: TeslaMateAgile.PriceService[0]
teslamateagile-1  |       Waiting 300 seconds until next update

data-1731017330646.csv
data-1731017347818.csv

@MattJeanes
Copy link
Owner

Hey, thank you for the detailed debug logs and CSVs - very useful! I'll also need your TeslaMateAgile configuration too if that's cool e.g. which provider you are using and the configuration for it (excluding any sensitive info of course!)

@Chimpepe
Copy link
Author

Chimpepe commented Nov 8, 2024

no Problem! Let me know if you need anything else.

teslamateagile:
    image: mattjeanes/teslamateagile:latest
    restart: always
    environment:
      - DATABASE_USER=teslamate
      - DATABASE_PASS=1234567890
      - DATABASE_NAME=teslamate
      - DATABASE_HOST=database
      - TeslaMate__UpdateIntervalSeconds=300
      - TeslaMate__GeofenceId=1
      - TeslaMate__EnergyProvider=Tibber
      - Tibber__AccessToken=1234567890

@MattJeanes
Copy link
Owner

Thank you! Looks like I wasn't correctly accounting for the end of the time window in certain edge cases in the Tibber provider, which hopefully the new preview version fixes.

Can you try out v1.17.0-rc.4 and let me know if that fixes it for you please?

teslamateagile:
    image: mattjeanes/teslamateagile:v1.17.0-rc.4

@MattJeanes
Copy link
Owner

Hey @Chimpepe - did you get a chance to try out the new version? How's it going for you?

@Chimpepe
Copy link
Author

Chimpepe commented Nov 16, 2024

Hey Matt, unfortunately not yet, have not charged due to the current high prices 😓

Last charge on 08.11. 2am-3am without issues.

I thing I can test it soon, sorry!

@MattJeanes
Copy link
Owner

No worries - keep me posted! Just want to make sure it's all working okay before I release the update properly 😄

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

No branches or pull requests

2 participants