MattJeanes / TeslaMateAgile

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

Costs not calculated after upgrade to 1.8.0 #23

Closed aboudou closed 2 years ago

aboudou commented 2 years ago

Hello,

The charging costs are not calculated anymore since I've upgraded to 1.8.0. No changes in conf, and no TeslaMateAgile info in logs

Capture d’écran 2021-11-09 à 08 14 36

2021-11-07 : TeslaMateAgile 1.7.0 2021-11-08 : TeslaMateAgile 1.8.0

Conf :

  teslamateagile:
    image: mattjeanes/teslamateagile:latest
    restart: always
    environment:
      - DATABASE_USER=${TM_DB_USER}
      - DATABASE_PASS=${TM_DB_PASS}
      - DATABASE_NAME=${TM_DB_NAME}
      - DATABASE_HOST=database
      - TeslaMate__UpdateIntervalSeconds=300
      - TeslaMate__GeofenceId=1
      - TeslaMate__EnergyProvider=FixedPrice
      - FixedPrice__TimeZone=Europe/Paris
      - FixedPrice__Prices__0=06:30-22:30=0.1853
      - FixedPrice__Prices__1=22:30-06:30=0.1353
      - Logging__LogLevel__Default=Debug

Startup logs

teslamate_1       | 2021-11-09 07:47:01.988 [info] Migrations already up
teslamate_1       | 2021-11-09 07:47:07.647 [info] System Info: Erlang/OTP 24 (jit)
teslamate_1       | 2021-11-09 07:47:07.647 [info] Version: 1.24.2
teslamate_1       | 2021-11-09 07:47:07.980 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (293.420 ms)
teslamate_1       | 2021-11-09 07:47:09.728 [info] POST https://owner-api.teslamotors.com/oauth/token -> 200 (1746.672 ms)
teslamate_1       | 2021-11-09 07:47:09.728 [info] Refreshed api tokens
teslamate_1       | 2021-11-09 07:47:09.734 [info] Scheduling token refresh in 5 wk 5 d
teslamate_1       | 2021-11-09 07:47:09.737 [info] Running TeslaMateWeb.Endpoint with cowboy 2.9.0 at :::4000 (http)
teslamate_1       | 2021-11-09 07:47:09.739 [info] Access TeslaMateWeb.Endpoint at http://xxxxx.com
teslamate_1       | 2021-11-09 07:47:10.589 [info] Starting logger for 'Tut Tut Bolide'
teslamate_1       | 2021-11-09 07:47:10.603 [info] MQTT connection has been established
teslamate_1       | 2021-11-09 07:47:11.201 [info] tzdata release in place is from a file last modified Tue, 22 Dec 2020 23:35:21 GMT. Release file on server was last modified Fri, 22 Oct 2021 02:20:47 GMT.
teslamate_1       | 2021-11-09 07:47:11.422 car_id=1 [info] Start / :asleep
teslamate_1       | 2021-11-09 07:47:12.901 [info] Tzdata has updated the release from 2020e to 2021e
teslamate_1       | 2021-11-09 07:55:36.595 [info] GET /
teslamate_1       | 2021-11-09 07:55:36.610 [info] Sent 200 in 14ms
IMgoRt commented 2 years ago

Are you sure there are entries in teslamate for agile - the logs are in the agile container for me (on 1.7.0? Your endpoint is in your logs (although password-protected access)

aboudou commented 2 years ago

Hello

Good point(s) for the endpoint and the correct container.

.NET 6.0 was not found :/ I'll fix it and close the issue if it's OK.

aboudou commented 2 years ago

.NET 6.0 installed, but still not working.

logs :

teslamateagile_1  | It was not possible to find any compatible framework version
teslamateagile_1  | The framework 'Microsoft.NETCore.App', version '6.0.0' was not found.
teslamateagile_1  |   - The following frameworks were found:
teslamateagile_1  |       5.0.12 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]
teslamateagile_1  | 
teslamateagile_1  | You can resolve the problem by installing the specified framework and/or SDK.
teslamateagile_1  | 
teslamateagile_1  | The specified framework can be found at:
teslamateagile_1  |   - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=debian.11-x64

content of /usr/share/dotnet/shared/Microsoft.NETCore.App

drwxr-xr-x 2 root root 16384 Nov 9 09:42 6.0.0

dotnet --info

.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     debian
 OS Version:  11
 OS Platform: Linux
 RID:         debian.11-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.100/

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  6.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
MattJeanes commented 2 years ago

Thanks for reporting, sorry I should have done more testing for this framework upgrade, I was rushing around last night upgrading all my projects to .NET 6 and did not run any tests other than the automated ones! I will do more testing in future as clearly they are not enough.

Looks like I upgraded all the build processes to .NET 6 so the build and tests passed but missed the actual runtime version the container uses so it fails to start-up. It also seems that the PostgreSQL package needed upgrading too to work with EF Core 6.

I've now pushed v1.8.1 - can you see if this is working for you? It is running up for me now on my server and calculating costs. Sorry again.

aboudou commented 2 years ago

@MattJeanes It's OK now, thanks for your help :)

MattJeanes commented 2 years ago

Thank you for your quick feedback! Glad it's all working now 😄