diff --git a/templates/definition/vehicle/tesla-ble.yaml b/templates/definition/vehicle/tesla-ble.yaml index a25016b33..705fdcbca 100644 --- a/templates/definition/vehicle/tesla-ble.yaml +++ b/templates/definition/vehicle/tesla-ble.yaml @@ -70,6 +70,12 @@ render: | scale: 1.60934 timeout: {{ .timeout }} cache: 1s + finishtime: + source: http + uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state + jq: 'if (.response.response.charge_state.minutes_to_full_charge > 0) then (now + (.response.response.charge_state.minutes_to_full_charge * 60) | strftime("%Y-%m-%dT%H:%M:%SZ")) else "" end' + timeout: {{ .timeout }} + cache: 1s status: source: http uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state