Created
May 9, 2023 11:08
-
-
Save spinogrizz/2bd73835bc34b5b614a0531f488d77d5 to your computer and use it in GitHub Desktop.
This is a HA integration to altesla.app API, so you could retrieve a Tesla car metrics and show them inside your dashboard
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
rest: | |
- authentication: basic | |
scan_interval: 45 | |
resource: https://api.altesla.app/metrics | |
username: !secret altesla_vincode | |
password: !secret altesla_hashed_password | |
sensor: | |
- name: Tesla Model 3 | |
unique_id: 359a56b7b3f0 | |
json_attributes_path: "$.car" | |
json_attributes: | |
- lat | |
- lon | |
value_template: > | |
{% if value_json.battery.isCharging %} | |
charging | |
{% elif value_json.car.speed > 1 %} | |
driving | |
{% else %} | |
idle | |
{% endif %} | |
- name: Tesla Battery Level | |
unique_id: f23c7e62a1c1 | |
icon: mdi:battery | |
value_template: "{{ value_json.battery.batteryLevel }}" | |
unit_of_measurement: '%' | |
state_class: measurement | |
device_class: battery | |
json_attributes_path: "$.battery" | |
json_attributes: | |
- factoryEnergy | |
- nominalEnergy | |
- name: Tesla Inside Temperature | |
unique_id: 6c9d8f470b38 | |
icon: mdi:thermometer | |
value_template: "{{ value_json.climate.insideTemp }}" | |
unit_of_measurement: '°C' | |
state_class: measurement | |
device_class: temperature | |
- name: Tesla Charging Stats | |
unique_id: d0e1f2c3b4a5 | |
icon: mdi:flash | |
value_template: "{{ value_json.charging.stats.total }}" | |
unit_of_measurement: 'kWh' | |
state_class: total_increasing | |
device_class: energy | |
json_attributes_path: "$.charging.stats" | |
json_attributes: | |
- ac | |
- dc | |
- regen | |
- name: Tesla Odometer | |
unique_id: 8a7b6c5d4e3f | |
icon: mdi:counter | |
value_template: "{{ value_json.car.odometer }}" | |
unit_of_measurement: 'km' | |
state_class: total_increasing | |
- name: Tesla Speed | |
unique_id: a9b8c7d6e5f4 | |
icon: mdi:speedometer | |
value_template: "{{ value_json.car.speed }}" | |
unit_of_measurement: 'km/h' | |
state_class: measurement | |
binary_sensor: | |
- name: Tesla Locked | |
device_class: lock | |
unique_id: 5f4e3d2c1b0a | |
icon: mdi:car-door-lock | |
value_template: "{{ not value_json.car.locked }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment