mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2025-11-12 16:01:54 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
329fbce3dd | ||
|
|
f9a1f57d31 | ||
|
|
ee6c5b18af |
@@ -23,6 +23,8 @@ Get devices from MSmartHome/Midea Meiju homes through the network and control th
|
||||
- T0x21 Central Air Conditioning Gateway
|
||||
- T0x26 Bath Heater
|
||||
- T0x3D Water Heater
|
||||
- T0x9B Steam oven
|
||||
- T0x9C Integrated Gas Stove
|
||||
- T0xA1 Dehumidifier
|
||||
- T0xAC Air Conditioner
|
||||
- T0xB2 Electric Steamer
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
- T0x21 中央空调网关
|
||||
- T0x26 浴霸
|
||||
- T0x3D 电热水瓶
|
||||
- T0x9B 蒸烤箱
|
||||
- T0x9C 集成灶
|
||||
- T0xA1 除湿机
|
||||
- T0xAC 空调
|
||||
- T0xB2 电蒸箱
|
||||
|
||||
@@ -361,11 +361,8 @@ class MeijuCloud(MideaCloud):
|
||||
command_data = {
|
||||
"nodeid": nodeid,
|
||||
"acattri_ctrl": {
|
||||
"aclist": [{
|
||||
"nodeid": nodeid,
|
||||
"modelid": modelid,
|
||||
"type": idtype
|
||||
}],
|
||||
"nodeid": nodeid,
|
||||
"modelid": modelid, "type": idtype, "aclist_data": nodeid[-2:],
|
||||
"event": control
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,17 @@ class MideaCodec(LuaRuntime):
|
||||
query_dict["control"]["bucket"] = prefix
|
||||
else:
|
||||
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)
|
||||
MideaLogger.debug(f"LuaRuntime json_str {json_str}")
|
||||
try:
|
||||
|
||||
20
custom_components/midea_auto_cloud/device_mapping/T0x9B.py
Normal file
20
custom_components/midea_auto_cloud/device_mapping/T0x9B.py
Normal 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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
86
custom_components/midea_auto_cloud/device_mapping/T0x9C.py
Normal file
86
custom_components/midea_auto_cloud/device_mapping/T0x9C.py
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,6 +349,27 @@
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"name": "Warm Target Temperature"
|
||||
},
|
||||
@@ -1509,12 +1530,20 @@
|
||||
"name": "Light"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
"b6_lightness": {
|
||||
"name": "Smoke Machine Lightness"
|
||||
}
|
||||
},
|
||||
"fan": {
|
||||
"fan": {
|
||||
"name": "Fan"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"b6_light": {
|
||||
"name": "Smoke Machine Light"
|
||||
},
|
||||
"temp_wind_switch": {
|
||||
"name": "Wind Change with Temperature"
|
||||
},
|
||||
|
||||
@@ -353,6 +353,27 @@
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"name": "保温目标温度"
|
||||
},
|
||||
@@ -1513,12 +1534,20 @@
|
||||
"name": "电灯"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
"b6_lightness": {
|
||||
"name": "烟机照明"
|
||||
}
|
||||
},
|
||||
"fan": {
|
||||
"fan": {
|
||||
"name": "风扇"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"b6_light": {
|
||||
"name": "烟机灯"
|
||||
},
|
||||
"temp_wind_switch": {
|
||||
"name": "风随温变"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user