3 Commits

Author SHA1 Message Date
sususweet
329fbce3dd feat: add support for T0x9B. Fixed #35. 2025-11-02 16:13:33 +08:00
sususweet
f9a1f57d31 feat: add support for T0x9C. 2025-11-02 16:02:21 +08:00
sususweet
ee6c5b18af feat: update central ac control protocol 2025-11-02 00:37:32 +08:00
8 changed files with 181 additions and 5 deletions

View File

@@ -23,6 +23,8 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th
- T0x21 Central Air Conditioning Gateway - T0x21 Central Air Conditioning Gateway
- T0x26 Bath Heater - T0x26 Bath Heater
- T0x3D Water Heater - T0x3D Water Heater
- T0x9B Steam oven
- T0x9C Integrated Gas Stove
- T0xA1 Dehumidifier - T0xA1 Dehumidifier
- T0xAC Air Conditioner - T0xAC Air Conditioner
- T0xB2 Electric Steamer - T0xB2 Electric Steamer

View File

@@ -23,6 +23,8 @@
- T0x21 中央空调网关 - T0x21 中央空调网关
- T0x26 浴霸 - T0x26 浴霸
- T0x3D 电热水瓶 - T0x3D 电热水瓶
- T0x9B 蒸烤箱
- T0x9C 集成灶
- T0xA1 除湿机 - T0xA1 除湿机
- T0xAC 空调 - T0xAC 空调
- T0xB2 电蒸箱 - T0xB2 电蒸箱

View File

@@ -361,11 +361,8 @@ class MeijuCloud(MideaCloud):
command_data = { command_data = {
"nodeid": nodeid, "nodeid": nodeid,
"acattri_ctrl": { "acattri_ctrl": {
"aclist": [{ "nodeid": nodeid,
"nodeid": nodeid, "modelid": modelid, "type": idtype, "aclist_data": nodeid[-2:],
"modelid": modelid,
"type": idtype
}],
"event": control "event": control
} }
} }

View File

@@ -87,6 +87,17 @@ class MideaCodec(LuaRuntime):
query_dict["control"]["bucket"] = prefix query_dict["control"]["bucket"] = prefix
else: else:
query_dict["control"]["bucket"] = "db" query_dict["control"]["bucket"] = "db"
# 针对T0x9C集成灶特殊处理
elif self._device_type == "T0x9C":
control_keys = list(append.keys())
if len(control_keys) > 0:
# 从第一个键名中提取前缀,例如从 'db_power' 中提取 'db'
first_key = control_keys[0]
prefix = first_key.split("_")[0]
else:
prefix = "total"
query_dict["control"]["type"] = prefix
json_str = json.dumps(query_dict) json_str = json.dumps(query_dict)
MideaLogger.debug(f"LuaRuntime json_str {json_str}") MideaLogger.debug(f"LuaRuntime json_str {json_str}")
try: try:

View File

@@ -0,0 +1,20 @@
from homeassistant.const import Platform, UnitOfTemperature, UnitOfVolume, UnitOfTime, PERCENTAGE, PRECISION_HALVES, \
UnitOfEnergy, UnitOfPower, PRECISION_WHOLE, UnitOfPressure
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.switch import SwitchDeviceClass
DEVICE_MAPPING = {
"default": {
"rationale": ["off", "on"],
"queries": [{}],
"centralized": [],
"entities": {
Platform.SENSOR: {
"work_status": {
"device_class": SensorDeviceClass.ENUM,
}
}
}
}
}

View File

@@ -0,0 +1,86 @@
from homeassistant.const import Platform, UnitOfTemperature, UnitOfVolume, UnitOfTime, PERCENTAGE, PRECISION_HALVES, \
UnitOfEnergy, UnitOfPower, PRECISION_WHOLE, UnitOfPressure
from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.switch import SwitchDeviceClass
DEVICE_MAPPING = {
"default": {
"rationale": ["off", "on"],
"queries": [{}],
"centralized": ["b6_light"],
"entities": {
Platform.NUMBER: {
"b6_lightness": {
"min": 0,
"max": 100,
"step": 1
}
},
Platform.SWITCH: {
"b6_light": {
"device_class": SwitchDeviceClass.SWITCH,
},
},
Platform.SELECT: {
"b6_gear": {
"options": {
"": {"b6_gear": "0"},
"": {"b6_gear": "1"},
"": {"b6_gear": "2"},
"": {"b6_gear": "3"},
"爆炒": {"b6_gear": "4"}
}
},
"b6_power_on_light": {
"options": {
"": {"b6_power_on_light": "off", "b6_setting": "power_on_light"},
"": {"b6_power_on_light": "on", "b6_setting": "power_on_light"}
}
},
"b6_lock": {
"options": {
"": {"b6_lock": "off", "b6_setting": "lock"},
"": {"b6_lock": "on", "b6_setting": "lock"}
}
},
"b6_smoke_stove_linkage_gear": {
"options": {
"1档": {"b6_smoke_stove_linkage_gear": 1, "b6_setting": "smoke_stove_linkage"},
"2档": {"b6_smoke_stove_linkage_gear": 2, "b6_setting": "smoke_stove_linkage"},
"3档": {"b6_smoke_stove_linkage_gear": 3, "b6_setting": "smoke_stove_linkage"},
}
},
"b6_delay_gear_linkage_gear": {
"options": {
"1档": {"b6_delay_gear_linkage_gear": 1, "b6_setting": "delay_gear_linkage"},
"2档": {"b6_delay_gear_linkage_gear": 2, "b6_setting": "delay_gear_linkage"},
"3档": {"b6_delay_gear_linkage_gear": 3, "b6_setting": "delay_gear_linkage"},
}
},
"b6_delay_time_value": {
"options": {
"": {"b6_delay_time": "off", "b6_setting": "delay_time"},
"1分钟": {"b6_delay_time": "on", "b6_delay_time_value": 1, "b6_setting": "delay_time"},
"2分钟": {"b6_delay_time": "on", "b6_delay_time_value": 2, "b6_setting": "delay_time"},
"3分钟": {"b6_delay_time": "on", "b6_delay_time_value": 3, "b6_setting": "delay_time"},
"4分钟": {"b6_delay_time": "on", "b6_delay_time_value": 4, "b6_setting": "delay_time"},
"5分钟": {"b6_delay_time": "on", "b6_delay_time_value": 5, "b6_setting": "delay_time"},
"6分钟": {"b6_delay_time": "on", "b6_delay_time_value": 6, "b6_setting": "delay_time"},
"7分钟": {"b6_delay_time": "on", "b6_delay_time_value": 7, "b6_setting": "delay_time"},
"8分钟": {"b6_delay_time": "on", "b6_delay_time_value": 8, "b6_setting": "delay_time"},
"9分钟": {"b6_delay_time": "on", "b6_delay_time_value": 9, "b6_setting": "delay_time"},
"10分钟": {"b6_delay_time": "on", "b6_delay_time_value": 10, "b6_setting": "delay_time"},
}
}
},
Platform.SENSOR: {
"b6_wind_pressure": {
"device_class": SensorDeviceClass.PRESSURE,
"unit_of_measurement": UnitOfPressure.PA,
"state_class": SensorStateClass.MEASUREMENT
}
}
}
}
}

View File

@@ -349,6 +349,27 @@
} }
}, },
"select": { "select": {
"b6_power": {
"name": "Smoke Machine Power"
},
"b6_power_on_light": {
"name": "Smoke Machine Power On Light"
},
"b6_lock": {
"name": "Smoke Machine Lock"
},
"b6_gear": {
"name": "Smoke Machine Gear"
},
"b6_smoke_stove_linkage_gear": {
"name": "Smoke Stove Linkage Gear"
},
"b6_delay_gear_linkage_gear": {
"name": "Smoke Machine Delay Gear Linkage Gear"
},
"b6_delay_time_value": {
"name": "Smoke Machine Delay Time (Minute)"
},
"warm_target_temp": { "warm_target_temp": {
"name": "Warm Target Temperature" "name": "Warm Target Temperature"
}, },
@@ -1509,12 +1530,20 @@
"name": "Light" "name": "Light"
} }
}, },
"number": {
"b6_lightness": {
"name": "Smoke Machine Lightness"
}
},
"fan": { "fan": {
"fan": { "fan": {
"name": "Fan" "name": "Fan"
} }
}, },
"switch": { "switch": {
"b6_light": {
"name": "Smoke Machine Light"
},
"temp_wind_switch": { "temp_wind_switch": {
"name": "Wind Change with Temperature" "name": "Wind Change with Temperature"
}, },

View File

@@ -353,6 +353,27 @@
} }
}, },
"select": { "select": {
"b6_power": {
"name": "烟机开关"
},
"b6_power_on_light": {
"name": "烟机开机开灯"
},
"b6_lock": {
"name": "烟机锁屏"
},
"b6_gear": {
"name": "烟机档位"
},
"b6_smoke_stove_linkage_gear": {
"name": "烟灶联动档位"
},
"b6_delay_gear_linkage_gear": {
"name": "烟机延时关机风速档位"
},
"b6_delay_time_value": {
"name": "烟机延时关机时间(分钟)"
},
"warm_target_temp": { "warm_target_temp": {
"name": "保温目标温度" "name": "保温目标温度"
}, },
@@ -1513,12 +1534,20 @@
"name": "电灯" "name": "电灯"
} }
}, },
"number": {
"b6_lightness": {
"name": "烟机照明"
}
},
"fan": { "fan": {
"fan": { "fan": {
"name": "风扇" "name": "风扇"
} }
}, },
"switch": { "switch": {
"b6_light": {
"name": "烟机灯"
},
"temp_wind_switch": { "temp_wind_switch": {
"name": "风随温变" "name": "风随温变"
}, },