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

No data available if multiple homes exist #53

Closed matze19999 closed 2 months ago

matze19999 commented 3 months ago

I've added another home last week because I will move in 2 months, but now no data is available anymore for the current home, because TeslaMateAgile always takes the first home which the API gives, but I need so select the second home now.

Is there a easy way to do that?

MattJeanes commented 3 months ago

Hi!

I believe the setting you're looking for is TeslaMate__GeofenceId, if you have set up another home or location there should be a new ID for that one. Check the readme for more info on how to find this number.

Hope that helps! πŸ™‚

MattJeanes commented 3 months ago

Also keep in mind TeslaMateAgile can only track one location at a time so you'll need to run multiple instances of it with different settings if you want to run it with multiple locations

matze19999 commented 3 months ago

No, I mean I have setup a new home in Tibber, not in TeslaMate. Have a look here:

image

I need the price data of the second one, because the first one is not active yet. But TeslaMateAgile always uses the data of the first home.

MattJeanes commented 3 months ago

Interesting! We don't appear to have support for that, but it should be easy to add.

I'm currently on holiday this week so I'll see if I can do that next week for you πŸ™‚

matze19999 commented 3 months ago

Thank you, this would be amazing!

Reach out to me if I can help you somehow😊

MattJeanes commented 3 months ago

Might need some help to test it so I certainly will!

MattJeanes commented 2 months ago

Hi again! This functionality is now available in the latest version v1.14.0 πŸ™‚

Check the readme for information about Tibber__HomeId and let me know how it goes!

matze19999 commented 2 months ago

It works great, thank you for this update! 😊

MattJeanes commented 2 months ago

Awesome! No problem πŸ™‚

matze19999 commented 2 months ago

I now get this error, but I don't know if it has something to do with the change? @MattJeanes


info: TeslaMateAgile.PriceHelper[0]
      Calculating cost for charges 04/11/2024 10:20:44 UTC - 04/11/2024 11:51:28 UTC
fail: TeslaMateAgile.PriceHelper[0]
      Failed to calculate charging cost / energy for charging process 811
      System.Exception: Mismatch of requested price info from Tibber API (expected: 3, actual: 2)
         at TeslaMateAgile.Services.TibberService.GetPriceData(DateTimeOffset from, DateTimeOffset to) in /src/TeslaMateAgile/Services/TibberService.cs:line 122
         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