This commit is contained in:
Home Assistant Version Control
2026-07-24 15:19:02 +00:00
parent 8abf4efaec
commit 2d21a40fd6
48 changed files with 4181 additions and 232 deletions
@@ -8,8 +8,12 @@ from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION,
PERCENTAGE,
REVOLUTIONS_PER_MINUTE,
Platform,
UnitOfElectricCurrent,
UnitOfElectricPotential,
UnitOfEnergy,
UnitOfFrequency,
UnitOfPower,
UnitOfTemperature,
UnitOfTime,
@@ -50,6 +54,11 @@ from midealocal.devices.x26 import DeviceAttributes as X26Attributes
from midealocal.devices.x34 import DeviceAttributes as X34Attributes
from midealocal.devices.x40 import DeviceAttributes as X40Attributes
FRESH_AIR_EXHAUST = "fresh_air_exhaust"
FRESH_AIR_EXHAUST_MODE = "fresh_air_exhaust_mode"
FRESH_AIR_EXHAUST_POWER = "fresh_air_exhaust_power"
FRESH_AIR_EXHAUST_SPEED = "fresh_air_exhaust_speed"
"""
Entity Naming Rule:
@@ -384,6 +393,29 @@ MIDEA_DEVICES: dict[int, dict[str, dict[str, Any] | str]] = {
"name": "Fresh Air",
"icon": "mdi:fan",
},
ACAttributes.fresh_air_mode: {
"type": Platform.SELECT,
"required_attribute": ACAttributes.fresh_air_mode,
"translation_key": "fresh_air_mode",
"name": "Fresh Air Speed",
"icon": "mdi:fan-chevron-up",
"options": "fresh_air_fan_speeds",
},
FRESH_AIR_EXHAUST: {
"type": Platform.FAN,
"translation_key": "fresh_air_exhaust",
"name": "Fresh Air Exhaust",
"icon": "mdi:fan-reverse",
"required_attribute": FRESH_AIR_EXHAUST_POWER,
},
FRESH_AIR_EXHAUST_MODE: {
"type": Platform.SELECT,
"translation_key": "fresh_air_exhaust_mode",
"name": "Fresh Air Exhaust Speed",
"icon": "mdi:fan-chevron-down",
"options": "fresh_air_exhaust_fan_speeds",
"required_attribute": FRESH_AIR_EXHAUST_POWER,
},
ACAttributes.aux_heating: {
"type": Platform.SWITCH,
"translation_key": "aux_heating",
@@ -578,6 +610,125 @@ MIDEA_DEVICES: dict[int, dict[str, dict[str, Any] | str]] = {
"name": "Error Code",
"icon": "mdi:alert-box",
},
# group 1: compressor and refrigerant circuit
ACAttributes.compressor_frequency: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.compressor_frequency,
"translation_key": "compressor_frequency",
"name": "Compressor Frequency",
"device_class": SensorDeviceClass.FREQUENCY,
"unit": UnitOfFrequency.HERTZ,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.target_compressor_frequency: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.target_compressor_frequency,
"translation_key": "target_compressor_frequency",
"name": "Target Compressor Frequency",
"device_class": SensorDeviceClass.FREQUENCY,
"unit": UnitOfFrequency.HERTZ,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.compressor_current: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.compressor_current,
"translation_key": "compressor_current",
"name": "Compressor Current",
"device_class": SensorDeviceClass.CURRENT,
"unit": UnitOfElectricCurrent.AMPERE,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.compressor_voltage: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.compressor_voltage,
"translation_key": "compressor_voltage",
"name": "Compressor Voltage",
"device_class": SensorDeviceClass.VOLTAGE,
"unit": UnitOfElectricPotential.VOLT,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.indoor_coil_temperature: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.indoor_coil_temperature,
"translation_key": "indoor_coil_temperature",
"name": "Indoor Coil Temperature (T1)",
"device_class": SensorDeviceClass.TEMPERATURE,
"unit": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.evaporator_temperature: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.evaporator_temperature,
"translation_key": "evaporator_temperature",
"name": "Evaporator Temperature (T2)",
"device_class": SensorDeviceClass.TEMPERATURE,
"unit": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.condenser_temperature: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.condenser_temperature,
"translation_key": "condenser_temperature",
"name": "Condenser Temperature (T3)",
"device_class": SensorDeviceClass.TEMPERATURE,
"unit": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.outdoor_ambient_temperature: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.outdoor_ambient_temperature,
"translation_key": "outdoor_ambient_temperature",
"name": "Outdoor Ambient Temperature (T4)",
"device_class": SensorDeviceClass.TEMPERATURE,
"unit": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.discharge_pipe_temperature: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.discharge_pipe_temperature,
"translation_key": "discharge_pipe_temperature",
"name": "Discharge Pipe Temperature (TP)",
"device_class": SensorDeviceClass.TEMPERATURE,
"unit": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT,
},
# group 2: indoor fan and condensate pump
ACAttributes.indoor_fan_speed: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.indoor_fan_speed,
"translation_key": "indoor_fan_speed",
"name": "Indoor Fan Speed",
"icon": "mdi:fan",
"unit": REVOLUTIONS_PER_MINUTE,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.target_indoor_fan_speed: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.target_indoor_fan_speed,
"translation_key": "target_indoor_fan_speed",
"name": "Target Indoor Fan Speed",
"icon": "mdi:fan-clock",
"unit": REVOLUTIONS_PER_MINUTE,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.water_pump_running: {
"type": Platform.BINARY_SENSOR,
"required_attribute": ACAttributes.water_pump_running,
"translation_key": "water_pump_running",
"name": "Water Pump Running",
"icon": "mdi:water-pump",
"device_class": BinarySensorDeviceClass.RUNNING,
},
# group 7: real time compressor power
ACAttributes.compressor_power: {
"type": Platform.SENSOR,
"required_attribute": ACAttributes.compressor_power,
"translation_key": "compressor_power",
"name": "Compressor Power",
"device_class": SensorDeviceClass.POWER,
"unit": UnitOfPower.WATT,
"state_class": SensorStateClass.MEASUREMENT,
},
ACAttributes.wind_lr_angle: {
"type": Platform.SELECT,
"translation_key": "wind_lr_angle",
@@ -592,6 +743,13 @@ MIDEA_DEVICES: dict[int, dict[str, dict[str, Any] | str]] = {
"options": "wind_ud_angles",
"icon": "mdi:pan-vertical",
},
ACAttributes.rate_select: {
"type": Platform.SELECT,
"translation_key": "rate_select",
"name": "Power Rate Limit",
"options": "rate_selects",
"icon": "mdi:lightning-bolt-circle",
},
ACAttributes.fan_speed: {
"type": Platform.NUMBER,
"translation_key": "fan_speed_percent",
@@ -2432,12 +2590,82 @@ MIDEA_DEVICES: dict[int, dict[str, dict[str, Any] | str]] = {
"name": "Storage",
"icon": "mdi:repeat-variant",
},
"start": {
"type": Platform.BUTTON,
"translation_key": "start",
"name": "Start",
"icon": "mdi:play",
"set_message": "e1_start",
"available_power_attribute": E1Attributes.power,
"models": ["7600024L"],
"default": True,
},
E1Attributes.mode: {
"type": Platform.SENSOR,
"translation_key": "mode",
"name": "Working Mode",
"icon": "mdi:dishwasher",
},
"mode_select": {
"type": Platform.SELECT,
"attribute": E1Attributes.mode,
"translation_key": "wash_mode",
"name": "Wash Mode",
"options_dict": "modes",
"options_codes_by_model": {
"7600024L": [13, 4, 8, 6, 2, 11, 10],
},
"set_message": "e1_work_mode",
"available_power_attribute": E1Attributes.power,
"icon": "mdi:dishwasher",
"default": True,
},
"estimated_energy_consumption": {
"type": Platform.SENSOR,
"translation_key": "estimated_energy_consumption",
"name": "Estimated Energy Consumption",
"icon": "mdi:lightning-bolt",
"device_class": SensorDeviceClass.ENERGY,
"unit": UnitOfEnergy.KILO_WATT_HOUR,
"state_class": SensorStateClass.TOTAL_INCREASING,
"estimate": {
"kind": "energy",
"values": {
"Germ": 0.765,
"ECO Wash": 0.99,
"Strong Wash": 1.28,
"Hour Wash": 0.91,
"Soak Wash": 0.02,
"Self Clean": 1.524,
"Fruit Wash": 1.625,
},
},
"models": ["7600024L"],
"default": True,
},
"estimated_water_consumption": {
"type": Platform.SENSOR,
"translation_key": "estimated_water_consumption",
"name": "Estimated Water Consumption",
"icon": "mdi:water",
"device_class": SensorDeviceClass.WATER,
"unit": UnitOfVolume.LITERS,
"state_class": SensorStateClass.TOTAL_INCREASING,
"estimate": {
"kind": "water",
"values": {
"Germ": 9.9,
"ECO Wash": 10.4,
"Strong Wash": 13.9,
"Hour Wash": 10.4,
"Soak Wash": 3.4,
"Self Clean": 10.3,
"Fruit Wash": 13.3,
},
},
"models": ["7600024L"],
"default": True,
},
E1Attributes.error_code: {
"type": Platform.SENSOR,
"translation_key": "error_code",
@@ -2536,6 +2764,18 @@ MIDEA_DEVICES: dict[int, dict[str, dict[str, Any] | str]] = {
"name": "Whole Tank Heating",
"icon": "mdi:restore",
},
E2Attributes.sterilization: {
"type": Platform.SWITCH,
"translation_key": "sterilization",
"name": "Sterilization",
"icon": "mdi:bacteria",
},
E2Attributes.memory: {
"type": Platform.SWITCH,
"translation_key": "memory",
"name": "Memo U",
"icon": "mdi:brain",
},
},
},
0xE3: {
@@ -2951,6 +3191,176 @@ MIDEA_DEVICES: dict[int, dict[str, dict[str, Any] | str]] = {
"unit": UnitOfVolume.LITERS,
"state_class": SensorStateClass.TOTAL_INCREASING,
},
# Soft water machine (water softener) entities
EDAttributes.soften: {
"type": Platform.SWITCH,
"translation_key": "soften",
"name": "Softening",
"icon": "mdi:water-outline",
},
EDAttributes.cl_sterilization: {
"type": Platform.SWITCH,
"translation_key": "cl_sterilization",
"name": "CL Sterilization",
"icon": "mdi:bacteria",
},
EDAttributes.leak_water_protection: {
"type": Platform.SWITCH,
"translation_key": "leak_water_protection",
"name": "Leak Water Protection",
"icon": "mdi:water-alert",
},
EDAttributes.water_way: {
"type": Platform.SWITCH,
"translation_key": "water_way",
"name": "Water Way",
"icon": "mdi:pipe",
},
EDAttributes.regeneration: {
"type": Platform.SWITCH,
"translation_key": "regeneration",
"name": "Regeneration",
"icon": "mdi:refresh",
},
EDAttributes.velocity: {
"type": Platform.SENSOR,
"translation_key": "velocity",
"name": "Velocity",
"icon": "mdi:speedometer",
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.soft_available: {
"type": Platform.SENSOR,
"translation_key": "soft_available",
"name": "Soft Water Available",
"icon": "mdi:water-check",
"unit": UnitOfVolume.LITERS,
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.left_salt: {
"type": Platform.SENSOR,
"translation_key": "left_salt",
"name": "Left Salt",
"icon": "mdi:shaker",
"unit": PERCENTAGE,
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.remaining_days: {
"type": Platform.SENSOR,
"translation_key": "remaining_days",
"name": "Remaining Days",
"icon": "mdi:calendar-clock",
"unit": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.water_hardness: {
"type": Platform.NUMBER,
"translation_key": "water_hardness",
"name": "Water Hardness",
"icon": "mdi:water",
"min": 0,
"max": 65535,
"step": 1,
},
EDAttributes.flushing_days: {
"type": Platform.NUMBER,
"translation_key": "flushing_days",
"name": "Flushing Days",
"icon": "mdi:water",
"unit": UnitOfTime.DAYS,
"min": 0,
"max": 99,
"step": 1,
},
EDAttributes.timing_regeneration_hour: {
"type": Platform.TIME,
"translation_key": "timing_regeneration",
"name": "Timing Regeneration",
"icon": "mdi:clock-outline",
},
EDAttributes.regeneration_left_seconds: {
"type": Platform.SENSOR,
"translation_key": "regeneration_left_seconds",
"name": "Regeneration Left Seconds",
"icon": "mdi:timer",
"unit": UnitOfTime.SECONDS,
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.use_days: {
"type": Platform.SENSOR,
"translation_key": "use_days",
"name": "Use Days",
"icon": "mdi:calendar",
"unit": UnitOfTime.DAYS,
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.salt_setting: {
"type": Platform.SENSOR,
"translation_key": "salt_setting",
"name": "Salt Setting",
"icon": "mdi:shaker-outline",
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.water_consumption_big: {
"type": Platform.SENSOR,
"translation_key": "water_consumption_big",
"name": "Water Consumption",
"icon": "mdi:water-pump",
"unit": UnitOfVolume.LITERS,
"state_class": SensorStateClass.TOTAL_INCREASING,
"suggested_display_precision": 2,
},
EDAttributes.water_consumption_average: {
"type": Platform.SENSOR,
"translation_key": "water_consumption_average",
"name": "Water Consumption Average",
"icon": "mdi:water",
"unit": UnitOfVolume.LITERS,
"state_class": SensorStateClass.MEASUREMENT,
},
EDAttributes.leak_water_protection_value: {
"type": Platform.NUMBER,
"translation_key": "leak_water_protection_value",
"name": "Leak Water Protection Value",
"icon": "mdi:water-alert-outline",
"unit": UnitOfVolume.LITERS,
"min": 0,
"max": 2550,
"step": 50,
},
EDAttributes.leak_water: {
"type": Platform.BINARY_SENSOR,
"translation_key": "leak_water",
"name": "Leak Water",
"icon": "mdi:water-alert",
"device_class": BinarySensorDeviceClass.PROBLEM,
},
EDAttributes.rsj_stand_by: {
"type": Platform.BINARY_SENSOR,
"translation_key": "rsj_stand_by",
"name": "Stand By",
"icon": "mdi:power-standby",
},
EDAttributes.error: {
"type": Platform.SENSOR,
"translation_key": "error",
"name": "Error",
"icon": "mdi:alert-circle",
"device_class": SensorDeviceClass.ENUM,
# Soft water machine (deviceKind=9/10, subtype 703) error codes
# Source: weex.js error dictionary "a"
"options": {
0: "no_error",
1: "e1_position_not_found",
2: "e2_photo_sensor_no_signal",
3: "e3_motor_not_running",
4: "e4_wrong_position",
225: "e1_motor_fault",
229: "e5_communication_fault",
230: "e6_salt_sensor_fault",
231: "e7_chlorine_sterilization_fault",
},
},
},
},
0xFA: {