From 66c040c64123a1aa5d34cd8a4ef22caa2ca3f4ff Mon Sep 17 00:00:00 2001 From: Benjamin Meier Date: Wed, 1 Jan 2025 22:45:32 +0100 Subject: [PATCH] Fix for issue #17699: Using correct MQTT topic for charging state --- templates/definition/vehicle/teslamate.yaml | 27 ++++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/templates/definition/vehicle/teslamate.yaml b/templates/definition/vehicle/teslamate.yaml index cd3ab2d86f..a524aa5928 100644 --- a/templates/definition/vehicle/teslamate.yaml +++ b/templates/definition/vehicle/teslamate.yaml @@ -14,33 +14,42 @@ params: de: Fahrzeug-ID en: Vehicle ID default: 1 + - name: timeout + default: 1h render: | type: custom {{- include "vehicle-common" . }} soc: source: mqtt topic: teslamate/cars/{{ .id }}/battery_level - timeout: 720h # 30d + timeout: {{ .timeout }} status: source: combined plugged: source: mqtt topic: teslamate/cars/{{ .id }}/plugged_in - timeout: 720h # 30d + timeout: {{ .timeout }} charging: - source: mqtt - topic: teslamate/cars/{{ .id }}/charger_actual_current - timeout: 720h # 30d + source: go + script: | + charging_state == "Charging" + in: + - name: charging_state + type: string + config: + source: mqtt + topic: teslamate/cars/{{ .id }}/charging_state + timeout: {{ .timeout }} range: source: mqtt topic: teslamate/cars/{{ .id }}/rated_battery_range_km - timeout: 720h # 30d + timeout: {{ .timeout }} odometer: source: mqtt topic: teslamate/cars/{{ .id }}/odometer - timeout: 720h # 30d + timeout: {{ .timeout }} limitsoc: source: mqtt topic: teslamate/cars/{{ .id }}/charge_limit_soc - timeout: 720h - features: ["coarsecurrent"] + timeout: {{ .timeout }} + features: ["coarsecurrent"] \ No newline at end of file