Created
January 15, 2023 05:53
-
-
Save sebestenyb/4fbc054a5037d4379d3c6465335590c6 to your computer and use it in GitHub Desktop.
Etrel Inch EV charger sensor config for Home Assistant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- platform: command_line | |
name: "Etrel Inch Login" | |
command: "curl 'http://nz-tg1-0015-01-1.lan/api/webOperatorLogin' --header 'Accept: application/json' --data-raw 'email={{ states.input_text.etrel_username.state }}&password={{ states.input_text.etrel_password.state }}' --silent" | |
value_template: "OK" | |
json_attributes: | |
- token | |
- errorCode | |
- errorMessage | |
- platform: rest | |
name: "Etrel Inch Api" | |
resource: "http://nz-tg1-0015-01-1.lan/api/generalStatus" | |
scan_interval: 10 | |
headers: | |
Content-Type: application/json | |
Authorization: "Bearer {{ state_attr( 'sensor.etrel_inch_login', 'token') }}" | |
json_attributes_path: "$.evses[0].connectors[0].onlineData" | |
value_template: "OK" | |
json_attributes: | |
- status | |
- mode | |
- phase1Current | |
- power | |
- consumedEnergy | |
- chargingDuration | |
- faultEventType | |
- faultEventDescription | |
- platform: template | |
sensors: | |
etrel_inch_status: | |
friendly_name: "Etrel Inch Status" | |
value_template: "{{ state_attr('sensor.etrel_inch_api', 'status') }}" | |
icon_template: "mdi:battery-unknown" | |
etrel_inch_mode: | |
friendly_name: "Etrel Inch Mode" | |
value_template: "{{ state_attr('sensor.etrel_inch_api', 'mode') }}" | |
icon_template: "mdi:run-fast" | |
etrel_inch_power: | |
friendly_name: "Etrel Inch Power" | |
value_template: "{{ state_attr('sensor.etrel_inch_api', 'power') | round(1, default=0) }}" | |
icon_template: "mdi:battery-charging" | |
unit_of_measurement: "kW" | |
etrel_inch_consumed_energy: | |
friendly_name: "Etrel Inch Consumed Energy" | |
value_template: "{{ state_attr( 'sensor.etrel_inch_api', 'consumedEnergy') | round(1, default=0) }}" | |
icon_template: "mdi:battery-charging-100" | |
unit_of_measurement: "kW" | |
etrel_inch_charging_duration: | |
friendly_name: "Etrel Inch Charging Duration" | |
value_template: "{{ state_attr('sensor.etrel_inch_api', 'chargingDuration') }}" | |
icon_template: "mdi:clock-time-eight" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment