本帖最后由 natic 于 2020-1-2 09:33 编辑
特斯拉接入HA非常简单, configuration.yaml加入以下配置重启即可
username 你的特斯拉账号邮箱
password 账号密码
scan_interval 刷新时间,注意不能设置的太短,掉电飞快
tesla:
username: YOUR_EMAIL_ADDRESS
password: YOUR_PASSWORD
scan_interval: 3600
为了让界面看起来更加个性化,我们可以利用lovelace自定义,以我的界面做个示范
自定义界面由4个子模块组成,图片+里程表、主要传感器状态、当前续航、续航曲线图
添加方法也很简单,在lovelace界面单机右上角…,选择Configure UI,点击右下角加号
点击SHOW CODE EDITOR
替换配置代码,点击SAVE保存
Picture Entity
aspect_ratio: 50%
entity: sensor.tesla_model_3_mileage_sensor
image: >-
https://static-assets.tesla.cn/v1/compositor/?model=m3&view=STUD_3QTR&size=1440&options=DV2W,IN3BB,COL2-PMNG,W38B,MT301&bkba_opt=1&context=design_studio_2
name: Tesla Mileage
type: picture-entity
Glance
columns: 5
entities:
- entity: sensor.tesla_model_3_range_sensor
- entity: sensor.tesla_model_3_temperature_sensor_inside
- entity: sensor.tesla_model_3_temperature_sensor_outside
- entity: climate.tesla_model_3_hvac_climate_system
- entity: binary_sensor.tesla_model_3_charger_sensor
type: glance
Gauge
entity: sensor.tesla_model_3_battery_sensor
max: 100
min: 0
name: Model 3 Battery
theme: default
type: gauge
Sensor
entity: sensor.tesla_model_3_battery_sensor
graph: line
type: sensor
|