From 8e21f39b305f05977026292468b26ce16a1010f1 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 30 Jan 2026 13:13:02 +0800 Subject: [PATCH 01/11] feat: update device mapping for T0xAC(22040023/22270043) --- .../midea_auto_cloud/device_mapping/T0xAC.py | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xAC.py b/custom_components/midea_auto_cloud/device_mapping/T0xAC.py index 9d25b54..4b284d0 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xAC.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xAC.py @@ -1125,5 +1125,80 @@ DEVICE_MAPPING = { } } } + }, + ("22040023", "22270043"): { + "rationale": ["off", "on"], + "queries": [{}, {"query_type": "run_status"}, {"query_type": "indoor_temperature"}], + "centralized": ["power", "temperature", "mode", "eco", "comfort_power_save", + "wind_swing_lr", "wind_swing_ud", "wind_speed", "ptc", "dry"], + "entities": { + Platform.CLIMATE: { + "thermostat": { + "power": "power", + "hvac_modes": { + "off": {"power": "off"}, + "heat": {"power": "on", "mode": "heat"}, + "cool": {"power": "on", "mode": "cool"}, + "auto": {"power": "on", "mode": "auto"}, + "dry": {"power": "on", "mode": "dry"}, + "fan_only": {"power": "on", "mode": "fan"} + }, + "preset_modes": { + "none": { + "eco": "off", + "comfort_power_save": "off" + }, + "eco": {"eco": "on"}, + "comfort": {"comfort_power_save": "on"} + }, + "swing_modes": { + "off": {"wind_swing_lr": "off", "wind_swing_ud": "off"}, + "both": {"wind_swing_lr": "on", "wind_swing_ud": "on"}, + "horizontal": {"wind_swing_lr": "on", "wind_swing_ud": "off"}, + "vertical": {"wind_swing_lr": "off", "wind_swing_ud": "on"}, + }, + "fan_modes": { + "silent": {"wind_speed": 20}, + "low": {"wind_speed": 40}, + "medium": {"wind_speed": 60}, + "high": {"wind_speed": 80}, + "full": {"wind_speed": 100}, + "auto": {"wind_speed": 102} + }, + "target_temperature": ["temperature", "small_temperature"], + "current_temperature": "indoor_temperature", + "pre_mode": "mode", + "aux_heat": "ptc", + "min_temp": 17, + "max_temp": 30, + "temperature_unit": UnitOfTemperature.CELSIUS, + "precision": PRECISION_HALVES, + } + }, + Platform.SWITCH: { + "dry": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "ptc": { + "device_class": SwitchDeviceClass.SWITCH, + "translation_key": "aux_heat", + } + }, + Platform.SENSOR: { + "mode": { + "device_class": SensorDeviceClass.ENUM, + }, + "indoor_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "outdoor_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + } + } + } } } From 3cc231d65fedba644181402800cfb364047163c5 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 30 Jan 2026 13:14:58 +0800 Subject: [PATCH 02/11] feat: update device mapping for T0xB6(7300073N) --- .../midea_auto_cloud/device_mapping/T0xB6.py | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py index d693cb5..0491350 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xB6.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xB6.py @@ -239,5 +239,66 @@ DEVICE_MAPPING = { } } } + }, + "7300073N": { + "rationale": ["off", "on"], + "queries": [{}], + "centralized": ["lightness"], + "entities": { + Platform.SWITCH: { + "power": { + "device_class": SwitchDeviceClass.SWITCH, + } + }, + Platform.SENSOR: { + "total_working_time": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.MINUTES, + "state_class": SensorStateClass.TOTAL_INCREASING, + }, + "wind_pressure": { + "device_class": SensorDeviceClass.PRESSURE, + "unit_of_measurement": UnitOfPressure.PA, + "state_class": SensorStateClass.MEASUREMENT + } + }, + Platform.NUMBER: { + "lightness": { + "min": 10, + "max": 100, + "step": 5, + "command": { + "electronic_control_version": 2, + "type": "b6", + "b6_action": "setting", + "setting": "light", + "lightness": "{value}" + } + } + }, + Platform.SELECT: { + "gear": { + "options": { + "off": {"gear": 0}, + "low": {"gear": 1}, + "medium": {"gear": 2}, + "high": {"gear": 3}, + "extreme": {"gear": 4}, + } + }, + "light": { + "options": { + "off": {"light": "off"}, + "on": {"light": "on"} + }, + "command": { + "electronic_control_version": 2, + "type": "b6", + "b6_action": "setting", + "setting": "light" + } + } + } + } } } From 81b8a509bc5ce766b70c85b0a44678f53601f559 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 30 Jan 2026 13:41:24 +0800 Subject: [PATCH 03/11] fix: correct brightness mapping for 0-255 configured light devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed the erroneous brightness value mapping (1-100 ↔ 0-255) for devices configured with brightness range [0, 255]. The previous logic incorrectly assumed these devices actually operated in a 1-100 range, causing inaccurate brightness values. --- custom_components/midea_auto_cloud/light.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/custom_components/midea_auto_cloud/light.py b/custom_components/midea_auto_cloud/light.py index 068478a..53cc423 100644 --- a/custom_components/midea_auto_cloud/light.py +++ b/custom_components/midea_auto_cloud/light.py @@ -165,11 +165,9 @@ class MideaLightEntity(MideaEntity, LightEntity): if brightness_value is not None: brightness_value = int(brightness_value) if brightness_value is not None: - # 如果配置是[0, 255]但实际设备范围是1-100,需要特殊处理 + # 配置是[0, 255]直接使用 if self._brightness_min == 0 and self._brightness_max == 255: - # 特殊处理:设备1-100范围映射到HA的0-255范围 - ha_brightness = round(brightness_value * 2.55) # 1-100 -> 0-255 - return max(1, min(255, ha_brightness)) + return max(1, min(255, brightness_value)) else: # 正常范围映射 device_range = self._brightness_max - self._brightness_min @@ -244,11 +242,11 @@ class MideaLightEntity(MideaEntity, LightEntity): if target_brightness is not None and self._key_brightness and self._brightness_is_range: # 范围模式:将Home Assistant的0-255映射到设备范围 - # 如果配置是[0, 255]但实际设备范围是1-100,需要特殊处理 + target_brightness = max(0, min(255, target_brightness)) + + # 配置是[0, 255]直接使用 if self._brightness_min == 0 and self._brightness_max == 255: - # 特殊处理:配置[0,255]但实际设备范围是1-100 - device_brightness = round(target_brightness / 2.55) # 0-255 -> 0-100 - device_brightness = max(1, min(100, device_brightness)) # 确保在1-100范围内 + device_brightness = target_brightness else: # 正常范围映射 device_range = self._brightness_max - self._brightness_min From c879f911d1eb336fce9c51b6df4529af11d2de1f Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 30 Jan 2026 13:52:40 +0800 Subject: [PATCH 04/11] feat: enhance color temperature control for light devices with flexible range - Updated device mapping configuration to support explicit device range specification - Changed from simple [min_kelvin, max_kelvin] format to structured format: {"kelvin_range": [min_kelvin, max_kelvin], "device_range": [min_device, max_device]} - This allows devices with non-standard (non-1-100) color temp ranges to be properly supported - Improved color temperature conversion logic in light entity: - Added support for device-specific range mapping instead of hardcoded 1-100 range - Enhanced configuration detection to handle both direct and nested formats - Updated kelvin-to-device and device-to-kelvin conversion to use dynamic ranges --- .../midea_auto_cloud/device_mapping/T0x13.py | 21 +++- custom_components/midea_auto_cloud/light.py | 106 ++++++++++++------ 2 files changed, 90 insertions(+), 37 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0x13.py b/custom_components/midea_auto_cloud/device_mapping/T0x13.py index e2c1b3f..668cc93 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0x13.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0x13.py @@ -11,7 +11,12 @@ DEVICE_MAPPING = { "light": { "power": "power", "brightness": {"brightness": [1, 100]}, - "color_temp": {"color_temperature": [3000, 5700]}, # 添加色温配置 + "color_temp": { + "color_temperature": { + "kelvin_range": [3000, 5700], + "device_range": [0, 100] + } + }, "preset_modes": { "night": {"scene_light": "night"}, "read": {"scene_light": "read"}, @@ -33,7 +38,12 @@ DEVICE_MAPPING = { "light": { "power": "led_power", "brightness": {"brightness": [1, 100]}, - "color_temp": {"color_temperature": [2700, 6500]}, + "color_temp": { + "color_temperature": { + "kelvin_range": [2700, 6500], + "device_range": [0, 100] + } + }, "preset_modes": { "work": {"led_scene_light": "work"}, "eating": {"led_scene_light": "eating"}, @@ -82,7 +92,12 @@ DEVICE_MAPPING = { "light": { "power": "led_power", "brightness": {"brightness": [1, 100]}, - "color_temp": {"color_temperature": [2700, 6500]}, + "color_temp": { + "color_temperature": { + "kelvin_range": [2700, 6500], + "device_range": [0, 100] + } + }, "preset_modes": { "work": {"led_scene_light": "work"}, "eating": {"led_scene_light": "eating"}, diff --git a/custom_components/midea_auto_cloud/light.py b/custom_components/midea_auto_cloud/light.py index 53cc423..7082aba 100644 --- a/custom_components/midea_auto_cloud/light.py +++ b/custom_components/midea_auto_cloud/light.py @@ -84,29 +84,54 @@ class MideaLightEntity(MideaEntity, LightEntity): self._brightness_key = key break - # 检测色温配置类型:范围 [min_kelvin, max_kelvin] 或嵌套格式 {"color_temp": [min_kelvin, max_kelvin]} + # 检测色温配置类型:直接格式 或 嵌套格式 self._color_temp_is_range = False self._color_temp_min = 2700 # 默认最小色温(暖白) self._color_temp_max = 6500 # 默认最大色温(冷白) self._color_temp_key = "color_temp" # 默认键名 - + self._color_temp_device_range = [1, 100] # 默认设备范围 + if self._key_color_temp: - if isinstance(self._key_color_temp, list) and len(self._key_color_temp) == 2: - # 直接范围格式:[min_kelvin, max_kelvin] - if isinstance(self._key_color_temp[0], (int, float)) and isinstance(self._key_color_temp[1], (int, float)): - self._color_temp_is_range = True - self._color_temp_min = self._key_color_temp[0] - self._color_temp_max = self._key_color_temp[1] - elif isinstance(self._key_color_temp, dict): - # 嵌套格式:{"color_temp": [min_kelvin, max_kelvin]} 或其他键名 - for key, value in self._key_color_temp.items(): - if isinstance(value, list) and len(value) == 2: - if isinstance(value[0], (int, float)) and isinstance(value[1], (int, float)): - self._color_temp_is_range = True - self._color_temp_min = value[0] - self._color_temp_max = value[1] - self._color_temp_key = key - break + # 直接格式:{"kelvin_range": [min, max], "device_range": [min, max]} + if isinstance(self._key_color_temp, dict): + # 检查是否为直接格式(包含kelvin_range和device_range) + if "kelvin_range" in self._key_color_temp and "device_range" in self._key_color_temp: + kelvin_range = self._key_color_temp["kelvin_range"] + device_range = self._key_color_temp["device_range"] + if ( + isinstance(kelvin_range, list) + and len(kelvin_range) == 2 + and isinstance(device_range, list) + and len(device_range) == 2 + ): + self._color_temp_is_range = True + self._color_temp_min = kelvin_range[0] + self._color_temp_max = kelvin_range[1] + self._color_temp_device_range = device_range + # 直接格式没有外层key,使用默认键名 + self._color_temp_key = "color_temp" + + # 嵌套格式:{"color_temperature": {"kelvin_range": [min, max], "device_range": [min, max]}} + else: + # 遍历字典中的每个键值对 + for key, value in self._key_color_temp.items(): + if isinstance(value, dict): + # 检测嵌套格式 + if "kelvin_range" in value and "device_range" in value: + kelvin_range = value["kelvin_range"] + device_range = value["device_range"] + if ( + isinstance(kelvin_range, list) + and len(kelvin_range) == 2 + and isinstance(device_range, list) + and len(device_range) == 2 + ): + self._color_temp_is_range = True + self._color_temp_min = kelvin_range[0] + self._color_temp_max = kelvin_range[1] + self._color_temp_device_range = device_range + self._color_temp_key = key + break @property def supported_features(self): @@ -181,18 +206,26 @@ class MideaLightEntity(MideaEntity, LightEntity): """返回当前色温值(开尔文)""" if not self._color_temp_is_range: return None - - # 从设备属性读取色温值(1-100范围) + + # 从设备属性读取色温值 color_temp_value = self._get_nested_value(self._color_temp_key) if color_temp_value is not None: try: - device_color_temp = int(color_temp_value) - # 将设备的1-100值转换为开尔文值 + device_value = int(color_temp_value) + device_min, device_max = self._color_temp_device_range + + # 将设备值转换为开尔文值 kelvin_range = self._color_temp_max - self._color_temp_min if kelvin_range > 0: - # 将1-100范围映射回开尔文范围 - ha_color_temp = self._color_temp_min + device_color_temp * kelvin_range / 100 - return round(ha_color_temp) + # 将设备值映射到开尔文范围 + device_range = device_max - device_min + if device_range > 0: + # 设备值 -> 开尔文 + normalized = (device_value - device_min) / device_range + ha_color_temp = self._color_temp_min + normalized * kelvin_range + return round(ha_color_temp) + else: + return self._color_temp_min else: return self._color_temp_min except (ValueError, TypeError): @@ -261,18 +294,23 @@ class MideaLightEntity(MideaEntity, LightEntity): if color_temp_kelvin is not None and self._color_temp_is_range: # 确保色温值在配置的范围内 ha_color_temp = max(self._color_temp_min, min(self._color_temp_max, color_temp_kelvin)) - - # 将开尔文值转换为设备范围(1-100) + + device_min, device_max = self._color_temp_device_range + kelvin_range = self._color_temp_max - self._color_temp_min if kelvin_range > 0: - # 将开尔文值映射到1-100范围 - device_color_temp = round((ha_color_temp - self._color_temp_min) * 100 / kelvin_range) - device_color_temp = max(0, min(100, device_color_temp)) + device_range = device_max - device_min + if device_range > 0: + normalized = (ha_color_temp - self._color_temp_min) / kelvin_range + device_value = round(device_min + normalized * device_range) + device_value = max(device_min, min(device_max, device_value)) + else: + device_value = device_min else: - device_color_temp = 50 # 默认中间值 - - new_status[self._color_temp_key] = str(device_color_temp) - + device_value = device_min + + new_status[self._color_temp_key] = str(device_value) + await self._async_set_status_on_off(self._key_power, True) if new_status: await self.async_set_attributes(new_status) From a3ed31b21204f6f7803dfedcb1ad1ea6f55eaffb Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Fri, 30 Jan 2026 13:59:20 +0800 Subject: [PATCH 05/11] feat: update device mapping for T0x13(22222222) --- .../midea_auto_cloud/device_mapping/T0x13.py | 37 ++++++++++++++++++- .../midea_auto_cloud/translations/en.json | 3 ++ .../translations/zh-Hans.json | 17 ++++++++- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0x13.py b/custom_components/midea_auto_cloud/device_mapping/T0x13.py index 668cc93..c152959 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0x13.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0x13.py @@ -1,5 +1,5 @@ from homeassistant.components.fan import DIRECTION_FORWARD, DIRECTION_REVERSE -from homeassistant.const import Platform, UnitOfTemperature, PRECISION_WHOLE +from homeassistant.const import Platform, UnitOfTemperature, UnitOfTime, PRECISION_WHOLE DEVICE_MAPPING = { "default": { @@ -141,5 +141,40 @@ DEVICE_MAPPING = { } } } + }, + "22222222": { + "rationale": ["off", "on"], + "queries": [{}], + "centralized": [], + "entities": { + Platform.LIGHT: { + "light": { + "power": "power", + "brightness": {"brightness": [0, 255]}, + "color_temp": { + "color_temperature": { + "kelvin_range": [2700, 6500], + "device_range": [0, 255] + } + }, + "preset_modes": { + "night": {"scene_light": "night"}, + "read": {"scene_light": "read"}, + "mild": {"scene_light": "mild"}, + "life": {"scene_light": "life"}, + "film": {"scene_light": "film"}, + "manual": {"scene_light": "manual"}, + } + } + }, + Platform.NUMBER: { + "delay_light_off": { + "min": 0, + "max": 60, + "step": 1, + "unit_of_measurement": UnitOfTime.MINUTES + } + } + } } } diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index 68279d3..a9e12aa 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -2203,6 +2203,9 @@ } }, "number": { + "delay_light_off": { + "name": "Delay Light Off" + }, "hosting_upper": { "name": "PM2.5 Upper(Auto Purification)" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 02ba235..8a99a77 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -2493,10 +2493,25 @@ }, "light": { "light": { - "name": "电灯" + "name": "电灯", + "state_attributes": { + "effect": { + "state": { + "night": "夜灯", + "read": "阅读", + "mild": "柔和", + "life": "生活", + "film": "影院", + "manual": "自定义" + } + } + } } }, "number": { + "delay_light_off": { + "name": "延时关灯" + }, "hosting_upper": { "name": "PM2.5上阈值(自动净化)" }, From 234b4d6e4b41ec2bd6997bc48487de473693791a Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Sat, 31 Jan 2026 13:59:09 +0800 Subject: [PATCH 06/11] feat: update device mapping for T0xFC(571Z307F) --- .../midea_auto_cloud/device_mapping/T0xFC.py | 98 +++++++++++++++++++ .../translations/zh-Hans.json | 5 +- 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xFC.py b/custom_components/midea_auto_cloud/device_mapping/T0xFC.py index 4975e80..72917c3 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xFC.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xFC.py @@ -200,5 +200,103 @@ DEVICE_MAPPING = { } } } + }, + "571Z307F": { + "rationale": ["off", "on"], + "queries": [{}], + "centralized": [], + "entities": { + Platform.NUMBER: { + "hosting_upper": { + "min": 10, + "max": 75, + "step": 1 + }, + "hosting_lower": { + "min": 10, + "max": 75, + "step": 1 + } + }, + Platform.SWITCH: { + "power": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "buzzer": { + "device_class": SwitchDeviceClass.SWITCH, + "translation_key": "voice", + }, + "lock": { + "device_class": SwitchDeviceClass.SWITCH, + "translation_key": "child_lock", + }, + "waterions":{ + "device_class": SwitchDeviceClass.SWITCH, + } + }, + Platform.SELECT: { + "mode": { + "options": { + "manual": {"mode": "manual"}, + "sleep": {"mode": "sleep"}, + "auto": {"mode": "auto"}, + "fast": {"mode": "fast"} + } + }, + "bright": { + "options": { + "全亮": {"bright": 0}, + "半亮": {"bright": 6}, + "熄灭": {"bright": 7} + } + }, + "gear": { + "options": { + "low": {"wind_speed": 1}, + "medium": {"wind_speed": 2}, + "high": {"wind_speed": 3} + } + }, + "humidity": { + "options": { + "off": {"humidity": 0}, + "40%": {"humidity": 40}, + "50%": {"humidity": 50}, + "60%": {"humidity": 60} + } + }, + }, + Platform.SENSOR: { + "deep_filter_percent": { + "unit_of_measurement": PERCENTAGE, + "state_class": SensorStateClass.MEASUREMENT + }, + "temperature_feedback": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "humidify_feedback": { + "device_class": SensorDeviceClass.HUMIDITY, + "unit_of_measurement": "%", + "state_class": SensorStateClass.MEASUREMENT + }, + "ash_tvoc":{ + "unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + "state_class": SensorStateClass.MEASUREMENT, + "translation_key": "tvoc_value" + }, + "pm25":{ + "device_class": SensorDeviceClass.PM25, + "unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + "state_class": SensorStateClass.MEASUREMENT + }, + "pm10":{ + "device_class": SensorDeviceClass.PM10, + "unit_of_measurement": CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, + "state_class": SensorStateClass.MEASUREMENT + } + } + } } } diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 8a99a77..676ca15 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -546,7 +546,10 @@ "name": "降噪设置" }, "humidity": { - "name": "设定湿度" + "name": "设定湿度", + "state": { + "off": "关闭" + } }, "b3_function_control": { "name": "消毒柜控制" From 77f8e593589ede5ba451b79dbc55446cacfcffd6 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Sat, 31 Jan 2026 14:00:16 +0800 Subject: [PATCH 07/11] feat: update device mapping for T0xFD(202Z219V) --- .../midea_auto_cloud/device_mapping/T0xFD.py | 51 ++++++++++++++++++- .../translations/zh-Hans.json | 3 +- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xFD.py b/custom_components/midea_auto_cloud/device_mapping/T0xFD.py index 507e4bf..788937f 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xFD.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xFD.py @@ -243,5 +243,54 @@ DEVICE_MAPPING = { } } } + }, + "202Z219V": { + "rationale": ["off", "on"], + "queries": [{}], + "centralized": [], + "entities": { + Platform.SWITCH: { + "power": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "bright_led": { + "device_class": SwitchDeviceClass.SWITCH, + "rationale": ["exit", "light"], + "translation_key": "light_mode" + + } + }, + Platform.SELECT: { + "humidity": { + "options": { + "40%": {"humidity": 40}, + "45%": {"humidity": 45}, + "50%": {"humidity": 50}, + "55%": {"humidity": 55}, + "60%": {"humidity": 60} + }, + "command": { + "humidity_mode": "auto" + } + }, + "wind_speed": { + "options": { + "low": {"wind_speed": "low"}, + "middle": {"wind_speed": "middle"}, + "high": {"wind_speed": "high"} + }, + "command": { + "humidity_mode": "manual" + } + } + }, + Platform.SENSOR: { + "cur_humidity": { + "device_class": SensorDeviceClass.HUMIDITY, + "unit_of_measurement": PERCENTAGE, + "state_class": SensorStateClass.MEASUREMENT + } + } + } } -} \ No newline at end of file +} diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index 676ca15..d031f22 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -548,7 +548,8 @@ "humidity": { "name": "设定湿度", "state": { - "off": "关闭" + "off": "关闭", + "auto": "自动" } }, "b3_function_control": { From 5212eb7002986b4d3aaa3aea4453c70bc50d469c Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Mon, 2 Feb 2026 21:37:42 +0800 Subject: [PATCH 08/11] feat: add support for new T0xAC devices(22012369/22251077) --- .../midea_auto_cloud/device_mapping/T0xAC.py | 77 ++++++++++++++++++- .../midea_auto_cloud/translations/en.json | 10 +++ .../translations/zh-Hans.json | 10 +++ 3 files changed, 96 insertions(+), 1 deletion(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xAC.py b/custom_components/midea_auto_cloud/device_mapping/T0xAC.py index 4b284d0..831f77d 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xAC.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xAC.py @@ -1126,7 +1126,7 @@ DEVICE_MAPPING = { } } }, - ("22040023", "22270043"): { + ("22012369", "22040023", "22270043"): { "rationale": ["off", "on"], "queries": [{}, {"query_type": "run_status"}, {"query_type": "indoor_temperature"}], "centralized": ["power", "temperature", "mode", "eco", "comfort_power_save", @@ -1200,5 +1200,80 @@ DEVICE_MAPPING = { } } } + }, + "22251077": { + "rationale": ["off", "on"], + "queries": [{}, {"query_type": "run_status"}, {"query_type": "indoor_temperature"}], + "centralized": ["power", "temperature", "mode", "eco", "comfort_power_save", + "wind_swing_lr", "wind_swing_lr_under", "wind_swing_ud", "wind_speed", "ptc", "dry"], + "entities": { + Platform.CLIMATE: { + "thermostat": { + "power": "power", + "hvac_modes": { + "off": {"power": "off"}, + "heat": {"power": "on", "mode": "heat"}, + "cool": {"power": "on", "mode": "cool"}, + "auto": {"power": "on", "mode": "auto"}, + "dry": {"power": "on", "mode": "dry"}, + "fan_only": {"power": "on", "mode": "fan"} + }, + "preset_modes": { + "none": {"eco": "off"}, + "eco": {"eco": "on"} + }, + "swing_modes": { + "off": {"wind_swing_lr": "off", "wind_swing_lr_under": "off", "wind_swing_ud": "off"}, + "both": {"wind_swing_lr": "on", "wind_swing_lr_under": "on", "wind_swing_ud": "on"}, + "horizontal_upper_only": {"wind_swing_lr": "on", "wind_swing_lr_under": "off", "wind_swing_ud": "off"}, + "horizontal_under_only": {"wind_swing_lr": "off", "wind_swing_lr_under": "on", "wind_swing_ud": "off"}, + "horizontal_upper_under": {"wind_swing_lr": "on", "wind_swing_lr_under": "on", "wind_swing_ud": "off"}, + "horizontal_upper_vertical": {"wind_swing_lr": "on", "wind_swing_lr_under": "off", "wind_swing_ud": "on"}, + "horizontal_under_vertical": {"wind_swing_lr": "off", "wind_swing_lr_under": "on", "wind_swing_ud": "on"}, + "vertical_only": {"wind_swing_lr": "off", "wind_swing_lr_under": "off", "wind_swing_ud": "on"}, + }, + "fan_modes": { + "silent": {"wind_speed": 20}, + "low": {"wind_speed": 40}, + "medium": {"wind_speed": 60}, + "high": {"wind_speed": 80}, + "full": {"wind_speed": 100}, + "auto": {"wind_speed": 102} + }, + "target_temperature": ["temperature", "small_temperature"], + "current_temperature": "indoor_temperature", + "pre_mode": "mode", + "aux_heat": "ptc", + "min_temp": 17, + "max_temp": 30, + "temperature_unit": UnitOfTemperature.CELSIUS, + "precision": PRECISION_HALVES, + } + }, + Platform.SWITCH: { + "dry": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "ptc": { + "device_class": SwitchDeviceClass.SWITCH, + "translation_key": "aux_heat", + } + }, + Platform.SENSOR: { + "mode": { + "device_class": SensorDeviceClass.ENUM, + }, + "indoor_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "outdoor_temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "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 a9e12aa..cd2aa3e 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -364,6 +364,16 @@ "silent": "Silent", "full": "Full" } + }, + "swing_mode": { + "state": { + "horizontal_upper_only": "Horizontal Swing Upper", + "horizontal_under_only": "Horizontal Swing Under", + "horizontal_upper_under": "Horizontal Swing Upper And Under", + "horizontal_upper_vertical": "Horizontal Swing Upper And Vertical", + "horizontal_under_vertical": "Horizontal Swing Under And Vertical", + "vertical_only": "Vertical Swing" + } } } }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index d031f22..ff62f88 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -384,6 +384,16 @@ "silent": "静音", "full": "强劲" } + }, + "swing_mode": { + "state": { + "horizontal_upper_only": "上左右风", + "horizontal_under_only": "下左右风", + "horizontal_upper_under": "上+下左右风", + "horizontal_upper_vertical": "上左右风+上下摆风", + "horizontal_under_vertical": "下左右风+上下摆风", + "vertical_only": "上下摆风" + } } } }, From 80fc4f7ce7411f668f32f66154d372d336a30efd Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Mon, 2 Feb 2026 22:37:21 +0800 Subject: [PATCH 09/11] feat: add support for new T0xE1 device(7600V1E7) --- .../midea_auto_cloud/device_mapping/T0xE1.py | 66 ++++++++++++++++++- .../midea_auto_cloud/translations/en.json | 4 ++ .../translations/zh-Hans.json | 4 ++ 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xE1.py b/custom_components/midea_auto_cloud/device_mapping/T0xE1.py index f7ef584..c353c40 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xE1.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xE1.py @@ -128,5 +128,69 @@ DEVICE_MAPPING = { }, } } + }, + "7600V1E7": { + "rationale": [0, 1], + "queries": [{}], + "centralized": [], + "entities": { + Platform.SWITCH: { + "airswitch": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "lock": { + "device_class": SwitchDeviceClass.SWITCH, + "translation_key": "child_lock" + } + }, + Platform.NUMBER: { + "air_set_hour": { + "min": 1, + "max": 72, + "step": 1, + "unit_of_measurement": UnitOfTime.HOURS + } + }, + Platform.SELECT: { + "work_status": { + "options": { + "power_off": {"work_status": "power_off" }, + "power_on": {"work_status": "power_on" }, + "cancel": {"work_status": "cancel" }, + "pause": {"operator":"pause"}, + "resume": {"operator":"start"}, + } + }, + "wash_mode": { + "options": { + "neutral_gear": {"work_status": "work", "mode": "neutral_gear"}, + "auto_wash": {"work_status": "work", "mode": "auto_wash"}, + "strong_wash": {"work_status": "work", "mode": "strong_wash"}, + "standard_wash": {"work_status": "work", "mode": "standard_wash"}, + "eco_wash": {"work_status":"work","mode":"eco_wash","additional":0,"wash_region":3}, + "soft_wash": {"work_status": "work", "mode": "glass_wash"}, + "fast_wash": {"work_status": "work", "mode": "fast_wash"}, + "soak_wash": {"work_status": "work", "mode": "soak_wash"}, + "self_clean": {"work_status": "work", "mode": "self_clean"}, + "fruit_wash": {"work_status": "work", "mode": "fruit_wash"} + } + } + }, + Platform.SENSOR: { + "bright": { + "device_class": SensorDeviceClass.ENUM + }, + "temperature": { + "device_class": SensorDeviceClass.TEMPERATURE, + "unit_of_measurement": UnitOfTemperature.CELSIUS, + "state_class": SensorStateClass.MEASUREMENT + }, + "left_time": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.MINUTES, + "state_class": SensorStateClass.MEASUREMENT + } + } + } } -} \ No newline at end of file +} diff --git a/custom_components/midea_auto_cloud/translations/en.json b/custom_components/midea_auto_cloud/translations/en.json index cd2aa3e..f282e38 100644 --- a/custom_components/midea_auto_cloud/translations/en.json +++ b/custom_components/midea_auto_cloud/translations/en.json @@ -890,6 +890,7 @@ "standard_wash": "standard wash", "eco_wash": "eco wash", "glass_wash": "glass wash", + "soft_wash": "soft wash", "hour_wash": "hour wash", "fast_wash": "fast wash", "soak_wash": "soak wash", @@ -2213,6 +2214,9 @@ } }, "number": { + "air_set_hour": { + "name": "Drying Storage Set Time" + }, "delay_light_off": { "name": "Delay Light Off" }, diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index ff62f88..d943135 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -1077,6 +1077,7 @@ "standard_wash": "标准洗", "eco_wash": "节能洗", "glass_wash": "玻璃洗", + "soft_wash": "轻柔洗", "hour_wash": "小时洗", "fast_wash": "快速洗", "soak_wash": "预冲洗", @@ -2523,6 +2524,9 @@ } }, "number": { + "air_set_hour": { + "name": "烘干存储设置时间" + }, "delay_light_off": { "name": "延时关灯" }, From 20d34729f14bde6209784eed4adc04129fcbbb9a Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Mon, 2 Feb 2026 23:00:25 +0800 Subject: [PATCH 10/11] fix: Correct return type from string to number for T0xDB --- .../midea_auto_cloud/device_mapping/T0xDB.py | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xDB.py b/custom_components/midea_auto_cloud/device_mapping/T0xDB.py index b868f81..cfe9e3d 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xDB.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xDB.py @@ -384,21 +384,21 @@ DEVICE_MAPPING = { }, "dehydration_speed": { "options": { - "免脱水": {"dehydration_speed": "0"}, - "400转": {"dehydration_speed": "400"}, - "600转": {"dehydration_speed": "600"}, - "800转": {"dehydration_speed": "800"}, - "1000转": {"dehydration_speed": "1000"}, - "1200转": {"dehydration_speed": "1200"}, - "1400转": {"dehydration_speed": "1400"} + "免脱水": {"dehydration_speed": 0}, + "400转": {"dehydration_speed": 400}, + "600转": {"dehydration_speed": 600}, + "800转": {"dehydration_speed": 800}, + "1000转": {"dehydration_speed": 1000}, + "1200转": {"dehydration_speed": 1200}, + "1400转": {"dehydration_speed": 1400} } }, "soak_count": { "options": { - "1次": {"soak_count": "1"}, - "2次": {"soak_count": "2"}, - "3次": {"soak_count": "3"}, - "4次": {"soak_count": "4"} + "1次": {"soak_count": 1}, + "2次": {"soak_count": 2}, + "3次": {"soak_count": 3}, + "4次": {"soak_count": 4} } }, "water_level": { @@ -407,35 +407,35 @@ DEVICE_MAPPING = { "L1": {"water_level": "low"}, "L2": {"water_level": "mid"}, "L3": {"water_level": "high"}, - "L4": {"water_level": "4"} + "L4": {"water_level": 4} } }, "detergent": { "options": { - "智能": {"detergent": "4"}, - "关闭": {"detergent": "0"}, - "L1": {"detergent": "1"}, - "L2": {"detergent": "2"}, - "L3": {"detergent": "3"}, - "L4": {"detergent": "5"} + "智能": {"detergent": 4}, + "关闭": {"detergent": 0}, + "L1": {"detergent": 1}, + "L2": {"detergent": 2}, + "L3": {"detergent": 3}, + "L4": {"detergent": 5} } }, "temperature": { "options": { - "冷水": {"temperature": "0"}, - "20℃": {"temperature": "20"}, - "30℃": {"temperature": "30"}, - "40℃": {"temperature": "40"}, - "60℃": {"temperature": "60"}, - "95℃": {"temperature": "95"} + "冷水": {"temperature": 0}, + "20℃": {"temperature": 20}, + "30℃": {"temperature": 30}, + "40℃": {"temperature": 40}, + "60℃": {"temperature": 60}, + "95℃": {"temperature": 95} } }, "stains": { "options": { - "关闭": {"stains": "0"}, - "酱渍": {"stains": "83"}, - "果渍": {"stains": "85"}, - "妆渍": {"stains": "84"} + "关闭": {"stains": 0}, + "酱渍": {"stains": 83}, + "果渍": {"stains": 85}, + "妆渍": {"stains": 84} } } }, From 5082c3c20255e3753e2f50119e8cb2e22c674c71 Mon Sep 17 00:00:00 2001 From: Cyborg2017 Date: Mon, 2 Feb 2026 23:41:24 +0800 Subject: [PATCH 11/11] feat: add support for new T0xDB device(38124914) --- .../midea_auto_cloud/device_mapping/T0xDB.py | 110 ++++++++++++++++++ .../translations/zh-Hans.json | 2 +- 2 files changed, 111 insertions(+), 1 deletion(-) diff --git a/custom_components/midea_auto_cloud/device_mapping/T0xDB.py b/custom_components/midea_auto_cloud/device_mapping/T0xDB.py index cfe9e3d..6ae590f 100644 --- a/custom_components/midea_auto_cloud/device_mapping/T0xDB.py +++ b/custom_components/midea_auto_cloud/device_mapping/T0xDB.py @@ -468,5 +468,115 @@ DEVICE_MAPPING = { } } } + }, + "38124914": { + "rationale": ["off", "on"], + "queries": [{}], + "calculate": { + "get": [ + { + "lvalue": "[remaining_time]", + "rvalue": "[remain_time]" + } + ], + "set": {} + }, + "entities": { + Platform.BINARY_SENSOR: { + "door_opened": { + "device_class": BinarySensorDeviceClass.OPENING, + }, + "detergent_lack": { + "device_class": BinarySensorDeviceClass.PROBLEM, + } + }, + Platform.SWITCH: { + "power": { + "device_class": SwitchDeviceClass.SWITCH, + }, + "control_status": { + "device_class": SwitchDeviceClass.SWITCH, + "rationale": ["pause", "start"], + }, + "lock": { + "device_class": SwitchDeviceClass.SWITCH, + "translation_key": "child_lock", + } + }, + Platform.SELECT: { + "mode": { + "options": { + "normal": {"mode": "normal"}, + "factory_test": {"mode": "factory_test"}, + "service": {"mode": "service"}, + "normal_continus": {"mode": "normal_continus"} + } + }, + "soak_count": { + "options": { + "1次": {"soak_count": 1}, + "2次": {"soak_count": 2}, + "3次": {"soak_count": 3}, + "4次": {"soak_count": 4} + } + }, + "temperature": { + "options": { + "冷水": {"temperature": 0}, + "20℃": {"temperature": 20}, + "30℃": {"temperature": 30}, + "40℃": {"temperature": 40}, + "60℃": {"temperature": 60} + } + }, + "program": { + "options": { + "baby_clothes": {"program": "baby_clothes"}, + "cotton": {"program": "cotton"}, + "enzyme": {"program": "enzyme"}, + "fast_wash": {"program": "fast_wash"}, + "fast_wash_30": {"program": "fast_wash_30"}, + "mixed_wash": {"program": "mixed_wash"}, + "remove_mite_wash": {"program": "remove_mite_wash"}, + "shirt": {"program": "shirt"}, + "single_dehytration": {"program": "single_dehytration"}, + "sport_clothes": {"program": "sport_clothes"}, + "ssp": {"program": "ssp"}, + "steep": {"program": "steep"}, + "underwear": {"program": "water_underwear"}, + "kids": {"program": "kids"}, + "cook_wash": {"program": "cook_wash"} + } + } + }, + Platform.SENSOR: { + "running_status": { + "device_class": SensorDeviceClass.ENUM + }, + "remain_time": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.MINUTES, + "state_class": SensorStateClass.MEASUREMENT + }, + "progress": { + "device_class": SensorDeviceClass.BATTERY, + "unit_of_measurement": "%", + "state_class": SensorStateClass.MEASUREMENT + }, + "error_code": { + "device_class": SensorDeviceClass.ENUM + }, + "wash_time_value": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.MINUTES, + "state_class": SensorStateClass.MEASUREMENT + }, + "dehydration_time_value": { + "device_class": SensorDeviceClass.DURATION, + "unit_of_measurement": UnitOfTime.MINUTES, + "state_class": SensorStateClass.MEASUREMENT + } + } + } } } diff --git a/custom_components/midea_auto_cloud/translations/zh-Hans.json b/custom_components/midea_auto_cloud/translations/zh-Hans.json index d943135..11c5701 100644 --- a/custom_components/midea_auto_cloud/translations/zh-Hans.json +++ b/custom_components/midea_auto_cloud/translations/zh-Hans.json @@ -949,7 +949,7 @@ "water_ssp": "水韵超净洗", "standard": "标准洗", "green_wool": "绿色羊毛", - "cook_wash": "厨师服洗", + "cook_wash": "高温洗", "fresh_remove_wrinkle": "清新除皱", "steam_sterilize_wash": "蒸汽消毒洗", "aromatherapy": "香薰洗",