Git Product home page Git Product logo

Comments (10)

MattJeanes avatar MattJeanes commented on June 19, 2024

Hi @nottheedge, it looks to be a fairly simple API to use and implement, I've added in the API quickly and published a pre-release version for your testing to see if it's working as you expect.

I anticipate there will be a problem with VAT as the API does not include prices with VAT. Is this something that you would require?

If so, what is the VAT calculation for electricity in the region this energy provider operates in, presumably Germany only?

You can access the pre-release version with docker tag v1.7.0-rc.2

(edit: just updated to rc.2 to fix a bug around not getting all the required price data)

Refer to the guide in the README on how to force TeslaMateAgile to recalculate charges for testing.

Let me know if you run into any troubles. This looks to hopefully be a quick win 😄

from teslamateagile.

MattJeanes avatar MattJeanes commented on June 19, 2024

Hey @nottheedge - just checking in, did you manage to try this out? I am waiting on your feedback before releasing this properly to make sure it's all good 😄

from teslamateagile.

nottheedge avatar nottheedge commented on June 19, 2024

My apologies I didn’t recognise that you send me a message 6 days ago. Will have a look next days.

from teslamateagile.

MattJeanes avatar MattJeanes commented on June 19, 2024

No worries, cheers!

from teslamateagile.

nottheedge avatar nottheedge commented on June 19, 2024

I got it installed but I assume I can't recalculate charges at my home as the prices per hour are only valid for next 24h. A backward calculation is impossible. My car is plugged in and it will charge tomorrow 2-4am for (7,5ct at 2am, 7,35ct at 3am and 7,45ct at 4am). Let see what's gonna happen.

Related to your question about VAT calculation you only need to multiply with 1,19 as we have 19% per kWh. Probably you could set it as parameter inside docker-compose to be flexible?

Regards,
Joerg

from teslamateagile.

MattJeanes avatar MattJeanes commented on June 19, 2024

Hey @nottheedge, just checking in again to see if you managed to give it a go?

Thanks for the info about VAT, I'll add an option specifically for this provider which has a default VAT rate of 19% if not set but you will be able to override it. This is because the other providers automatically include VAT in their prices so it is not something we need to worry about and it may confuse users if we add an option to add VAT to Octopus Agile prices when they are already included for example.

Hopefully everything (other than the lack of VAT) is working correctly for you?

from teslamateagile.

MattJeanes avatar MattJeanes commented on June 19, 2024

I have now pushed a new release candidate v1.7.0-rc.4 with the the VAT multiplier option added, it is Awattar__VATMultiplier and it is set by default to 1.19 so you shouldn't generally need to set it at all unless you claim the VAT back or something but it's there just in case.

Could you please try out this new version and make sure everything is nice and happy and then we can properly release v1.7.0 😄

from teslamateagile.

nottheedge avatar nottheedge commented on June 19, 2024

So far it looks good. As I charge the car over several hours there are different prices each hour. How do you cumulate it? Is there kind of database which stores the prices if charging is in progress? It's just to check if it cumulates correctly.

from teslamateagile.

MattJeanes avatar MattJeanes commented on June 19, 2024

Yeah so it's actually pretty complicated but essentially TeslaMate samples the current charging state during a charge every 5 seconds or so so we know at any particular point how much power was being drawn and can calculate it over a particular datetime range, which TeslaMateAgile uses to calculate for each price from the aWATTar API relevant to your charging session.

You can calculate it roughly by knowing your normal charge rate (e.g. 7.2kW) and multiplying it by the current cost per hour divided by how much of that hour it was charging

So for example if your charge was from 00:30 to 02:00 and it was 5p/kWh for 00:00-01:00 and 10p/kWh for 01:00-02:00 and you were charging at 7kW: For the first hour you'd basically go 7/60*30=3.5kWh then 5p*3.5kWh=17.5p for the first hour, then for the second hour that would be 7/60*60=7kWh as its a full hour and then 10p*7kWh=70p and then just add them together to get a rough charge cost of 87.5p

This is essentially how TeslaMateAgile calculates it but on a much smaller timestep for more accuracy so if you compare the two outputs it should be within a few pennies (or cent or whatever)

Hope that makes sense!

from teslamateagile.

MattJeanes avatar MattJeanes commented on June 19, 2024

v1.7.0 has now been released with aWATTar support, so I will close this. If there are any issues with the implementation please raise a new issue! Cheers

from teslamateagile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.