Git Product home page Git Product logo

Comments (8)

isondre avatar isondre commented on August 17, 2024 1

Okay, will give that a try. Seems weird though, since it had no problem collecting cost from 2021-2023 last night.

from teslamateagile.

isondre avatar isondre commented on August 17, 2024 1

Thanks for the help!

Found the culprit, it was user error. I forgot to update the API token in the compose file after making a new one in Tibber last night.. Everything is working fine now.

You at least helped me slow down the requests! 😄

from teslamateagile.

MattJeanes avatar MattJeanes commented on August 17, 2024

Hey, for this I would recommend temporarily setting the cost for to something other than null in the charging_processes table in the database directly for most of them, and nulling them out slowly over time to let TeslaMateAgile pick them up.

Maybe use some very weird or specific number so you don't confuse it with the real ones!

from teslamateagile.

isondre avatar isondre commented on August 17, 2024

Any tips to automate this? I don't really feel like sitting nulling out charges over the next few days.

from teslamateagile.

MattJeanes avatar MattJeanes commented on August 17, 2024

Yeah, you could use psql to run a query (psuedo-code) similar to:

UPDATE charging_processes SET cost=NULL WHERE id IN (SELECT id FROM charging_processes WHERE cost = 12345 limit 1)

And have that on some kind of scheduled task / cronjob, make sure to adjust cost / limit as necessary.

from teslamateagile.

isondre avatar isondre commented on August 17, 2024

Thank you. I have now changed all entries with NULL to another price that won't interfere with actual prices.

I now only have two entries with NULL and tried starting Agile again.

`info: TeslaMateAgile.PriceHelper[0]

  Calculating cost for charges 10/05/2023 17:15:24 UTC - 10/05/2023 17:18:53 UTC

fail: TeslaMateAgile.PriceHelper[0]

  Failed to calculate charging cost / energy for charging process 1170

  GraphQL.Client.Http.GraphQLHttpRequestException: The HTTP request failed with status code BadRequest

     at TeslaMateAgile.Services.TibberService.SendRequest(GraphQLHttpRequest request) in /src/TeslaMateAgile/Services/TibberService.cs:line 139

     at TeslaMateAgile.Services.TibberService.GetPriceData(DateTimeOffset from, DateTimeOffset to) in /src/TeslaMateAgile/Services/TibberService.cs:line 67

     at TeslaMateAgile.PriceHelper.CalculateChargeCost(IEnumerable`1 charges) in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 96

     at TeslaMateAgile.PriceHelper.Update() in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 74

info: TeslaMateAgile.PriceHelper[0]

  Calculating cost for charges 12/29/2023 08:08:10 UTC - 12/29/2023 08:08:37 UTC

fail: TeslaMateAgile.PriceHelper[0]

  Failed to calculate charging cost / energy for charging process 1226

  GraphQL.Client.Http.GraphQLHttpRequestException: The HTTP request failed with status code BadRequest

     at TeslaMateAgile.Services.TibberService.SendRequest(GraphQLHttpRequest request) in /src/TeslaMateAgile/Services/TibberService.cs:line 139

     at TeslaMateAgile.Services.TibberService.GetPriceData(DateTimeOffset from, DateTimeOffset to) in /src/TeslaMateAgile/Services/TibberService.cs:line 67

     at TeslaMateAgile.PriceHelper.CalculateChargeCost(IEnumerable`1 charges) in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 96

     at TeslaMateAgile.PriceHelper.Update() in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 74

info: TeslaMateAgile.PriceService[0]

  Waiting 300 seconds until next update`

I have tried accessing Tibber API with no issues, so it is not a soft ban like last night.

from teslamateagile.

MattJeanes avatar MattJeanes commented on August 17, 2024

Hmm... it's possible that you may be requesting a time too far in the past and the API doesn't like it, maybe try a more recent one or try those dates manually in the API and see what it does.

from teslamateagile.

MattJeanes avatar MattJeanes commented on August 17, 2024

Glad I could be of (some) assistance 🙂

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.