diff --git a/templates/definition/vehicle/aiways.yaml b/templates/definition/vehicle/aiways.yaml index 298c98bbf8..a1cf92d912 100644 --- a/templates/definition/vehicle/aiways.yaml +++ b/templates/definition/vehicle/aiways.yaml @@ -3,10 +3,8 @@ products: - brand: Aiways params: - preset: vehicle-base - - preset: vehicle-identify - name: vin required: true render: | type: aiways {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/audi.yaml b/templates/definition/vehicle/audi.yaml index fa0c4509e1..91b2b5deb6 100644 --- a/templates/definition/vehicle/audi.yaml +++ b/templates/definition/vehicle/audi.yaml @@ -4,10 +4,8 @@ products: - brand: Audi params: - preset: vehicle-base - - preset: vehicle-identify - name: vin example: WAUZZZ... render: | type: etron {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/bmw.yaml b/templates/definition/vehicle/bmw.yaml index 1e36a91878..ec572189a1 100644 --- a/templates/definition/vehicle/bmw.yaml +++ b/templates/definition/vehicle/bmw.yaml @@ -9,38 +9,23 @@ requirements: Requires `hcaptcha` token. This must be generated once at https://bimmer-connected.readthedocs.io/en/latest/captcha/rest_of_world.html. The token is only valid for a short time. Please copy it into the configuration and start evcc as soon as possible after generation. params: - preset: vehicle-base - - preset: vehicle-identify - name: vin example: WBMW... - name: region description: de: Region en: Region - # values: - # - NA - # - EU + validvalues: ["NA", "EU"] default: EU advanced: true - - name: coarsecurrent - advanced: true - - name: welcomecharge - advanced: true - name: hcaptcha required: true + - preset: vehicle-features render: | type: bmw {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} {{- if ne .region "EU" }} region: {{ .region }} {{- end }} - {{- if or (eq .coarsecurrent "true") (eq .welcomecharge "true") }} - features: - {{- if eq .coarsecurrent "true" }} - - coarsecurrent - {{- end }} - {{- if eq .welcomecharge "true" }} - - welcomecharge - {{- end }} - {{- end }} + {{ include "vehicle-features" . }} hcaptcha: {{ .hcaptcha }} diff --git a/templates/definition/vehicle/carwings.yaml b/templates/definition/vehicle/carwings.yaml index e90db31922..9f64ee892c 100644 --- a/templates/definition/vehicle/carwings.yaml +++ b/templates/definition/vehicle/carwings.yaml @@ -5,8 +5,6 @@ products: generic: Leaf (pre 2019) params: - preset: vehicle-base - - preset: vehicle-identify render: | type: carwings {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/citroen.yaml b/templates/definition/vehicle/citroen.yaml index 9ae48764c7..93d661e86c 100644 --- a/templates/definition/vehicle/citroen.yaml +++ b/templates/definition/vehicle/citroen.yaml @@ -8,10 +8,7 @@ requirements: en: | Requires `access` and `refresh` tokens. These can be generated with command `evcc token [name]`. params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: user required: true - name: password @@ -24,10 +21,8 @@ params: mask: true - name: vin example: V... - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify + - name: cache + default: 15m render: | type: citroen vin: {{ .vin }} @@ -36,4 +31,4 @@ render: | access: {{ .accessToken }} refresh: {{ .refreshToken }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} + cache: {{ .cache }} diff --git a/templates/definition/vehicle/dacia.yaml b/templates/definition/vehicle/dacia.yaml index a62f44f0c8..097fda5732 100644 --- a/templates/definition/vehicle/dacia.yaml +++ b/templates/definition/vehicle/dacia.yaml @@ -3,13 +3,8 @@ products: - brand: Dacia params: - preset: vehicle-base - - preset: vehicle-identify - - name: welcomecharge - advanced: true + - preset: vehicle-features render: | type: dacia {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} - {{- if eq .welcomecharge "true" }} - features: ["welcomecharge"] - {{- end }} + {{ include "vehicle-features" . }} diff --git a/templates/definition/vehicle/ds.yaml b/templates/definition/vehicle/ds.yaml index 1eed9a9c90..4ea4363dc6 100644 --- a/templates/definition/vehicle/ds.yaml +++ b/templates/definition/vehicle/ds.yaml @@ -8,10 +8,7 @@ requirements: en: | Requires `access` and `refresh` tokens. These can be generated with command `evcc token [name]`. params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: user required: true - name: password @@ -24,10 +21,8 @@ params: mask: true - name: vin example: V... - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify + - name: cache + default: 15m render: | type: ds vin: {{ .vin }} @@ -36,4 +31,4 @@ render: | access: {{ .accessToken }} refresh: {{ .refreshToken }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} + cache: {{ .cache }} diff --git a/templates/definition/vehicle/evnotify.yaml b/templates/definition/vehicle/evnotify.yaml index 6ec635abd0..c91df250f8 100644 --- a/templates/definition/vehicle/evnotify.yaml +++ b/templates/definition/vehicle/evnotify.yaml @@ -4,24 +4,15 @@ products: generic: evNotify group: generic params: - - name: title - - name: icon - default: car - advanced: true - name: akey required: true - name: token required: true - - name: capacity - type: float - - name: phases - advanced: true - - preset: vehicle-identify + - preset: vehicle-common render: | type: custom {{ include "vehicle-common" . }} soc: source: http - uri: https://app.evnotify.de/soc?akey={{ urlEncode .akey }}&token={{ urlEncode .token }} # evNotify Server + AKEY + uri: https://app.evnotify.de/soc?akey={{ urlEncode .akey }}&token={{ urlEncode .token }} jq: .soc_display - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/fiat.yaml b/templates/definition/vehicle/fiat.yaml index 71923bf9dc..79cda4f27b 100644 --- a/templates/definition/vehicle/fiat.yaml +++ b/templates/definition/vehicle/fiat.yaml @@ -8,16 +8,11 @@ params: example: ZFAE... - name: pin mask: true - - preset: vehicle-identify - - name: welcomecharge - advanced: true + - preset: vehicle-features render: | type: fiat {{ include "vehicle-base" . }} {{- if .pin }} pin: {{ .pin }} # mandatory to deep refresh Soc {{- end }} - {{ include "vehicle-identify" . }} - {{- if eq .welcomecharge "true" }} - features: ["welcomecharge"] - {{- end }} + {{ include "vehicle-features" . }} diff --git a/templates/definition/vehicle/flobz.yaml b/templates/definition/vehicle/flobz.yaml index 733623d84f..f9c6f497b8 100644 --- a/templates/definition/vehicle/flobz.yaml +++ b/templates/definition/vehicle/flobz.yaml @@ -7,47 +7,25 @@ requirements: description: generic: Remote Control of PSA car https://github.com/flobz/psa_car_controller params: - - name: title - - name: icon - default: car - advanced: true - name: url - required: true example: http://192.0.2.2 + required: true + - name: vin + required: true + - preset: vehicle-common - name: host deprecated: true - name: port deprecated: true - - name: vin - required: true - help: - de: Erforderlich - en: Required - - name: capacity - - name: phases - advanced: true - name: wakeup_alt help: de: alternativer wakeup-Code; könnte zu erhöhter Entladung der 12V-Batterie führen. en: alternative wakeup-code; could lead to increased discharge of the 12V battery. default: false advanced: true - - preset: vehicle-identify render: | type: custom - {{- if .title }} - title: {{ .title }} - {{- end }} - {{- if .icon }} - icon: {{ .icon }} - {{- end }} - {{- if .capacity }} - capacity: {{ .capacity }} - {{- end }} - {{- if .phases }} - phases: {{ .phases }} - {{- end }} - {{- include "vehicle-identify" . }} + {{- include "vehicle-common" . }} soc: {{- include "source" . | indent 2 }} jq: .energy[0].level diff --git a/templates/definition/vehicle/ford-connect.yaml b/templates/definition/vehicle/ford-connect.yaml index da0e14c4e4..3e6380574b 100644 --- a/templates/definition/vehicle/ford-connect.yaml +++ b/templates/definition/vehicle/ford-connect.yaml @@ -2,10 +2,7 @@ template: ford-connect products: - brand: Ford params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: clientid description: generic: FordConnect API Client ID @@ -28,11 +25,8 @@ params: mask: true - name: vin example: WF0FXX... - - name: capacity - default: 10 - - name: phases - advanced: true - - preset: vehicle-identify + - name: cache + default: 15m render: | type: ford-connect vin: {{ .vin }} @@ -43,4 +37,4 @@ render: | access: {{ .accessToken }} refresh: {{ .refreshToken }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} + cache: {{ .cache }} diff --git a/templates/definition/vehicle/ford.yaml b/templates/definition/vehicle/ford.yaml index 50e5f68d0a..088f969211 100644 --- a/templates/definition/vehicle/ford.yaml +++ b/templates/definition/vehicle/ford.yaml @@ -4,7 +4,6 @@ products: - brand: Ford params: - preset: vehicle-base - - preset: vehicle-identify - name: vin example: WF0FXX... - name: domain @@ -13,5 +12,4 @@ params: render: | type: ford {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} domain: {{ .domain }} diff --git a/templates/definition/vehicle/hyundai.yaml b/templates/definition/vehicle/hyundai.yaml index ccd1df9e57..1467f6c518 100644 --- a/templates/definition/vehicle/hyundai.yaml +++ b/templates/definition/vehicle/hyundai.yaml @@ -10,9 +10,7 @@ requirements: params: - preset: vehicle-base - preset: vehicle-language - - preset: vehicle-identify render: | type: hyundai {{ include "vehicle-base" . }} {{ include "vehicle-language" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/ioBroker.bmw.yaml b/templates/definition/vehicle/ioBroker.bmw.yaml index e170cfad15..6a8f087a85 100644 --- a/templates/definition/vehicle/ioBroker.bmw.yaml +++ b/templates/definition/vehicle/ioBroker.bmw.yaml @@ -8,17 +8,9 @@ requirements: en: ioBroker BMW Adapter. Requires ioBroker.bmw and ioBroker.simple-api de: ioBroker BMW Adapter. Benötigt ioBroker.bmw und ioBroker.simple-api params: - - name: title - - name: icon - default: car - advanced: true - - name: capacity - type: float - - name: phases - advanced: true + - preset: vehicle-common - name: vin example: WBMW... - - preset: vehicle-identify - name: uri help: generic: ioBroker URL @@ -29,14 +21,10 @@ params: de: Instanz-ID en: Instance ID advanced: true - - name: coarsecurrent - advanced: true - - name: welcomecharge - advanced: true + - preset: vehicle-features render: | type: custom {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} soc: source: http uri: {{ .uri }}/getPlainValue/bmw.{{ .id }}.{{ .vin }}.state.electricChargingState.chargingLevelPercent @@ -55,12 +43,4 @@ render: | odometer: source: http uri: {{ .uri }}/getPlainValue/bmw.{{ .id }}.{{ .vin }}.state.currentMileage - {{- if or (eq .coarsecurrent "true") (eq .welcomecharge "true") }} - features: - {{- if eq .coarsecurrent "true" }} - - coarsecurrent - {{- end }} - {{- if eq .welcomecharge "true" }} - - welcomecharge - {{- end }} - {{- end }} + {{ include "vehicle-features" . }} diff --git a/templates/definition/vehicle/iso15118.yaml b/templates/definition/vehicle/iso15118.yaml index ba6dda633f..960e2cef8a 100644 --- a/templates/definition/vehicle/iso15118.yaml +++ b/templates/definition/vehicle/iso15118.yaml @@ -17,14 +17,7 @@ requirements: This requires an active location-based charging profile with the lowest minimum charge (25%) and direct charging disabled. Otherwise the vehicle cannot be put into sleep mode. params: - - name: title - - name: icon - default: car - advanced: true - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify + - preset: vehicle-common render: | type: custom {{- include "vehicle-common" . }} @@ -32,4 +25,3 @@ render: | soc: source: const value: 0 - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/jaguar-landrover.yaml b/templates/definition/vehicle/jaguar-landrover.yaml index 49a6a49b0f..448c418f69 100644 --- a/templates/definition/vehicle/jaguar-landrover.yaml +++ b/templates/definition/vehicle/jaguar-landrover.yaml @@ -5,8 +5,6 @@ products: - brand: Land Rover params: - preset: vehicle-base - - preset: vehicle-identify render: | type: jaguar {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/kia.yaml b/templates/definition/vehicle/kia.yaml index 7503927815..f4ea061077 100644 --- a/templates/definition/vehicle/kia.yaml +++ b/templates/definition/vehicle/kia.yaml @@ -10,9 +10,7 @@ requirements: params: - preset: vehicle-base - preset: vehicle-language - - preset: vehicle-identify render: | type: kia {{ include "vehicle-base" . }} {{ include "vehicle-language" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/mazda2mqtt.yaml b/templates/definition/vehicle/mazda2mqtt.yaml index 73dd7381b3..ce7f2c4886 100644 --- a/templates/definition/vehicle/mazda2mqtt.yaml +++ b/templates/definition/vehicle/mazda2mqtt.yaml @@ -9,36 +9,14 @@ requirements: en: Required MQTT broker configuration and a mazda2mqtt installation https://github.com/C64Axel/mazda2mqtt. de: Voraussetzung ist ein konfigurierter MQTT Broker und eine mazda2mqtt Installation https://github.com/C64Axel/mazda2mqtt. params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: vin required: true - help: - de: Erforderlich - en: Required - - name: capacity - - name: phases - advanced: true - name: timeout default: 720h - - preset: vehicle-identify render: | type: custom - {{- if .title }} - title: {{ .title }} - {{- end }} - {{- if .icon }} - icon: {{ .icon }} - {{- end }} - {{- if .capacity }} - capacity: {{ .capacity }} - {{- end }} - {{- if .phases }} - phases: {{ .phases }} - {{- end }} - {{- include "vehicle-identify" . }} + {{- include "vehicle-common" . }} soc: source: mqtt topic: mazda2mqtt/{{ .vin }}/chargeInfo/batteryLevelPercentage diff --git a/templates/definition/vehicle/mercedes.yaml b/templates/definition/vehicle/mercedes.yaml index b2abd37fec..c19ebbd10e 100644 --- a/templates/definition/vehicle/mercedes.yaml +++ b/templates/definition/vehicle/mercedes.yaml @@ -8,12 +8,7 @@ requirements: en: | Requires `access` and `refresh` tokens. These can be generated with command `evcc token [name]`. params: - - name: title - - name: icon - default: car - advanced: true - - name: user - required: true + - preset: vehicle-common - name: region required: true validvalues: [EMEA, APAC, NORAM] @@ -26,10 +21,6 @@ params: mask: true - name: vin example: V... - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify render: | type: mercedes vin: {{ .vin }} @@ -39,4 +30,3 @@ render: | access: {{ .accessToken }} refresh: {{ .refreshToken }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/mg.yaml b/templates/definition/vehicle/mg.yaml index 12ad05297c..2a55b41c41 100644 --- a/templates/definition/vehicle/mg.yaml +++ b/templates/definition/vehicle/mg.yaml @@ -3,11 +3,7 @@ products: - brand: MG params: - preset: vehicle-base - - preset: vehicle-identify - name: vin - help: - de: Erforderlich - en: Required required: true - name: region description: @@ -19,5 +15,4 @@ params: render: | type: mg {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} region: {{ .region }} diff --git a/templates/definition/vehicle/mg2mqtt.yaml b/templates/definition/vehicle/mg2mqtt.yaml index 9eb3fa8b47..e9b79b8940 100644 --- a/templates/definition/vehicle/mg2mqtt.yaml +++ b/templates/definition/vehicle/mg2mqtt.yaml @@ -8,24 +8,12 @@ requirements: en: Required MQTT broker configuration and a SAIC/MQTT Gateway (https://github.com/SAIC-iSmart-API/saic-python-mqtt-gateway or https://github.com/SAIC-iSmart-API/saic-java-client) de: Voraussetzung ist ein konfigurierter MQTT Broker und ein SAIC/MQTT Gateway (https://github.com/SAIC-iSmart-API/saic-python-mqtt-gateway oder https://github.com/SAIC-iSmart-API/saic-java-client) params: - - name: title - - name: user - required: true - - name: vin - required: true - - name: capacity - - name: phases - advanced: true - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: timeout default: 1h - - preset: vehicle-identify render: | type: custom {{- include "vehicle-common" . }} - {{- include "vehicle-identify" . }} soc: # battery soc (%) source: mqtt topic: saic/{{ .user }}/vehicles/{{ .vin }}/drivetrain/soc diff --git a/templates/definition/vehicle/mini.yaml b/templates/definition/vehicle/mini.yaml index e60cbfe7f6..e72ad4f058 100644 --- a/templates/definition/vehicle/mini.yaml +++ b/templates/definition/vehicle/mini.yaml @@ -9,30 +9,23 @@ requirements: Requires `hcaptcha` token. This must be generated once at https://bimmer-connected.readthedocs.io/en/latest/captcha/rest_of_world.html. The token is only valid for a short time. Please copy it into the configuration and start evcc as soon as possible after generation. params: - preset: vehicle-base - - preset: vehicle-identify - name: vin example: WBMW... - name: region description: de: Region en: Region - # values: - # - NA - # - EU + validvalues: ["NA", "EU"] default: EU advanced: true - - name: welcomecharge - advanced: true - name: hcaptcha required: true + - preset: vehicle-features render: | type: mini {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} {{- if ne .region "EU" }} region: {{ .region }} {{- end }} - {{- if eq .welcomecharge "true" }} - features: ["welcomecharge"] - {{- end }} hcaptcha: {{ .hcaptcha }} + {{ include "vehicle-features" . }} diff --git a/templates/definition/vehicle/mz2mqtt.yaml b/templates/definition/vehicle/mz2mqtt.yaml index cb5e495307..6c0e9cf3cb 100644 --- a/templates/definition/vehicle/mz2mqtt.yaml +++ b/templates/definition/vehicle/mz2mqtt.yaml @@ -8,37 +8,15 @@ requirements: en: myMazda to MQTT. Required MQTT broker configuration and a mz2mqtt installation https://github.com/C64Axel/mz2mqtt. de: myMazda zu MQTT. Voraussetzung ist ein konfigurierter MQTT Broker und eine mz2mqtt Installation https://github.com/C64Axel/mz2mqtt. params: - - name: title + - preset: vehicle-common - name: vin required: true - help: - de: Erforderlich - en: Required - - name: capacity - - name: phases - advanced: true - - name: icon - default: car - advanced: true - name: timeout default: 720h advanced: true - - preset: vehicle-identify render: | type: custom - {{- if .title }} - title: {{ .title }} - {{- end }} - {{- if .icon }} - icon: {{ .icon }} - {{- end }} - {{- if .capacity }} - capacity: {{ .capacity }} - {{- end }} - {{- if .phases }} - phases: {{ .phases }} - {{- end }} - {{- include "vehicle-identify" . }} + {{- include "vehicle-common" . }} soc: source: mqtt topic: mz2mqtt/{{ .vin }}/chargeInfo/batteryLevelPercentage diff --git a/templates/definition/vehicle/nissan-ariya.yaml b/templates/definition/vehicle/nissan-ariya.yaml index b455b4486f..6fb03a7942 100644 --- a/templates/definition/vehicle/nissan-ariya.yaml +++ b/templates/definition/vehicle/nissan-ariya.yaml @@ -5,9 +5,7 @@ products: generic: Ariya params: - preset: vehicle-base - - preset: vehicle-identify render: | type: nissan version: v2 {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/nissan.yaml b/templates/definition/vehicle/nissan.yaml index 37ae48aaaf..730136a263 100644 --- a/templates/definition/vehicle/nissan.yaml +++ b/templates/definition/vehicle/nissan.yaml @@ -5,8 +5,6 @@ products: generic: Leaf params: - preset: vehicle-base - - preset: vehicle-identify render: | type: nissan {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/niu-e-scooter.yaml b/templates/definition/vehicle/niu-e-scooter.yaml index b7312d439b..e29ed51bb1 100644 --- a/templates/definition/vehicle/niu-e-scooter.yaml +++ b/templates/definition/vehicle/niu-e-scooter.yaml @@ -19,7 +19,6 @@ params: required: true - name: capacity default: 4 - - preset: vehicle-identify render: | type: niu {{- if .title }} @@ -32,4 +31,3 @@ render: | password: {{ .password }} # NIU app password serial: {{ .serial }} # NIU E-Scooter serial number like shown in app capacity: {{ .capacity }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/offline.yaml b/templates/definition/vehicle/offline.yaml index 44f9eaaece..e0d238e6d4 100644 --- a/templates/definition/vehicle/offline.yaml +++ b/templates/definition/vehicle/offline.yaml @@ -4,14 +4,7 @@ products: generic: Offline group: generic params: - - name: title - - name: icon - default: car - advanced: true - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify + - preset: vehicle-common render: | type: custom features: ["offline"] @@ -19,4 +12,3 @@ render: | soc: source: const value: 0 - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/opel.yaml b/templates/definition/vehicle/opel.yaml index 5e3b9997ab..aa8c7eaa6b 100644 --- a/templates/definition/vehicle/opel.yaml +++ b/templates/definition/vehicle/opel.yaml @@ -8,10 +8,7 @@ requirements: en: | Requires `access` and `refresh` tokens. These can be generated with command `evcc token [name]`. params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: user required: true - name: password @@ -24,10 +21,8 @@ params: mask: true - name: vin example: V... - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify + - name: cache + default: 15m render: | type: opel vin: {{ .vin }} @@ -36,4 +31,4 @@ render: | access: {{ .accessToken }} refresh: {{ .refreshToken }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} + cache: {{ .cache }} diff --git a/templates/definition/vehicle/ovms.yaml b/templates/definition/vehicle/ovms.yaml index 21a439ee1c..b4d33f9014 100644 --- a/templates/definition/vehicle/ovms.yaml +++ b/templates/definition/vehicle/ovms.yaml @@ -8,30 +8,24 @@ requirements: de: Unterstützung für alle Fahrzeuge via ODB2 Adapter im Fahrzeug. Mehr Infos bei [Open Vehicle Monitoring System](http://api.openvehicles.com/). en: Support for all vehicles via ODB2 adapter in the vehicle. More info at [Open Vehicle Monitoring System](http://api.openvehicles.com/). params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: user required: true - name: password required: true - name: vehicleid required: true - - name: capacity - default: 12 - - name: phases - advanced: true - name: server default: dexters-web.de advanced: true required: true - - preset: vehicle-identify + - name: cache + default: 15m render: | type: ovms {{- include "vehicle-common" . }} user: {{ .user }} password: {{ .password }} - vehicleid: {{ .vehicleid }} # vehicle id + vehicleid: {{ .vehicleid }} server: {{ .server }} - {{ include "vehicle-identify" . }} + cache: {{ .cache }} diff --git a/templates/definition/vehicle/peugeot.yaml b/templates/definition/vehicle/peugeot.yaml index 86ee364b7a..cdc53a3902 100644 --- a/templates/definition/vehicle/peugeot.yaml +++ b/templates/definition/vehicle/peugeot.yaml @@ -8,10 +8,7 @@ requirements: en: | Requires `access` and `refresh` tokens. These can be generated with command `evcc token [name]`. params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: user required: true - name: password @@ -24,10 +21,8 @@ params: mask: true - name: vin example: V... - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify + - name: cache + default: 15m render: | type: peugeot vin: {{ .vin }} @@ -36,4 +31,4 @@ render: | access: {{ .accessToken }} refresh: {{ .refreshToken }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} + cache: {{ .cache }} diff --git a/templates/definition/vehicle/polestar.yaml b/templates/definition/vehicle/polestar.yaml index d5cda5bdac..33e4fdba43 100644 --- a/templates/definition/vehicle/polestar.yaml +++ b/templates/definition/vehicle/polestar.yaml @@ -5,10 +5,8 @@ requirements: evcc: ["skiptest"] params: - preset: vehicle-base - - preset: vehicle-identify - name: vin example: LPSVS... render: | type: polestar {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/porsche.yaml b/templates/definition/vehicle/porsche.yaml index 4635be5fdd..efa05c6614 100644 --- a/templates/definition/vehicle/porsche.yaml +++ b/templates/definition/vehicle/porsche.yaml @@ -4,8 +4,6 @@ products: - brand: Porsche params: - preset: vehicle-base - - preset: vehicle-identify render: | type: porsche {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/renault.yaml b/templates/definition/vehicle/renault.yaml index 8c921f3f83..0ebeda19a8 100644 --- a/templates/definition/vehicle/renault.yaml +++ b/templates/definition/vehicle/renault.yaml @@ -3,7 +3,6 @@ products: - brand: Renault params: - preset: vehicle-base - - preset: vehicle-identify - name: vin example: WREN... - name: alternativewakeup @@ -15,5 +14,4 @@ params: render: | type: renault {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} alternativewakeup: {{ .alternativewakeup }} diff --git a/templates/definition/vehicle/seat-cupra.yaml b/templates/definition/vehicle/seat-cupra.yaml index 6aab57ac07..2e8e52e487 100644 --- a/templates/definition/vehicle/seat-cupra.yaml +++ b/templates/definition/vehicle/seat-cupra.yaml @@ -5,13 +5,8 @@ products: generic: CupraConnect Gen4 (Born) params: - preset: vehicle-base - - preset: vehicle-identify - - name: welcomecharge - advanced: true + - preset: vehicle-features render: | type: cupra {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} - {{- if eq .welcomecharge "true" }} - features: ["welcomecharge"] - {{- end }} + {{ include "vehicle-features" . }} diff --git a/templates/definition/vehicle/seat.yaml b/templates/definition/vehicle/seat.yaml index c96cc2b059..c4ead10dc8 100644 --- a/templates/definition/vehicle/seat.yaml +++ b/templates/definition/vehicle/seat.yaml @@ -5,8 +5,6 @@ products: generic: CupraConnect Gen3 (Ateca, Leon, Formentor) params: - preset: vehicle-base - - preset: vehicle-identify render: | type: seat {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/skoda-enyaq.yaml b/templates/definition/vehicle/skoda-enyaq.yaml index 17f26faf0d..90617239e8 100644 --- a/templates/definition/vehicle/skoda-enyaq.yaml +++ b/templates/definition/vehicle/skoda-enyaq.yaml @@ -5,11 +5,9 @@ products: generic: Enyaq params: - preset: vehicle-base - - preset: vehicle-identify - name: timeout default: 10s render: | type: enyaq {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} timeout: {{ .timeout }} diff --git a/templates/definition/vehicle/skoda.yaml b/templates/definition/vehicle/skoda.yaml index 4cb08a9849..0cd5d7a4fc 100644 --- a/templates/definition/vehicle/skoda.yaml +++ b/templates/definition/vehicle/skoda.yaml @@ -6,8 +6,6 @@ products: en: Others params: - preset: vehicle-base - - preset: vehicle-identify render: | type: skoda {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/smart-hello.yaml b/templates/definition/vehicle/smart-hello.yaml index 61f799ac22..ac9c56365f 100644 --- a/templates/definition/vehicle/smart-hello.yaml +++ b/templates/definition/vehicle/smart-hello.yaml @@ -5,13 +5,8 @@ products: generic: "#1" params: - preset: vehicle-base - - preset: vehicle-identify - - name: welcomecharge - advanced: true + - preset: vehicle-features render: | type: smart-hello {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} - {{- if eq .welcomecharge "true" }} - features: ["welcomecharge"] - {{- end }} + {{ include "vehicle-features" . }} diff --git a/templates/definition/vehicle/smart.yaml b/templates/definition/vehicle/smart.yaml index f4fc97169c..fb8d12e21d 100644 --- a/templates/definition/vehicle/smart.yaml +++ b/templates/definition/vehicle/smart.yaml @@ -5,8 +5,6 @@ products: generic: EQ params: - preset: vehicle-base - - preset: vehicle-identify render: | type: smart {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/tesla.yaml b/templates/definition/vehicle/tesla.yaml index 82c2a838b9..2e17c4f989 100644 --- a/templates/definition/vehicle/tesla.yaml +++ b/templates/definition/vehicle/tesla.yaml @@ -14,10 +14,7 @@ requirements: See [tesla.evcc.io](https://tesla.evcc.io). evcc: ["sponsorship"] params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: accessToken required: true mask: true @@ -26,9 +23,6 @@ params: mask: true - name: vin example: W... - - name: capacity - - name: phases - advanced: true - name: control deprecated: true - name: commandProxy @@ -37,7 +31,8 @@ params: help: en: "When using a TWC3 (or other 'dumb' charger not capable of control), evcc can manage the charge directly by communicating with the vehicle through a Command Proxy. By default, the proxy provided by evcc is used. With this parameter, you set the base URL of a custom Command Proxy to use instead of the default evcc one. See for example https://github.com/wimaha/TeslaBleHttpProxy for a proxy sending commands via bluetooth." de: "Bei Verwendung eines TWC3 (oder eines anderen 'dummen' Ladegeräts, das nicht steuerbar ist) kann evcc die Ladung direkt verwalten, indem es über einen Command Proxy mit dem Fahrzeug kommuniziert. Standardmäßig wird der von evcc bereitgestellte Proxy verwendet. Dieses parameter setzt die Basis-URL eines benutzerdefinierten Command Proxy, der anstelle des standardmäßigen evcc-Proxy verwendet werden soll. Siehe zum Beispiel https://github.com/wimaha/TeslaBleHttpProxy für einen Proxy, der Kommandos über Bluetooth sendet." - - preset: vehicle-identify + - name: cache + default: 15m render: | type: tesla vin: {{ .vin }} @@ -46,5 +41,5 @@ render: | refresh: {{ .refreshToken }} commandProxy: {{ .commandProxy }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} features: ["coarsecurrent"] + cache: {{ .cache }} diff --git a/templates/definition/vehicle/teslalogger.yaml b/templates/definition/vehicle/teslalogger.yaml index 1e245d04ad..f2fecc05e0 100644 --- a/templates/definition/vehicle/teslalogger.yaml +++ b/templates/definition/vehicle/teslalogger.yaml @@ -8,7 +8,7 @@ requirements: de: Open Source Tesla Datenlogger https://github.com/bassmaster187/TeslaLogger en: Open source Tesla data logger https://github.com/bassmaster187/TeslaLogger params: - - name: title + - preset: vehicle-common - name: id description: de: TeslaLogger CarID @@ -20,18 +20,9 @@ params: - name: port example: 5000 default: 5000 - - name: capacity - - name: phases - advanced: true - - name: icon - default: car - advanced: true - - preset: vehicle-identify - render: | type: custom {{- include "vehicle-common" . }} - {{- include "vehicle-identify" . }} soc: # battery soc (%) source: http uri: {{ .url }}:{{ .port }}/currentjson/{{ .id }} diff --git a/templates/definition/vehicle/teslamate.yaml b/templates/definition/vehicle/teslamate.yaml index a20c04aaf2..cd3ab2d86f 100644 --- a/templates/definition/vehicle/teslamate.yaml +++ b/templates/definition/vehicle/teslamate.yaml @@ -8,23 +8,15 @@ requirements: en: Open source Tesla data logger https://github.com/adriankumpf/teslamate. MQTT broker required. de: Open Source Tesla Datenlogger https://github.com/adriankumpf/teslamate. Voraussetzung ist konfigurierter MQTT Broker. params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: id description: de: Fahrzeug-ID en: Vehicle ID default: 1 - - name: capacity - - name: phases - advanced: true - - preset: vehicle-identify render: | type: custom {{- include "vehicle-common" . }} - {{- include "vehicle-identify" . }} soc: source: mqtt topic: teslamate/cars/{{ .id }}/battery_level diff --git a/templates/definition/vehicle/tessie.yaml b/templates/definition/vehicle/tessie.yaml index 2a6f3c2bc3..1587a09c74 100644 --- a/templates/definition/vehicle/tessie.yaml +++ b/templates/definition/vehicle/tessie.yaml @@ -8,7 +8,7 @@ requirements: de: Verbinden Sie Ihr Tesla-Fahrzeug über die Tessie-API. Dies wird das Fahrzeug niemals aufwecken; das Polling kann auf „always“ und interval „1M“ eingestellt werden. Wenn das Fahrzeug wach ist, sind die Daten normalerweise weniger als 15 Sekunden alt. Wenn das Fahrzeug schläft, stammen die Daten aus dem Zeitpunkt, zu dem es eingeschlafen ist. Holen Sie sich Ihr Token unter https://dash.tessie.com/settings/api en: Connect your Tesla using the Tessie API. This will never wake up the car, polling can be set to "always" and interval "1M". If the vehicle is awake, the data is usually less than 15 seconds old. If the vehicle is asleep, the data is from the time the vehicle went to sleep. Get your token at https://dash.tessie.com/settings/api params: - - name: title + - preset: vehicle-common - name: vin description: de: Fahrzeug-VIN @@ -19,17 +19,9 @@ params: de: Tessie API Token en: Tessie API Token required: true - - name: capacity - - name: phases - advanced: true - - name: icon - default: car - advanced: true - - preset: vehicle-identify render: | type: custom {{- include "vehicle-common" . }} - {{- include "vehicle-identify" . }} soc: # battery state of charge (%) source: http uri: https://api.tessie.com/{{ .vin }}/state?use_cache=true diff --git a/templates/definition/vehicle/tronity.yaml b/templates/definition/vehicle/tronity.yaml index 0310de39d5..9149d4892f 100644 --- a/templates/definition/vehicle/tronity.yaml +++ b/templates/definition/vehicle/tronity.yaml @@ -6,10 +6,7 @@ group: generic requirements: evcc: ["sponsorship"] params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: clientid description: generic: Tronity API Client ID @@ -26,11 +23,8 @@ params: required: true - name: vin example: W... - - name: capacity - default: 10 - - name: phases - advanced: true - - preset: vehicle-identify + - name: cache + default: 15m render: | type: tronity vin: {{ .vin }} @@ -38,4 +32,4 @@ render: | id: {{ .clientid }} secret: {{ .clientsecret }} {{ include "vehicle-common" . }} - {{ include "vehicle-identify" . }} + cache: {{ .cache }} diff --git a/templates/definition/vehicle/volvo-connected.yaml b/templates/definition/vehicle/volvo-connected.yaml index 3baf3582a8..955cdbc270 100644 --- a/templates/definition/vehicle/volvo-connected.yaml +++ b/templates/definition/vehicle/volvo-connected.yaml @@ -6,7 +6,6 @@ products: en: latest params: - preset: vehicle-base - - preset: vehicle-identify - name: vccapikey required: true help: @@ -16,4 +15,3 @@ render: | type: volvo-connected vccapikey: {{ .vccapikey }} {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/volvo.yaml b/templates/definition/vehicle/volvo.yaml index 16fb436cdd..fc9ed8844a 100644 --- a/templates/definition/vehicle/volvo.yaml +++ b/templates/definition/vehicle/volvo.yaml @@ -6,8 +6,6 @@ products: en: legacy params: - preset: vehicle-base - - preset: vehicle-identify render: | type: volvo {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/templates/definition/vehicle/volvo2mqtt.yaml b/templates/definition/vehicle/volvo2mqtt.yaml index bee2dd8f0f..867bf8e381 100644 --- a/templates/definition/vehicle/volvo2mqtt.yaml +++ b/templates/definition/vehicle/volvo2mqtt.yaml @@ -8,36 +8,14 @@ requirements: en: Requires MQTT broker configuration and a volvo2mqtt installation https://github.com/Dielee/volvo2mqtt de: Erforderlich ist eine konfigurierte MQTT Broker-Konfiguration und eine volvo2mqtt-Installation https://github.com/Dielee/volvo2mqtt. params: - - name: title - - name: icon - default: car - advanced: true + - preset: vehicle-common - name: vin required: true - help: - de: Erforderlich - en: Required - - name: capacity - - name: phases - advanced: true - name: timeout default: 720h - - preset: vehicle-identify render: | type: custom - {{- if .title }} - title: {{ .title }} - {{- end }} - {{- if .icon }} - icon: {{ .icon }} - {{- end }} - {{- if .capacity }} - capacity: {{ .capacity }} - {{- end }} - {{- if .phases }} - phases: {{ .phases }} - {{- end }} - {{- include "vehicle-identify" . }} + {{- include "vehicle-common" . }} soc: source: mqtt topic: homeassistant/sensor/{{ .vin }}_battery_charge_level/state diff --git a/templates/definition/vehicle/vw.yaml b/templates/definition/vehicle/vw.yaml index 382cb8e163..58f5c1b378 100644 --- a/templates/definition/vehicle/vw.yaml +++ b/templates/definition/vehicle/vw.yaml @@ -10,7 +10,6 @@ requirements: en: e-Golf, e-Up, ID family params: - preset: vehicle-base - - preset: vehicle-identify - name: vin example: WVWZZZ... - name: timeout @@ -18,5 +17,4 @@ params: render: | type: vw {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} timeout: {{ .timeout }} diff --git a/templates/definition/vehicle/zero.yaml b/templates/definition/vehicle/zero.yaml index e608386643..ebdbc93382 100644 --- a/templates/definition/vehicle/zero.yaml +++ b/templates/definition/vehicle/zero.yaml @@ -3,8 +3,6 @@ products: - brand: Zero Motorcycles params: - preset: vehicle-base - - preset: vehicle-identify render: | type: zero {{ include "vehicle-base" . }} - {{ include "vehicle-identify" . }} diff --git a/util/templates/defaults.yaml b/util/templates/defaults.yaml index 9226fae66b..52f6c45ede 100644 --- a/util/templates/defaults.yaml +++ b/util/templates/defaults.yaml @@ -297,24 +297,42 @@ params: presets: vehicle-base: params: - - name: title - - name: icon - default: car - advanced: true - name: user required: true - name: password required: true - name: vin + - name: title + - name: icon + default: car + advanced: true - name: capacity - name: phases advanced: true + - name: mode + advanced: true + - name: minCurrent + advanced: true + - name: maxCurrent + advanced: true + - name: identifiers + advanced: true + type: stringlist + - name: priority + advanced: true - name: cache default: 15m advanced: true type: duration - vehicle-identify: + vehicle-common: params: + - name: title + - name: icon + default: car + advanced: true + - name: capacity + - name: phases + advanced: true - name: mode advanced: true - name: minCurrent @@ -326,6 +344,12 @@ presets: type: stringlist - name: priority advanced: true + vehicle-features: + params: + - name: coarsecurrent + advanced: true + - name: welcomecharge + advanced: true vehicle-language: params: - name: language diff --git a/util/templates/includes/vehicle-base.tpl b/util/templates/includes/vehicle-base.tpl index 4713136040..45e98fd21c 100644 --- a/util/templates/includes/vehicle-base.tpl +++ b/util/templates/includes/vehicle-base.tpl @@ -3,4 +3,7 @@ user: {{ .user }} password: {{ .password }} vin: {{ .vin }} {{ template "vehicle-common" . }} +{{- if .cache }} +cache: {{ .cache }} +{{- end }} {{- end }} diff --git a/util/templates/includes/vehicle-common.tpl b/util/templates/includes/vehicle-common.tpl index 01cc4fd644..6212c8596f 100644 --- a/util/templates/includes/vehicle-common.tpl +++ b/util/templates/includes/vehicle-common.tpl @@ -11,7 +11,28 @@ capacity: {{ .capacity }} {{- if .phases }} phases: {{ .phases }} {{- end }} -{{- if .cache }} -cache: {{ .cache }} + +{{- if or .mode .minCurrent .maxCurrent .priority }} +onIdentify: +{{- if .mode }} + mode: {{ .mode }} {{- end }} +{{- if .minCurrent }} + minCurrent: {{ .minCurrent }} +{{- end }} +{{- if .maxCurrent }} + maxCurrent: {{ .maxCurrent }} +{{- end }} +{{- if .priority }} + priority: {{ .priority }} +{{- end }} +{{- end }} + +{{- if len .identifiers }} +identifiers: +{{- range .identifiers }} +- {{ . }} +{{- end }} +{{- end }} + {{- end }} diff --git a/util/templates/includes/vehicle-features.tpl b/util/templates/includes/vehicle-features.tpl new file mode 100644 index 0000000000..5f37f906f4 --- /dev/null +++ b/util/templates/includes/vehicle-features.tpl @@ -0,0 +1,11 @@ +{{ define "vehicle-features" }} +{{- if or (eq .coarsecurrent "true") (eq .welcomecharge "true") }} +features: +{{- if eq .coarsecurrent "true" }} +- coarsecurrent +{{- end }} +{{- if eq .welcomecharge "true" }} +- welcomecharge +{{- end }} +{{- end }} +{{- end }} diff --git a/util/templates/includes/vehicle-identify.tpl b/util/templates/includes/vehicle-identify.tpl deleted file mode 100644 index 41a7bfab82..0000000000 --- a/util/templates/includes/vehicle-identify.tpl +++ /dev/null @@ -1,23 +0,0 @@ -{{ define "vehicle-identify" }} -{{- if or .mode .minCurrent .maxCurrent .priority }} -onIdentify: -{{- if .mode }} - mode: {{ .mode }} -{{- end }} -{{- if .minCurrent }} - minCurrent: {{ .minCurrent }} -{{- end }} -{{- if .maxCurrent }} - maxCurrent: {{ .maxCurrent }} -{{- end }} -{{- if .priority }} - priority: {{ .priority }} -{{- end }} -{{- end }} -{{- if len .identifiers }} -identifiers: -{{- range .identifiers }} -- {{ . }} -{{- end }} -{{- end }} -{{- end }}