From c5a776b20309bce79145ec3e5fcd0d790a6c9431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E6=B1=82=E5=9C=A3=E5=89=91?= Date: Tue, 25 Nov 2025 14:26:55 +0800 Subject: [PATCH] refactor: add new EPS sensors and update mappings in JackeryHome - Introduced new sensors for EPS power, export energy, and import energy with appropriate configurations. - Updated the meter serial number mappings to include the new EPS sensors for improved data accuracy. --- custom_components/JackeryHome/sensor.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/custom_components/JackeryHome/sensor.py b/custom_components/JackeryHome/sensor.py index 0063f1c..a81fd31 100644 --- a/custom_components/JackeryHome/sensor.py +++ b/custom_components/JackeryHome/sensor.py @@ -28,7 +28,9 @@ REQUEST_INTERVAL = 5 # 数据请求间隔(秒) METER_SN_MAP = { "battery_soc": "21548033", "solar_energy": "16961537", - "home_energy": "16962561", + "eps_export_energy": "16998401", + "eps_import_energy": "16963585", + "eps_power": "16933889", "grid_import_energy": "16962561", "grid_export_energy": "16968705", "battery_charge_energy": "16964609", @@ -43,6 +45,27 @@ METER_SN_MAP = { # 传感器配置 SENSORS = { + "eps_power": { + "name": "EPS Power", + "unit": UnitOfPower.WATT, + "icon": "mdi:home-lightning-bolt", + "device_class": SensorDeviceClass.POWER, + "state_class": SensorStateClass.MEASUREMENT, + }, + "eps_export_energy": { + "name": "EPS Export Energy", + "unit": UnitOfEnergy.KILO_WATT_HOUR, + "icon": "mdi:home-lightning-bolt", + "device_class": SensorDeviceClass.ENERGY, + "state_class": SensorStateClass.TOTAL_INCREASING, + }, + "eps_import_energy": { + "name": "EPS Import Energy", + "unit": UnitOfEnergy.KILO_WATT_HOUR, + "icon": "mdi:home-lightning-bolt", + "device_class": SensorDeviceClass.ENERGY, + "state_class": SensorStateClass.TOTAL_INCREASING, + }, # 功率传感器(实时监测) "solar_power": { "name": "Solar Power",