Bonjour,
Je viens d’écrire un article sur le portail HACF sur l’intégration de véhicules Tesla avec quelques exemples que je trouve utiles. Je tenterai d’y ajouter les évolutions de configuration avec les dernières version d’API.
Si vous avez des trucs et astuces à ajouter n’hésitez pas à en faire part ci-dessous.
4 « J'aime »
Je partage ma page si vous voulez (la carte localisation a été changé):
Pour info, j’ai une Tesla, une clio etech, un Tesla Wall (Je peux charger jusqu’a 32A - utile la nuit en Jour Bleu, je peux recharger entièrement ma voiture a 13cts/kWh), et un compteur ShellyEM pour mesurer la conso de mon Tesla Wall (Meme si celui ci le fait egalement)
1er bloc:
type: vertical-stack
cards:
- type: picture-elements
image: /local/model3bis2.jpg
elements:
- type: state-icon
entity: button.force_data_update
style:
top: 6.5%
left: 18%
'--paper-item-icon-color': hsl(213, 71%, 60%)
tap_action:
action: call-service
service: button.press
service_data: {}
target:
entity_id: button.force_data_update
double_tap_action: none
hold_action: none
- type: state-icon
entity: button.wake_up
style:
top: 6.5%
left: 10%
'--paper-item-icon-color': hsl(213, 71%, 60%)
tap_action:
action: call-service
service: button.press
service_data: {}
target:
entity_id: button.wake_up
double_tap_action: none
hold_action: none
- type: state-label
entity: button.force_data_update
tap_action:
action: call-service
service: button.press
service_data: {}
target:
entity_id: button.force_data_update
double_tap_action: none
hold_action: none
style:
top: 95%
left: 51%
font-size: 90%
font-weight: normal
color: rgb(0,0,0)
prefix: 'Last update: '
- type: state-label
entity: device_tracker.location_tracker
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 7%
left: 92%
font-size: 100%
font-weight: normal
color: black
- type: state-icon
entity: binary_sensor.online
tap_action: none
hold_action: none
style:
top: 6.5%
left: 81%
- type: conditional
conditions:
- entity: switch.sentry_mode
state: 'on'
elements:
- type: icon
icon: mdi:shield-car
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 7%
left: 74%
color: black
- type: conditional
conditions:
- entity: switch.sentry_mode
state_not: 'on'
elements:
- type: icon
icon: mdi:shield-alert-outline
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 7%
left: 74%
color: red
- type: conditional
conditions:
- entity: lock.doors
state: locked
elements:
- type: icon
icon: mdi:lock
tap_action: toggle
double_tap_action: none
hold_action: none
style:
top: 7%
left: 66.5%
color: black
- type: conditional
conditions:
- entity: lock.doors
state_not: locked
elements:
- type: icon
icon: mdi:lock-open-variant
tap_action: toggle
double_tap_action: none
hold_action: none
style:
top: 7%
left: 66.5%
color: '#039be5'
- type: conditional
conditions:
- entity: update.software_update
state_not: 'on'
elements:
- type: icon
icon: mdi:upload-off
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 7%
left: 59%
color: black
- type: conditional
conditions:
- entity: update.software_update
state: 'on'
elements:
- type: icon
icon: mdi:upload
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 7%
left: 59%
color: '#039be5'
- type: conditional
conditions:
- entity: climate.hvac_climate_system
state: 'off'
elements:
- type: icon
icon: mdi:fan-off
tap_action:
action: call-service
service: climate.turn_on
data: {}
target:
entity_id: climate.hvac_climate_system
double_tap_action:
action: call-service
service: more-info
data: {}
target:
entity_id: climate.hvac_climate_system
hold_action: none
style:
top: 7%
left: 52%
color: black
- type: conditional
conditions:
- entity: climate.hvac_climate_system
state: heat_cool
elements:
- type: icon
icon: mdi:air-conditioner
tap_action:
action: call-service
service: climate.turn_off
data: {}
target:
entity_id: climate.hvac_climate_system
double_tap_action:
action: call-service
service: more-info
data: {}
target:
entity_id: climate.hvac_climate_system
hold_action: none
style:
top: 7%
left: 52%
color: '#039be5'
- type: state-label
entity: sensor.tpms_front_left
tap_action: more-info
double_tap_action: none
hold_action: none
style:
top: 25%
left: 77%
font-size: 80%
font-weight: normal
color: grey
- type: state-label
entity: sensor.tpms_front_right
tap_action: more-info
double_tap_action: none
hold_action: none
style:
top: 75%
left: 77%
font-size: 80%
font-weight: normal
color: grey
- type: state-label
entity: sensor.tpms_rear_left
tap_action: more-info
double_tap_action: none
hold_action: none
style:
top: 25%
left: 27%
font-size: 80%
font-weight: normal
color: grey
- type: state-label
entity: sensor.tpms_rear_right
tap_action: more-info
double_tap_action: none
hold_action: none
style:
top: 75%
left: 27%
font-size: 80%
font-weight: normal
color: grey
- type: state-label
entity: binary_sensor.doors
attribute: Driver Rear
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 23%
left: 40%
color: black
- type: state-label
entity: binary_sensor.doors
attribute: Driver Front
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 23%
left: 53%
color: black
- type: state-label
entity: binary_sensor.doors
attribute: Passenger Rear
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 76%
left: 40%
color: black
- type: state-label
entity: binary_sensor.doors
attribute: Passenger Front
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 76%
left: 53%
color: black
- type: state-icon
entity: cover.frunk
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 50%
left: 82%
'--paper-item-icon-color': hsl(213, 71%, 60%)
- type: state-icon
entity: cover.trunk
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 50%
left: 18%
'--paper-item-icon-color': hsl(213, 71%, 60%)
- type: conditional
conditions:
- entity: cover.charger_door
state: open
elements:
- type: icon
icon: mdi:ev-plug-tesla
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 26%
left: 18%
color: '#039be5'
- type: conditional
conditions:
- entity: cover.charger_door
state_not: open
elements:
- type: icon
icon: mdi:ev-plug-tesla
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 26%
left: 18%
color: black
- type: conditional
conditions:
- entity: binary_sensor.charger
state: 'on'
elements:
- type: state-label
entity: sensor.wall_connector_power_watt
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 26%
left: 9%
font-size: 100%
font-weight: normal
color: '#039be5'
- type: conditional
conditions:
- entity: binary_sensor.charger
state: 'on'
elements:
- type: state-label
entity: binary_sensor.tesla_wall_connector_contactor_closed
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 19%
left: 17%
font-size: 100%
font-weight: normal
color: '#039be5'
- type: state-label
entity: sensor.temperature_inside
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 50%
left: 46%
font-size: 100%
font-weight: normal
color: rgb(255,255,255)
- type: icon
icon: mdi:thermometer
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 50%
left: 38%
font-size: 100%
font-weight: normal
color: rgb(255,255,255)
- type: state-label
entity: sensor.temperature_outside
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 20%
left: 93%
font-size: 90%
font-weight: normal
color: rgb(0,0,0)
- type: icon
icon: mdi:thermometer
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 20%
left: 86%
font-size: 90%
font-weight: normal
color: rgb(0,0,0)
- type: conditional
conditions:
- entity: binary_sensor.charging
state: 'on'
- entity: device_tracker.location_tracker
state: home
elements:
- type: icon
icon: mdi:home-lightning-bolt-outline
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 85.7%
left: 35%
color: green
- type: conditional
conditions:
- entity: binary_sensor.charging
state: 'on'
- entity: device_tracker.location_tracker
state_not: home
elements:
- type: icon
icon: mdi:ev-station
tap_action: none
double_tap_action: none
hold_action: none
style:
top: 85.7%
left: 35%
color: green
- type: custom:bar-card
entity: sensor.battery_2
severity:
- color: Red
from: 0
to: 10
- color: Orange
from: 11
to: 20
- color: '#21b44a'
from: 21
to: 100
entity_row: true
positions:
icon: 'off'
name: 'off'
indicator: 'off'
animation:
state: 'on'
speed: 5
width: 170px
height: 25px
tap_action: none
hold_action: none
double_tap_action: none
stack: vertical
style:
top: 86%
left: 26%
font-size: 90%
font-weight: bold
color: white
- type: custom:bar-card
entity: sensor.range
max: '437'
name: Autonomie
entity_row: true
positions:
icon: 'off'
name: 'off'
indicator: 'off'
animation:
state: 'on'
speed: 5
decimal: '0'
width: 170px
height: 25px
tap_action: none
hold_action: none
double_tap_action: none
stack: vertical
style:
top: 86%
left: 74%
font-size: 90%
font-weight: bold
color: white
- type: map
entities:
- entity: device_tracker.location_tracker
- entity: device_tracker.clio_emplacement
aspect_ratio: '1.5'
- type: entities
entities:
- entity: device_tracker.clio_emplacement
- entity: sensor.clio_derniere_activite_de_localisation
- entity: sensor.clio_autonomie_en_carburant
- entity: sensor.clio_quantite_de_carburant
- entity: sensor.clio_kilometrage
card_mod:
style:
.: |
#states > * {
margin: -16px 0px !important;
--mdc-icon-size: 20px;
}
2nd bloc:
type: vertical-stack
cards:
- type: entities
entities:
- entity: binary_sensor.online
name: Voiture en ligne
icon: mdi:car-connected
secondary_info: last-changed
card_mod:
style:
hui-generic-entity-row:
$: |
.secondary {
margin: -4px 0px 0px 0px;
font-size: 11px;
line-height: initial;
}
- entity: sensor.latestla_data_last_update_time
- entity: button.wake_up
- entity: button.force_data_update
- entity: switch.polling
- entity: switch.sentry_mode
- entity: cover.windows
name: Fenêtres
- entity: cover.frunk
name: Frunk
- entity: cover.trunk
name: Coffre
state_color: true
show_header_toggle: false
card_mod:
style:
.: |
#states > * {
margin: -16px 0px !important;
font-size: 14px;
--mdc-icon-size: 20px;
}
- type: horizontal-stack
cards:
- type: picture-elements
style: |
@keyframes blink {
0% {background-color: pink;}
20% {background-color: black;}
}
elements:
- type: state-badge
entity: device_tracker.location_tracker
title: null
style:
top: 87%
left: 17%
- type: conditional
conditions:
- entity: lock.charge_port_latch
state: unlocked
- entity: binary_sensor.charger
state: 'off'
elements:
- type: image
image: /local/PlugOff.jpg
style:
top: 50%
left: 50%
height: 100%
width: 100%
- type: conditional
conditions:
- entity: binary_sensor.charger
state: 'on'
elements:
- type: image
image: /local/PlugOn.jpg
style:
top: 50%
left: 50%
height: 100%
width: 100%
- type: conditional
conditions:
- entity: switch.charger
state: 'on'
elements:
- type: state-icon
entity: switch.charger
icon: mdi:flash
state_color: false
style:
top: 60%
left: 31%
'--paper-item-icon-color': hsl(100, 87%, 54%)
transform: translate(-50%,-50%) scale(2,2)
- type: state-label
entity: sensor.charger_power
tap_action:
action: toggle
style:
top: 90%
left: 25%
color: black
image: /local/PlugClosed.jpg
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: switch.charger
show_state: true
name: Chargeur
icon: mdi:ev-station
- type: entities
entities:
- entity: binary_sensor.charger
name: Prise branchée ?
- entity: binary_sensor.charging
name: Voiture en charge ?
- entity: binary_sensor.tesla_wall_connector_contactor_closed
name: Wall connector port
- entity: lock.charge_port_latch
name: Port charge
- entity: switch.charger
name: Recharge
- entity: sensor.charger_power
name: Puissance Tesla
- entity: sensor.wall_connector_power_watt
name: Puissance Wall Connector
- entity: sensor.time_charge_complete
name: Charge complète
- entity: number.charging_amps
icon: mdi:lightning-bolt
name: Ampère charge
- entity: number.charge_limit
name: Recharge Limite
- entity: sensor.tesla_wall_connector_phase_a_current
name: Wall Ampere
- entity: sensor.tesla_wall_connector_phase_a_voltage
name: Wall Volt
- entity: sensor.energy_added
name: Dernière recharge
state_color: true
show_header_toggle: false
card_mod:
style:
.: |
#states > * {
margin: -16px 0px !important;
--mdc-icon-size: 20px;
}
3eme bloc:
type: vertical-stack
cards:
- type: custom:simple-thermostat
entity: climate.hvac_climate_system
layout:
mode:
names: true
headings: false
icons: true
step: row
header: false
card_mod:
style: |
ha-card {
--st-font-size-xl: 20px;
--st-font-size-m: 12px;
--st-font-size-title: 20px;
--st-font-size-sensors: 15px;
--st-spacing: 1px;
}
ha-card .current--value {
margin: 0px -5px;
}
control:
hvac:
'off': true
heat_cool:
name: Climatisation
icon: mdi:sun-snowflake
preset:
normal:
name: Normal
icon: mdi:waves
defrost:
name: Dégivrage
icon: mdi:snowflake
- type: history-graph
entities:
- entity: sensor.temperature_inside
name: °C Intérieure
- entity: sensor.temperature_outside
name: °C Extérieure
- type: history-graph
entities:
- entity: sensor.battery_2
name: Batterie
hours_to_show: 168
3 « J'aime »
J’aime le fait de voir la photo de ma voiture et de mon garage dans ton dashboard
1 « J'aime »
Excellent, j’ai du le reprendre d’un de tes post
Bonjour pour ma part j’avais calculé le rechargement à domicile ainsi :
sensor:
- unique_id: tesla_model_y_home_charge_energy
name: "Recharge Tesla Model Y Maison"
unit_of_measurement: 'kWh'
device_class: 'energy'
state_class: 'total_increasing'
state: >
{% if is_state('binary_sensor.tesla_model_y_charging_at_home', 'on') %}
{{ states('sensor.model_y_energy_added') | float }}
{% else %}
0
{% endif %}
binary_sensor:
- unique_id: tesla_model_y_charging_at_home
name: "Tesla Model Y - Rechargement domicile"
state: >
{% if is_state('device_tracker.model_y_location_tracker', 'home') and
is_state('binary_sensor.model_y_charging', 'on') %}
true
{% else %}
false
{% endif %}
1 « J'aime »
J’essaye de mettre en place l’automatisation sur la pression des pneus et je constate que la pression remonte en psi chez moi. Y a-t-il une option sur le plugin ou avez-vous créer un autre sensor en effectuant une conversion ?
Pas besoin de créer une entité pour ça!
Tu vas dans l’entité, puis les options (roue dentée en haut de la boite, et là tu peux choisir l’unité de mesure. La conversion est automatique.
1 « J'aime »
Merci
J’en profite pour vous partager ce widget que j’ai intégré chez moi :
homeassistant-fe-tesla
Ce qui donne chez moi ce tableau de bord simple :
1 « J'aime »
Cool cette carte. Elle mériterait d’être rajoutée dans l’article.
Merci pour ton code. Je n’arrive pas à ajouter le sensor tesla_model_y_home_charge_energy dans le tableau énergie. As-tu ajouté quelque chose ?
non, je n’ai que ces 2 sensors :
- Tesla Model Y - Recharge Domicile est un booleen qui permet de savoir si le véhicule est en recharge à la maison et s’appuie sur les entités créées par l’intégration tesla
- Recharge Tesla Model Y Maison permet de recenser l’énergie ajoutée au véhicule uniquement à la maison (en testant le boolean créé juste avant), et s’appuie également sur l’intégration tesla
quelle est ton erreur ?
tu as bien remplacé les model_y par le nom de ton véhicule dans home assistant ?
J’ai pas d’erreur et le sensor retourne bien la bonne valeur mais je ne peux pas le sélectionner/ajouter sur le tableau de bord Énergie.
1 « J'aime »
Je pensais n’avoir rien fais d’autre.
J’appelle pourtant bien le sensor directement depuis le panneau.
Voici ce que j’ai de mon côté si ça aide :
Hello,
j’avais eu pas mal de mauvaises valeurs dans le tableau de bord énergie quand j’utilisais directement cette entité « energy_added » ça vient je pense du faire qu’elle se réinitialise à chaque charge et si on plus on dit à HA que c’est un total increasing, ça le rend un peu contradictoire et les valeurs enregistrées peuvent être faussées quand on charge 2 nuits de suite par exemple.
Merci pour l’info je vais regarder de plus près.
J’ai fais un test aujourd’hui :
- energy added est bien reset à 0 entre les deux charges
- la somme des deux recharges correspond bien à ce que j’ai dans le tableau de bord energy
- je surveillerai dans le doute mais pour l’instant RAS
Je bloque à la dernière étape de l’installation « Now, you can add the yaml file to your dashboard. I found it best to create a hidden dashboard and add any card to it. From there you can edit the card, click the show code editor button in the bottom corner and paste it all in. »
Que dois-je faire ?
bonjour j’ai aussi un problème l’intégration et bien installer mais je ne trouve pas comment mettre le widget