From 00f493d06a8edffca121f275ffc953069042c59a Mon Sep 17 00:00:00 2001 From: sususweet Date: Sat, 22 Nov 2025 00:31:33 +0800 Subject: [PATCH] feat: add support for T0xE6 and T0xED. --- README.md | 1 + README_hans.md | 1 + .../midea_auto_cloud/device_mapping/T0xE6.py | 70 +++++++++++++++++++ .../midea_auto_cloud/device_mapping/T0xED.py | 27 +++++-- .../midea_auto_cloud/translations/en.json | 54 ++++++++++++++ .../translations/zh-Hans.json | 54 ++++++++++++++ 6 files changed, 202 insertions(+), 5 deletions(-) create mode 100644 custom_components/midea_auto_cloud/device_mapping/T0xE6.py diff --git a/README.md b/README.md index abc4036..1a363c6 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th - T0xE1 Dishwasher - T0xE2 Electric Water Heater - T0xE3 Constant Temperature Gas Water Heater +- T0xE6 Wall hanging furnace - T0xEA Rice Cooker - T0xED Water Softener - T0xFA Electric Fan diff --git a/README_hans.md b/README_hans.md index 7ff4142..6db1fce 100644 --- a/README_hans.md +++ b/README_hans.md @@ -45,6 +45,7 @@ - T0xE1 洗碗机 - T0xE2 电热水器 - T0xE3 恒温式燃气热水器 +- T0xE6 壁挂炉 - T0xEA 电饭锅 - T0xED 软水机 - T0xFA 电风扇 diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xE6.py b/custom_components/midea_auto_cloud/device_mapping/T0xE6.py new file mode 100644 index 0000000..46d5779 --- /dev/null +++ b/custom_components/midea_auto_cloud/device_mapping/T0xE6.py @@ -0,0 +1,70 @@ +from homeassistant.components.switch import SwitchDeviceClass +from homeassistant.const import Platform, UnitOfElectricPotential, UnitOfTemperature, UnitOfTime, UnitOfPressure +from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass +from homeassistant.components.binary_sensor import BinarySensorDeviceClass + +DEVICE_MAPPING = { + "default": { + "rationale": ["off", "on"], + "queries": [{}], + "entities": { + Platform.SWITCH: { + "winter_mode": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "summer_mode": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "power": { + "device_class": SwitchDeviceClass.SWITCH, + }, + }, + Platform.SENSOR: { + "heat_exchanger": { + "device_class": SensorDeviceClass.ENUM, + }, + "fan_type": { + "device_class": SensorDeviceClass.ENUM, + }, + "ignitor_output": { + "device_class": SensorDeviceClass.ENUM, + }, + "fan_output": { + "device_class": SensorDeviceClass.ENUM, + }, + "current_heat_set_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "current_bath_set_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "heat_out_water_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "bath_out_water_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "water_gage": { + "unit_of_measurement": UnitOfPressure.PA, + "state_class": SensorStateClass.MEASUREMENT + }, + }, + Platform.BINARY_SENSOR: { + "heating_work": { + "device_class": BinarySensorDeviceClass.RUNNING + }, + "bathing_work": { + "device_class": BinarySensorDeviceClass.RUNNING + }, + }, + } + } +} diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xED.py b/custom_components/midea_auto_cloud/device_mapping/T0xED.py index d7ddb9b..8fdc290 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xED.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xED.py @@ -117,11 +117,16 @@ DEVICE_MAPPING = { "unit_of_measurement": UnitOfTemperature.CELSIUS, "state_class": SensorStateClass.MEASUREMENT }, - "water_consumption_ml": { + "water_consumption": { "device_class": SensorDeviceClass.VOLUME, "unit_of_measurement": UnitOfVolume.LITERS, "state_class": SensorStateClass.TOTAL_INCREASING }, + "water_consumption_ml": { + "device_class": SensorDeviceClass.VOLUME, + "unit_of_measurement": UnitOfVolume.MILLILITERS, + "state_class": SensorStateClass.TOTAL_INCREASING + }, "keep_warm_time": { "device_class": SensorDeviceClass.DURATION, "unit_of_measurement": UnitOfTime.MINUTES, @@ -246,11 +251,23 @@ DEVICE_MAPPING = { "velocity": { "device_class": SensorDeviceClass.ENUM, }, - "error": { - "device_class": SensorDeviceClass.ENUM, + "life_1": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.DAYS, }, - "category": { - "device_class": SensorDeviceClass.ENUM, + "life_2": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.DAYS, + }, + "in_tds": { + "device_class": SensorDeviceClass.WATER, + "unit_of_measurement": "mg/L", + "state_class": SensorStateClass.MEASUREMENT + }, + "out_tds": { + "device_class": SensorDeviceClass.WATER, + "unit_of_measurement": "mg/L", + "state_class": SensorStateClass.MEASUREMENT }, } } diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index f534046..51154ec 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -123,6 +123,12 @@ }, "entity": { "binary_sensor": { + "heating_work": { + "name": "Heating Work" + }, + "bathing_work": { + "name": "Bathing Work" + }, "doorswitch": { "name": "Door Switch" }, @@ -1395,6 +1401,48 @@ "ud_diy_up_percent": { "name": "UD DIY Up Percent" }, + "heat_exchanger": { + "name": "Heat Exchanger Mode" + }, + "fan_type": { + "name": "Fan Type" + }, + "ignitor_output": { + "name": "Ignitor Output" + }, + "fan_output": { + "name": "Fan Output" + }, + "current_heat_set_temperature": { + "name": "Current Heat Set Temperature" + }, + "current_bath_set_temperature": { + "name": "Current Bath Set Temperature" + }, + "heat_out_water_temperature": { + "name": "Heat Out Water Temperature" + }, + "bath_out_water_temperature": { + "name": "Bath Out Water Temperature" + }, + "water_gage": { + "name": "Water Gage" + }, + "in_tds": { + "name": "In TDS" + }, + "out_tds": { + "name": "Out TDS" + }, + "life_1": { + "name": "RO Filter Cartridge Lifespan" + }, + "life_2": { + "name": "MPC Filter Cartridge Lifespan" + }, + "water_consumption": { + "name": "Water Consumption" + }, "water_consumption_ml": { "name": "Water Consumption (ml)" }, @@ -1580,6 +1628,12 @@ } }, "switch": { + "winter_mode": { + "name": "Winter Mode" + }, + "summer_mode": { + "name": "Summer Mode" + }, "follow_body_sense": { "name": "Follow Body Sense" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index cd85e33..20f1df0 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -123,6 +123,12 @@ }, "entity": { "binary_sensor": { + "heating_work": { + "name": "采暖功能状态" + }, + "bathing_work": { + "name": "生活热水工作状态" + }, "doorswitch": { "name": "门锁开关" }, @@ -1399,6 +1405,48 @@ "ud_diy_up_percent": { "name": "上下自定义上百分比" }, + "heat_exchanger": { + "name": "采暖模式" + }, + "fan_type": { + "name": "风机模式" + }, + "ignitor_output": { + "name": "点火状态" + }, + "fan_output": { + "name": "风机状态" + }, + "current_heat_set_temperature": { + "name": "当前采暖设定温度" + }, + "current_bath_set_temperature": { + "name": "当前生活热水设定温度" + }, + "heat_out_water_temperature": { + "name": "采暖出水实际温度" + }, + "bath_out_water_temperature": { + "name": "生活用水出水实际温度" + }, + "water_gage": { + "name": "水压" + }, + "in_tds": { + "name": "进水TDS" + }, + "out_tds": { + "name": "出水TDS" + }, + "life_1": { + "name": "RO滤芯寿命" + }, + "life_2": { + "name": "MPC滤芯寿命" + }, + "water_consumption": { + "name": "用水量" + }, "water_consumption_ml": { "name": "用水量(毫升)" }, @@ -1584,6 +1632,12 @@ } }, "switch": { + "winter_mode": { + "name": "冬季模式" + }, + "summer_mode": { + "name": "夏季模式" + }, "follow_body_sense": { "name": "随身感" },