MattJeanes / TeslaMateAgile

Integration to automatically fill in prices for charge data captured by TeslaMate for smart energy providers
MIT License
76 stars 9 forks source link

Create REST endpoint to get price at specific datetime #42

Closed pkuehnel closed 12 months ago

pkuehnel commented 12 months ago

Would it be possible to create a REST endpoint to get the price per kWh at a specific time? I have a project that charges Teslas based on solar power. This currently works only in Germany as I hard-coded the German spot price as source. If I could use your project as source of the grid price this would help me a lot. Currently I have this issue in my project, which would be a huge hassle to implement, but with having your project as grid price source it would be pretty straight forward. Important would be that you do not update the charge prices as my software calculates a mixed prive based in grid and solar energy.

MattJeanes commented 12 months ago

Hey, your project is really interesting actually as since I built TeslaMateAgile I've also got solar and batteries now which kinda messes things up for the cost calculations so I might actually have to check out your project!

I think what you're suggesting sits outside the scope of this project and would be quite the hack, we don't even expose any kind of API at the moment it's all just a background service.

I can see your project is also C# so I am happy if you want to lift the relevant source code into your project from mine to help you get it working but I don't want to add an API to retrieve them just for this super specific use case.

pkuehnel commented 12 months ago

Ok, as I quickly stepped through your code, as I see it, I need to use IPriceDataService and all implementations of it. After that, it should work fine for me. Do I miss anything?

In which regions is your software working?

MattJeanes commented 12 months ago

Yeah pretty much! TeslaMateAgile technically will work in any region but the more advanced API based providers are all European based.

I'm gonna close this issue but please continue with any more questions you might have 🙂