Home Assistant 中文文档 下载 App

EV 充电桩监控与智能调度

为什么要监控 EV 充电

充电桩是家庭里第二大耗电设备(仅次于空调和冰箱)。一辆 Model 3 从 0 充到 100% 大概需要 75kWh——按每度电 0.8 元算就是 60 块。有了 Home Assistant 充电监控,你可以:

主流充电桩接入

原厂集成

品牌Home Assistant 集成说明
Teslatesla_custom同时支持 Powerwall + Solar + 车辆充电
比亚迪Modbus TCP秦/汉/唐等比亚迪车型支持
小鹏HACS 社区集成G3i、P7 等
蔚来HACS 社区集成EC6/ES6/ET5

国标充电桩

国内绝大多数充电桩(特来电、星星、国网等)是国标 GB/T 27930 协议:

DIY:用智能插座 / 互感器 + WiFi

最简单、最通用的方案:

方案 A:智能插座

  1. 充电桩接一个支持 Home Assistant 的智能插座(SONOFF S40、TP-Link Kasa 等)
  2. 智能插座接入 Home Assistant → 自动创建 switch.xxx + sensor.xxx_power + sensor.xxx_energy
  3. Home Assistant 可以远程开关充电,也能读到实时功率

方案 B:电流互感器

  1. 在充电桩进线处套一个 SCT-013 电流互感器
  2. ESPHome 读取 → Home Assistant 拿到功率和电量数据
  3. 比智能插座精度更高,适合充电桩的大电流场景

Home Assistant Energy Dashboard 里配置 EV

Settings → System → Energy → EV charging

Current power: sensor.ev_charger_power
Total energy consumption: sensor.ev_charger_energy
Vehicles: 你的电动车名称

配好后 Energy Dashboard 会单独展示 EV 充电用了多少电、占总耗电的百分比。

智能充电自动化

场景一:谷价自动开始充电

alias: 谷价自动开始充电
trigger:
  - platform: state
    entity_id: sensor.electricity_tariff
    to: "low"
condition:
  - condition: state
    entity_id: switch.ev_charger
    state: "off"
  - condition: numeric_state
    entity_id: sensor.ev_battery_level
    below: 80
action:
  - service: switch.turn_on
    target:
      entity_id: switch.ev_charger
  - service: notify.mobile_app_me
    data:
      title: "自动开始充电"
      message: >
        当前谷电价,开始给电动车充电
        当前电量:{{ states('sensor.ev_battery_level') }}%

场景二:太阳能盈余时自动充

alias: 太阳能盈余给电动车充电
trigger:
  - platform: numeric_state
    entity_id: sensor.solar_production
    above: sensor.home_consumption
    for:
      minutes: 10
condition:
  - condition: state
    entity_id: switch.ev_charger
    state: "off"
  - condition: numeric_state
    entity_id: sensor.ev_battery_level
    below: 85
action:
  - service: switch.turn_on
    target:
      entity_id: switch.ev_charger
  - service: notify.mobile_app_me
    data:
      title: "太阳能充电中"
      message: >
        用太阳能盈余给车充电
        当前电量:{{ states('sensor.ev_battery_level') }}%

场景三:充到指定量自动停

alias: 充满自动断电
trigger:
  - platform: numeric_state
    entity_id: sensor.ev_battery_level
    above: 80
action:
  - service: switch.turn_off
    target:
      entity_id: switch.ev_charger
  - service: notify.mobile_app_me
    data:
      title: "充电完成"
      message: >
        电动车已充到 {{ states('sensor.ev_battery_level') }}%
        花费:{{ states('sensor.ev_charge_cost') }} 元

场景四:回家自动开始充

alias: 回家自动开始充电
trigger:
  - platform: zone
    entity_id: person.me
    zone: zone.home
    event: enter
condition:
  - condition: numeric_state
    entity_id: sensor.ev_battery_level
    below: 60
  - condition: time
    before: "22:00:00"
action:
  - service: switch.turn_on
    target:
      entity_id: switch.ev_charger
  - service: notify.mobile_app_me
    data:
      title: "回家了"
      message: "电动车电量不足 60%,开始充电"

特斯拉车主特别提示

tesla_custom 集成可以直接读取 Tesla 车辆的实时数据(位置、电量、充电状态、能耗等):

实体含义
sensor.battery当前电量百分比
sensor.charge_statecharging / disconnected / complete
sensor.charge_rate充电速度(km/h)
sensor.time_to_full_charge充满还需多少小时
sensor.energy_used本次充电已用多少 kWh

Tesla 集成的优势是能读到实时车端数据,而不是只靠墙插的电流数据。

安全提示