-
Notifications
You must be signed in to change notification settings - Fork 11
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
Failed to calculate charging cost / energy for charging process #44
Comments
Hey, first of all many thanks for the detailed report - super appreciated! Can I ask you to please run this call against the Home Assistant API and tell me the results?
Ensure you set the header What appears to be happening is when querying HA, the dates of the returned data don't line up with the charges in the CSV you sent me for some reason, as there is a matching step to designate all charges to a relevant price from the returned data. I suspect it may be a timezone related issue or perhaps something off by a second or minute etc. For your bonus question, you can run it as infrequently as you like, but make sure your lookback days and HA history will work with what you set. In your particular scenario this would be fine because HA history would still be available which is where it gets the price data from, it doesn't really matter when it runs as long as the charge is within the lookback days and HA history is available for the date/time range 🙂 |
Sorry for the late reply, has been a busy few days and glad you liked the detail. I suffer from a lack of detail in reported problems at work every day so I know the struggle :) Sure thing, here is the output of that get request
I suspected it may be time based thing, I do have my HA set to UTC+10 but I dont think I configured TMA to any timezone (not sure if its possible) Thanks for the info on the bonus question, i'll back this off to run once a day then as I am only charging every other day. At first read of the doco it appeared that you may need to run this constantly to keep a running tally so I tried to space it out to the average of my charge sessions |
Thank you! It looks like there was just one price of 0.2748 AUD/kWh for the duration of that charge, does that sound correct? I'll run it through the debugger when I'm back home next week, I'm on holiday at the moment 🙂 If there's a particular section of the docs which implies TeslaMateAgile needs to run often to track charging within a charge session let me know and I'll try and reword it to be be clearer (or you could submit a PR of course!) |
Hey @ObJuanK, I have now fixed this in If you're interested, it was caused by the final price having the exact same time as the final charge entry, down to the millisecond. This combined with my usage of That charge you supplied worked out as Also I hope you don't mind, I have added your data to some unit tests to help prevent this issue re-occurring in future, but please let me know if this is an issue and you want me to remove it. |
Hey Matt, Thanks for looking into it and taking the time to reply on holidays. I came home to find a myriad of failed calculations after my initial report, I have those logs if you are interested and can pull the data for those session if it helps you, just let me know. On the doco implying it needed to be run regularly: It was not anything specific and it could possibly be how I interpret things, but I inferred from context a little when reading the Required Environment Variables section.
What I think might help would be adding some subtext under Required Environment Variables with the explanation you provided me in your original reply. Thanks again and keep up the awesome work :) |
Thank you, glad to hear it's all working for you now, and thanks for letting me use your data in the tests. I've made a little commit here to change the wording and increase the example to an hour, hopefully this will make the purpose of it clearer: 1ebe629 🙂 |
Hello,
I have recently setup Teslamate Agile and am using Home Assistant to track import costs of provider.
My particular provider has a plan where my electricity price drops to $0 between the hours of 12pm and 2pm Saturday and Sunday.
There is no API integration with this provide, so I have Home assistant just running a number helper to automate the price change in import costs from the provider.
The helper triggers on schedule and changes the price of import costs, all other services in HA that depend on this cost appear to be representing their data correctly, so I assume I have set that up right.
I have seen this on a few charges and it has cleared itself automatically in the past, but this one is not clearing and has now been overtaken by a newer charge that was calculated.
Attached is the charge id in question
data-1693143085068.csv
This keeps repeating in the logs. Sadly I recreated the container without saving the old logs, but I am now up to charge process 66 and that one calculated fine.
While reading through closed issues, I saw that it was mentioned that the phase correction was not needed and to be removed, I have done that recently but has not fixes my issue. Here is my compose file
Bonus question: Since I only charge every other day, I don't need this process checking every 5 minutes if a charge has completed, so have increased the update interval a little to an arbitrary time (4 hours) so it would only run 6 times a day.
My price only changes for 2 hours in a day, most charging sessions last 4-5 hours and the free energy period will usually be in the middle of the 4-5 hour session. Would the calculations be able to account for that without checking for charge events every 5 minutes?
Thanks
The text was updated successfully, but these errors were encountered: