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

Feature request? Generic input of dynamic pricing #38

Closed mysciencefriend closed 1 year ago

mysciencefriend commented 1 year ago

Hi there,

This is probably a long shot, but is there a way to use this tool to input a tariff dynamically just using like an http endpoint or MQTT or something like that? My utility company (not one of the officially supported ones) uses 'staged' tariffs... Stage 1 is a fixed price for the first 1300 kWh used in a 60 day period, but then it goes up to a different tariff after that, and then it resets after day 60. I am able to get the tariff myself based on my energy usage, and I can publish it through home assistant in a number of different ways, but I'm struggling to find a way to get it into teslamate.

Is there any chance this tool has the ability to do that? If not, is that a feature might consider adding at some point in the future?

Thanks so much!

MattJeanes commented 1 year ago

Hey there, unfortunately it doesn't currently support this and due to the historic nature of the calculations I'm not sure how well a live MQTT / API call feed in would work. The code basically needs to be able to reach out to somewhere and ask "between these two time frames, what were the energy prices".

Currently we have dedicated integrations for a few energy companies that have APIs. You could create an API that TeslaMateAgile can call that essentially pretends to be one of the other energy companies e.g. Octopus and override the base url configuration e.g. Octopus__BaseUrl in the environment variables and returns the data you need, but it is a bit hacky.

mysciencefriend commented 1 year ago

Ahh gotcha, that makes sense. Thanks for the quick reply!