It can be done on several ways. My way was to make a sensor for each attribute.
Json response is in German, I translated some to Dutch.
Make a new folder in Home Assistant named :
REST
Add this line in configuration.yaml :
rest: !include_dir_merge_list REST/
Create in folder ‘REST’ a file with a recognizable name for the charge station, like :
rest_pietjepukstraat_1_bogusstad.yaml
Add the following to secret.yaml :
enwb_subscription_key: "d4954e8b2e444fc89a89a463788c0a72"
enwb_origin: "https://www.enbw.com"
enwb_referer: "https://www.enbw.com/"
enwb_api_uri_**vervang_voor_naam_adres**: LINK TO CHARGE STATION
Subscription key, origin and referer are always the same.
For multiple charge stations, add multiple .yaml-files in the folder ‘REST’ and don’t forget to add additional ‘enwb_api_uri_vervang_voor_naam_adres’ in secret.yaml file.
Then fill up the files with the right information, change the lines with ** :
- scan_interval: 60
resource: !secret enwb_api_uri_**vervang_voor_naam_adres**
headers:
User-Agent: "Home Assistant"
Ocp-Apim-Subscription-Key: !secret enwb_subscription_key
Origin: !secret enwb_origin
Referer: !secret enwb_referer
sensor:
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Status"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).status|replace('_',' ')|lower|replace('occupied','❌')|replace('available','🅿️')|replace('out of service','❌')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_status"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Connectors-Max Power In Kw"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).connectors | first).maxPowerInKw|int }}"
unit_of_measurement: "kWh"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_connectors_maxpowerinkw"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Connectors-Charge Plug Type Group"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).connectors | first).chargePlugTypeGroup|replace('_',' ')|lower|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_connectors_chargeplugtypegroup"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Connectors-Plug Type Name"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).connectors | first).plugTypeName|lower|replace('typ 2','type 2')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_connectors_plugtypename"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Connectors-Cable Attached"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).connectors | first).cableAttached|lower|replace('true','ja')|replace('false','nee')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_connectors_cableattached"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Station Number"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).stationNumber }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Charge Point Number"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).chargePointNumber }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Charge Point Label"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).chargePointLabel }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Handicapped Accessible"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).handicappedAccessible }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Connectors-Tariff Info-Tariff Group"
value_template: "{{ (((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).connectors | first).tariffInfo | first).tariffGroup }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_connectors_tariffinfo_tariffgroup"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Connectors-Tariff Info-Tariff Description"
value_template: "{{ (((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).connectors | first).tariffInfo | first).tariffDescription }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_connectors_tariffinfo_tariffdescription"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal links, Connectors-Tariff Info-Tariff Payment Text"
value_template: "{{ (((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER1**') | first).connectors | first).tariffInfo | first).paymentText }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_links_connectors_tariffinfo_paymenttext"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Status"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).status|replace('_',' ')|lower|replace('occupied','❌')|replace('available','🅿️')|replace('out of service','❌')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_status"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Connectors-Max Power In Kw"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).connectors | first).maxPowerInKw|int }}"
unit_of_measurement: "kWh"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_connectors_maxpowerinkw"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Connectors-Charge Plug Type Group"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).connectors | first).chargePlugTypeGroup|replace('_',' ')|lower|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_connectors_chargeplugtypegroup"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Connectors-Plug Type Name"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).connectors | first).plugTypeName|lower|replace('typ 2','type 2')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_connectors_plugtypename"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Connectors-Cable Attached"
value_template: "{{ ((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).connectors | first).cableAttached|lower|replace('true','ja')|replace('false','nee')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_connectors_cableattached"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Station Number"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).stationNumber }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Charge Point Number"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).chargePointNumber }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Charge Point Label"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).chargePointLabel }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Handicapped Accessible"
value_template: "{{ (value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).handicappedAccessible }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Connectors-Tariff Info-Tariff Group"
value_template: "{{ (((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).connectors | first).tariffInfo | first).tariffGroup }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_connectors_tariffinfo_tariffgroup"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Connectors-Tariff Info-Tariff Description"
value_template: "{{ (((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).connectors | first).tariffInfo | first).tariffDescription }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_connectors_tariffinfo_tariffdescription"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, laadpaal rechts, Connectors-Tariff Info-Tariff Payment Text"
value_template: "{{ (((value_json.chargePoints | selectattr('evseId','eq','**VERVANGVOORLAADPUNTNUMMER2**') | first).connectors | first).tariffInfo | first).paymentText }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_laadpaal_rechts_connectors_tariffinfo_paymenttext"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Operator"
value_template: "{{value_json.operator|replace('Niederlande','Nederland')}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_operator"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Operator Code"
value_template: "{{value_json.operatorCode}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_operatorCode"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Grouped"
value_template: "{{value_json.grouped|lower|replace('true','ja')|replace('false','nee')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_grouped"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Price Group"
value_template: "{{value_json.priceGroup|replace('_',' ')|lower|replace('default group','standaard groep')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_pricegroup"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Short Address"
value_template: "{{value_json.shortAddress}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_shortaddress"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Lattitude"
value_template: "{{value_json.lat}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_lattitude"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Longitude"
value_template: "{{value_json.lon}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_longitude"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Number Of Charge Points"
value_template: "{{value_json.numberOfChargePoints|int}}"
unit_of_measurement: ""
unique_id: "oplaadstation_**vervang_voor_naam_adres**_numberofchargepoints"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Unknown State Charge Points"
value_template: "{{value_json.unknownStateChargePoints}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_unknownstatechargepoints"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Station Id"
value_template: "{{value_json.stationId|int}}"
unit_of_measurement: ""
unique_id: "oplaadstation_**vervang_voor_naam_adres**_stationid"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Plug Types"
value_template: "{{value_json.plugTypes|join(', ')|replace('_',' ')|lower|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_plugtypes"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Favorite"
value_template: "{{value_json.favorite|lower|replace('true','ja')|replace('false','nee')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_favorite"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Always Open"
value_template: "{{value_json.alwaysOpen|lower|replace('true','ja')|replace('false','nee')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_alwaysopen"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Authentication Methods"
value_template: "{{value_json.authenticationMethods|join(', ')|replace('_',' ')|lower|replace('remote','vanaf afstand')|replace('others','anders')|replace('charge card','creditcard')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_authenticationmethods"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Hidden With Active Profile"
value_template: "{{value_json.hiddenWithActiveProfile|replace('None','Niet van toepassing')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_hiddenwithactiveprofile"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Station Summary"
value_template: "{{value_json.stationSummary|lower|replace('ladestation details','details oplaadstation')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_stationsummary"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Additional Info"
value_template: "{{value_json.additionalInfo|replace('Free publicly accessible','Openbaar laadstation')}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_additionalinfo"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Restrictions"
value_template: "{{value_json.restrictions|replace('None','Niet van toepassing')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_restrictions"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Opening Hours"
value_template: "{{value_json.openingHours|replace('None','Niet van toepassing')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_openinghours"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Tariff Informations"
value_template: "{{value_json.tariffInformations|first|replace('Die angezeigten Preise gelten unabhängig von den Betreiber-Informationen bei der Verwendung der App oder der Ladekarte von EnBW mobility+. Alle Preise inkl. gesetzlicher MwSt.','De weergegeven prijzen gelden ongeacht de operatorinformatie bij gebruik van de app of de EnBW Mobility+ laadpas. Alle prijzen zijn inclusief wettelijke BTW.')}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_tariffinformations"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Parking Fee Descriptions"
value_template: "{{value_json.parkingFeeDescriptions|lower|replace('*bitte unsere blockiergebühr beachten','')|replace('ab','per')|replace('pro minute','per minuut,')|replace('maximal:','met een maximum')|replace('bis','van')|replace('ac','AC')|replace('dc','DC') }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_parkingfeedescriptions"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** SupportInfo-Support HotLine"
value_template: "{{value_json.supportInfo.supportHotLine|replace('+31','0')}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_supportinfo-supporthotline"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Opening Times-Regular Hours"
value_template: "{{value_json.openingTimes.regularHours|replace('None','Niet van toepassing')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_openingtimes_regularhours"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Opening Times-Twenty Four Seven"
value_template: "{{value_json.openingTimes.twentyFourSeven|replace('None','Niet van toepassing')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_openingtimes_twentyfourseven"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Opening Times-Closed On Holidays"
value_template: "{{value_json.openingTimes.closedOnHolidays|replace('None','Niet van toepassing')|capitalize}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_openingtimes_closedonholidays"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Opening Times-Next Opening Time"
value_template: "{{value_json.openingTimes.nextOpeningTime|replace('None','Niet van toepassing')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_openingtimes_nextopeningtime"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Opening Times-Next Closing Time"
value_template: "{{value_json.openingTimes.nextClosingTime|replace('None','Niet van toepassing')|capitalize }}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_openingtimes_nextclosingtime"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** View Port-Lower Left Lattitude"
value_template: "{{value_json.viewPort.lowerLeftLat}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_viewport_lowerleftlattitude"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** View Port-Lower Left Longitude"
value_template: "{{value_json.viewPort.lowerLeftLon}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_viewport_lowerleftlongitude"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** View Port-Upper Right Lattitude"
value_template: "{{value_json.viewPort.upperRightLat}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_viewport_upperrightlattitude"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** View Port-Upper Right Longitude"
value_template: "{{value_json.viewPort.upperRightLon}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_viewport_upperrightlongitude"
- name: "Oplaadstation **VERVANGVOORADRESNAAM** Distance To My Position In KM"
value_template: "{{value_json.distanceToMyPositioninKm}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_distancetomypositioninkm"
- name: "Oplaadstation : **VERVANGVOORADRESNAAM**, vrije laadpalen"
value_template: "{{ value_json.availableChargePoints | int}}"
unique_id: "oplaadstation_**vervang_voor_naam_adres**_vrije_laadpalen"
unit_of_measurement: ""
Another handy little information… rate limit is about 666 milliseconds…
Calculated by multiple times ‘time / api_calls_till_authentication_failure’ (and vice versa).
Notice that you don’t create multiple rest calls with the same scan_interval.
If I had to do it, I would do it this way :
first charge station, scan_interval: 3
second charge station, scan_interval: 5
third charge station, scan_interval: 8
fourth charge station, scan_interval: 11
fifth charge station, scan_interval: 13
sixth charge station, scan_interval: 14
seventh charge station, scan_interval: 17
This way they don't interfere much with eachother...
3, 6, 9, 12, 15, 18, 21, 24, 27, 30,33,36,39,42,45,48,51,54,57,60,63,66,69,72...
5, 10, 15, 20, 25, 30, 35,40,45,50,55,60,65,70...
8, 16, 24, 32, 40, 48,56,64,72...
11, 22, 33, 44, 55,66,...
13, 26, 39, 52, 65...
14, 28, 42, 56, 70...
17, 34, 51, 68...
...
You can create wonderfull mapconfigurations with these sensors, I kept it simple and used the code someone posted in the previous post :
show_name: true
show_icon: false
show_state: true
type: glance
entities:
- entity: sensor.oplaadstation_**vervang_voor_naam_adres1**_laadpaal_links_status
name: **VERVANGVOORADRESNAAM1**, links
- entity: sensor.oplaadstation_**vervang_voor_naam_adres1**_laadpaal_rechts_status
name:** VERVANGVOORADRESNAAM1**, rechts
- entity: sensor.**vervang_voor_naam_adres2**_laadpaal_links_status
name: **VERVANGVOORADRESNAAM2**, links
- entity: sensor.**vervang_voor_naam_adres2**_laadpaal_rechts_status
name: **VERVANGVOORADRESNAAM2**, rechts
- entity: sensor.oplaadstation_**vervang_voor_naam_adres3**_laadpaal_links_status
name: **VERVANGVOORADRESNAAM3**, links
- entity: sensor.oplaadstation_**vervang_voor_naam_adres3**_rechts_status
name: **VERVANGVOORADRESNAAM3**, rechts
state_color: true
columns: 2