tobiasehlert/teslamateapi

charge_limit_soc is always showing 0

pkuehnel opened this issue · 8 comments

Today I noticed, that charge_limit_soc is always showing 0 on all my cars. This has been working until I think two days ago.

Next problem: plugged_in is always false

Interesting: I recreated all TeslaMate Docker Containers (docker-compose down + docker-compose up -d) and everything is fine again (Only restarting teslaMateAPI does not help). Could you please check if there are any issues if mosquito or teslamate is restarted? I do think so, because the issues came up when I updated my containers which resulted in restarting mosquito container. A few days ago I had the same issue but with the geofence property. Probably not everytime all properties are affected?

Database container restarting could also be the issue. Got an update of this one, too.

Hi @pkuehnel,

Interesting case 🤔
Well based on the integration from TeslaMateAPI side, we retrieve the latest possible value from the MQTT server. With that I mean, if the value was set like 5 hours ago, it's that last value that would be displayed.

If mosquitto is restarted/upgraded, that information might not be available. But that is in this case due to the mosquitto not storing that value on an upgrade and reading it back when it's online again. That is my only guess that could make that the status endpoint is not showing the correct value.

But in that case, the values should be populated from TeslaMate again when it's changed.. and then right away, the status endpoint should display the correct information.

Regarding database restart, the status page does not retrieve database content, so that should not be related.

Hmm, interesting. Today I could not reproduce this behaviour. As soon as I woke up the car the data was updated.

Today I have the same issue, TeslaMate is working and logging fine, but TeslaMateApi's values do not change. @tobiasehlert Are you interested in something like an Teamviewer session to observe this issue? If so, I could keep all containers running.
Edit: Sorry I could not wait with a restart: After the restart (no recreation) of the TeslaMateAPI all values where correct instantly.
Log of Mosquito:

1648735620: Socket error on client teslamateapi-arRz, disconnecting.,
1648735621: New connection from 192.168.64.3 on port 1883.,
1648735621: New client connected from 192.168.64.3 as teslamateapi-94Av (p2, c1, k2).

As the car charged at this point I found the timestamp of the issue:
Log Mosquito:

1648674339: Client teslamateapi-arRz has exceeded timeout, disconnecting.
1648674350: New connection from 192.168.64.3 on port 1883.
1648674351: New client connected from 192.168.64.3 as teslamateapi-arRz (p2, c1, k2).

So disconnect at: Wed Mar 30 2022 23:05:39 GMT+0200

Log TeslaMateApi:

{"log":"[GIN] 2022/03/30 - 23:05:14 | 200 |    1.414825ms |    192.168.64.5 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:14.729703687Z"}
{"log":"[GIN] 2022/03/30 - 23:05:14 | 200 |    1.003119ms |    192.168.64.5 | GET      \"/api/v1/cars/2/status\"\n","stream":"stdout","time":"2022-03-30T21:05:14.948900746Z"}
{"log":"[GIN] 2022/03/30 - 23:05:20 | 301 |      27.101µs |    192.168.64.1 | GET      \"/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:20.621986024Z"}
{"log":"2022/03/30 23:05:20.622995 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:20.623120244Z"}
{"log":"[GIN] 2022/03/30 - 23:05:20 | 200 |     903.416µs |    192.168.64.1 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:20.623173345Z"}
{"log":"[GIN] 2022/03/30 - 23:05:20 | 301 |        27.5µs |    192.168.64.1 | GET      \"/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:20.763704584Z"}
{"log":"2022/03/30 23:05:20.764664 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:20.764750803Z"}
{"log":"[GIN] 2022/03/30 - 23:05:20 | 200 |     704.113µs |    192.168.64.1 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:20.764882905Z"}
{"log":"[GIN] 2022/03/30 - 23:05:21 | 301 |      28.001µs |    192.168.64.1 | GET      \"/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:21.993439298Z"}
{"log":"[GIN] 2022/03/30 - 23:05:21 | 200 |     586.111µs |    192.168.64.1 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:26.011175073Z"}
{"log":"2022/03/30 23:05:21.994195 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:21.994240512Z"}
{"log":"2022/03/30 23:05:28.020985 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:28.021153481Z"}
{"log":"[GIN] 2022/03/30 - 23:05:28 | 200 |    1.140321ms |   192.168.1.204 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:28.021198282Z"}
{"log":"2022/03/30 23:05:44.728999 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:44.729095091Z"}
{"log":"[GIN] 2022/03/30 - 23:05:44 | 200 |    1.886034ms |    192.168.64.5 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:44.729135692Z"}
{"log":"2022/03/30 23:05:44.731290 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/2/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:44.731382932Z"}
{"log":"[GIN] 2022/03/30 - 23:05:44 | 200 |    1.150821ms |    192.168.64.5 | GET      \"/api/v1/cars/2/status\"\n","stream":"stdout","time":"2022-03-30T21:05:44.731426133Z"}
{"log":"[GIN] 2022/03/30 - 23:05:49 | 301 |        26.2µs |    192.168.64.1 | GET      \"/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:49.937672278Z"}
{"log":"[GIN] 2022/03/30 - 23:05:49 | 200 |     641.612µs |    192.168.64.1 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:49.938581995Z"}
{"log":"2022/03/30 23:05:49.938455 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:49.938588095Z"}
{"log":"[GIN] 2022/03/30 - 23:05:51 | 301 |          34µs |    192.168.64.1 | GET      \"/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:51.529150526Z"}
{"log":"[GIN] 2022/03/30 - 23:05:51 | 200 |     697.013µs |    192.168.64.1 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:51.530282647Z"}
{"log":"2022/03/30 23:05:51.530181 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:51.530316347Z"}
{"log":"[GIN] 2022/03/30 - 23:05:51 | 301 |        28.4µs |    192.168.64.1 | GET      \"/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:51.762045033Z"}
{"log":"[GIN] 2022/03/30 - 23:05:51 | 200 |     749.614µs |    192.168.64.1 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:51.763100652Z"}
{"log":"2022/03/30 23:05:51.762980 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:51.763122353Z"}
{"log":"[GIN] 2022/03/30 - 23:05:53 | 301 |      37.701µs |    192.168.64.1 | GET      \"/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:53.194168003Z"}
{"log":"[GIN] 2022/03/30 - 23:05:53 | 200 |     2.18324ms |    192.168.64.1 | GET      \"/api/v1/cars/1/status\"\n","stream":"stdout","time":"2022-03-30T21:05:53.198822987Z"}
{"log":"2022/03/30 23:05:53.198694 [info] TeslaMateAPICarsStatusV1 - (/api/v1/cars/1/status) executed successfully.\n","stream":"stderr","time":"2022-03-30T21:05:53.198825587Z"}

I do not see any suspicious things here. As I do not know how long the timeout is, I attached the full log
TeslaMateApi.log.

@pkuehnel, I'll close this issue since it has been over two years since the last activity.
If you still encounter issues with MQTT and disconnects, please open up a new issue :)