diff --git a/README.md b/README.md index ee62885e..5cf6d7ec 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ English | [简体中文](README_hans.md) Control your Midea M-Smart appliances via local area network. -- Automated device discover and configuration based HA config flow UI. +- Automated device discover and configuration based Home Assistant config flow UI. - Extra sensors and switches. - Synchronize status with the appliance by long TCP connection in time. @@ -15,7 +15,7 @@ This component inspired from the repository at [@mac-zhou](https://github.com/ma Thanks also to [@NeoAcheron](https://github.com/NeoAcheron/midea-ac-py). -***Note: HomeAssistant 2022.5 or higher requied for this integration*** +***Note: Home Assistant 2022.5 or higher requied for this integration*** # Supported brands @@ -50,12 +50,12 @@ And more. FD | Humidifier | [FD.md](doc/FD.md) # Installation -Search 'Midea AC LAN' in HACS and install, or copy all files in `custom_components/midea_ac_lan` from [Latest Release](https://github.com/georgezhao2010/midea_ac_lan/releases/latest) to your `/custom_components/midea_ac_lan` in HomeAssistant manually. +Search 'Midea AC LAN' in HACS and install, or copy all files in `custom_components/midea_ac_lan` from [Latest Release](https://github.com/georgezhao2010/midea_ac_lan/releases/latest) to your `/custom_components/midea_ac_lan` in Home Assistant manually. -Restart HomeAssistant. +Restart Home Assistant. # Configuration -After installation, search and add component Midea AC LAN in HomeAssistant integrations page. +After installation, search and add component Midea AC LAN in Home Assistant integrations page. Or click [![Configuration](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start?domain=midea_ac_lan) @@ -92,4 +92,10 @@ logger: default: warn logs: custom_components.midea_ac_lan: debug -``` \ No newline at end of file +``` + +# Support my works + +If you like this integration, why do not you support my works by buying me a coffee? + +[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/georgezhao2010) \ No newline at end of file diff --git a/README_hans.md b/README_hans.md index 957e0373..2750d1db 100644 --- a/README_hans.md +++ b/README_hans.md @@ -7,7 +7,7 @@ 通过本地局域网控制你的美的M-Smart设备 -- 通过HomeAssistant UI完成设备的自动搜索和配置. +- 通过Home Assistant UI完成设备的自动搜索和配置. - 生成额外的传感器和开关方便进行设备控制. - 与设备保持TCP长连接以便实时同步设备状态. @@ -15,7 +15,7 @@ 同时感谢[@NeoAcheron](https://github.com/NeoAcheron/midea-ac-py) -***注意: 本集成需要HomeAssistant 2022.5或更高版本*** +***注意: 本集成需要Home Assistant 2022.5或更高版本*** # 已支持的品牌 @@ -50,12 +50,12 @@ FD | 加湿器 | [FD_hans.md](doc/FD_hans.md) # 安装 -在HACS中搜索'Midea AC LAN'并安装,或者从[Latest release](https://github.com/georgezhao2010/midea_ac_lan/releases/latest)下载最新的Release版本,将其中的`custom_components/midea_ac_lan`放到你的HomeAssistant的`custom_components/midea_ac_lan`中。 +在HACS中搜索'Midea AC LAN'并安装,或者从[Latest release](https://github.com/georgezhao2010/midea_ac_lan/releases/latest)下载最新的Release版本,将其中的`custom_components/midea_ac_lan`放到你的Home Assistant的`custom_components/midea_ac_lan`中。 -重启HomeAssistant +重启Home Assistant # 配置 -安装之后,在HomeAssistant的集成界面搜索添加集成Midea AC LAN, 如果需要添加多台设备,多次添加本集成并执行自动配置即可。 +安装之后,在Home Assistant的集成界面搜索添加集成Midea AC LAN, 如果需要添加多台设备,多次添加本集成并执行自动配置即可。 或者直接点击 [![Configuration](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start?domain=midea_ac_lan) @@ -92,3 +92,8 @@ logger: logs: custom_components.midea_ac_lan: debug ``` + +# 支持我的工作 +如果喜欢这个集成,可以使用支付宝或者微信支付赞助我来支持我的工作。 + +![alipay](doc/images/alipay.png) ![wechatpay](doc/images/wechatpay.png) \ No newline at end of file diff --git a/custom_components/midea_ac_lan/midea/devices/e2/device.py b/custom_components/midea_ac_lan/midea/devices/e2/device.py index f3dfa6f4..0db59dd6 100644 --- a/custom_components/midea_ac_lan/midea/devices/e2/device.py +++ b/custom_components/midea_ac_lan/midea/devices/e2/device.py @@ -21,6 +21,8 @@ class DeviceAttributes(StrEnum): target_temperature = "target_temperature" whole_tank_heating = "whole_tank_heating" variable_heating = "variable_heating" + heating_time_remaining = "heating_time_remaining" + water_consumption = "water_consumption" heating_power = "heating_power" @@ -57,6 +59,8 @@ def __init__( DeviceAttributes.target_temperature: 40, DeviceAttributes.whole_tank_heating: False, DeviceAttributes.variable_heating: False, + DeviceAttributes.heating_time_remaining: 0, + DeviceAttributes.water_consumption: None DeviceAttributes.heating_power: None } diff --git a/custom_components/midea_ac_lan/midea/devices/e2/message.py b/custom_components/midea_ac_lan/midea/devices/e2/message.py index 56d639ae..2fbfb7da 100644 --- a/custom_components/midea_ac_lan/midea/devices/e2/message.py +++ b/custom_components/midea_ac_lan/midea/devices/e2/message.py @@ -118,9 +118,13 @@ def __init__(self, body): self.variable_heating = (body[2] & 0x80) > 0 self.current_temperature = body[4] self.whole_tank_heating = (body[7] & 0x08) > 0 + self.heating_time_remaining = body[9] * 60 + body[10] self.target_temperature = body[11] self.protection = ((body[22] & 0x02) > 0) if len(body) > 22 else False - self.heating_power = body[28] + if len(body) > 25: + self.water_consumption = body[24] + (body[25] << 8) + if len(body) > 34: + self.heating_power = body[34] * 100 class MessageE2Response(MessageResponse): diff --git a/custom_components/midea_ac_lan/midea_devices.py b/custom_components/midea_ac_lan/midea_devices.py index d91fc24b..5c35730b 100644 --- a/custom_components/midea_ac_lan/midea_devices.py +++ b/custom_components/midea_ac_lan/midea_devices.py @@ -912,6 +912,13 @@ "unit": TEMP_CELSIUS, "state_class": SensorStateClass.MEASUREMENT }, + E2Attributes.heating_time_remaining: { + "type": "sensor", + "name": "Heating Time Remaining", + "icon": "mdi:progress-clock", + "unit": TIME_MINUTES, + "state_class": SensorStateClass.MEASUREMENT + }, E2Attributes.heating_power: { "type": "sensor", "name": "Heating Power", @@ -919,6 +926,13 @@ "unit": POWER_WATT, "state_class": SensorStateClass.MEASUREMENT }, + E2Attributes.water_consumption:{ + "type": "sensor", + "name": "Water Consumption", + "icon": "mdi:water", + "unit": VOLUME_LITERS, + "state_class": SensorStateClass.TOTAL_INCREASING + }, E2Attributes.power: { "type": "switch", "name": "Power", @@ -1260,11 +1274,6 @@ "name": "Anion", "icon": "mdi:vanish" }, - FCAttributes.standby: { - "type": "switch", - "name": "Standby", - "icon": "mdi:smoke-detector-variant" - }, FCAttributes.prompt_tone: { "type": "switch", "name": "Prompt Tone", @@ -1275,6 +1284,11 @@ "name": "Power", "icon": "mdi:power" }, + FCAttributes.standby: { + "type": "switch", + "name": "Standby", + "icon": "mdi:smoke-detector-variant" + }, FCAttributes.detect_mode: { "type": "select", "name": "Detect Mode", diff --git a/doc/AC.md b/doc/AC.md index 26586c2a..2d321526 100644 --- a/doc/AC.md +++ b/doc/AC.md @@ -6,6 +6,7 @@ - Supports swing mode - Supports preset mode - Supports auxiliary heating +- Supports build-in fresh air system ### Supported Run-Modes - Comfort Mode @@ -37,7 +38,7 @@ sensor.{DEVICEID}_outdoor_temperature | sensor | Outdoor Temperature sensor.{DEVICEID}_total_energy_consumption | sensor | Total Energy Consumption sensor.{DEVICEID}_current_energy_consumption | sensor | Current Energy Consumption sensor.{DEVICEID}_realtime_power | sensor | Realtime Power -fan.{DEVICEID}_fresh_air | fan | Fresh Air +fan.{DEVICEID}_fresh_air | fan | Fresh Air Fan switch.{DEVICEID}_aux_heat | switch | Aux Heating switch.{DEVICEID}_boost_mode | switch | Boost Mode switch.{DEVICEID}_breezeless | switch | Breezeless @@ -53,6 +54,9 @@ switch.{DEVICEID}_smart_eye | switch | Smart Eye switch.{DEVICEID}_swing_horizontal | switch | Swing Horizontal switch.{DEVICEID}_swing_vertical | switch | Swing Vertical +## Build-in fresh air system + +Some Midea appliance be named "Fresh Air Appliance", the protocol that actually uses the air conditioner. If your fresh air appliance is identified as an air conditioner, you should check the Fresh Air Fan entity in CONFIGURE, and use this fan entity to control your fresh air appliance.*** ## Services following extra services will be made diff --git a/doc/AC_hans.md b/doc/AC_hans.md index 2e6e9d9a..0b161a96 100644 --- a/doc/AC_hans.md +++ b/doc/AC_hans.md @@ -6,6 +6,7 @@ - 支持摆风模式设定 - 支持预设模式设定 - 支持电辅热 +- 支持内置新风系统 ### 支持的模式 - 舒适模式 @@ -20,7 +21,6 @@ {"temperature_step": 1} ``` - ## 生成实体 ### 默认生成实体 实体ID | 类型 | 描述 @@ -53,7 +53,10 @@ switch.{DEVICEID}_screen_display | switch | Screen Display | 屏幕显示 switch.{DEVICEID}_smart_eye | switch | Smart Eye | 智慧眼 switch.{DEVICEID}_swing_horizontal | switch | Swing Horizontal | 水平摆风 switch.{DEVICEID}_swing_vertical | switch | Swing Vertical | 垂直摆风 -select.{DEVICEID}_fresh_air | select | Fresh Air | 新风 + +## 内置新风系统 + +部分美的的"中央新风机"产品,其实使用了空调的协议。如果你的新风机被识别为空调,则只用在选项中勾选"Fresh Air"的fan实体,然后使用该fan实体控制新风机即可。 ## 服务 生成以下扩展服务 diff --git a/doc/CE.md b/doc/CE.md index ce723d12..7470ad37 100644 --- a/doc/CE.md +++ b/doc/CE.md @@ -1,4 +1,7 @@ # Fresh Air Appliance + +***Note: Some Midea appliance be named "Fresh Air Appliance", the protocol that actually uses the air conditioner. If your fresh air appliance is identified as an air conditioner, check out [Build-in fresh air system](CE.md#Build-in%20fresh%20air%20system)*** + ## Features - Supports fan speed - Supports preset mode diff --git a/doc/CE_hans.md b/doc/CE_hans.md index 196699ad..0afbb5db 100644 --- a/doc/CE_hans.md +++ b/doc/CE_hans.md @@ -1,4 +1,7 @@ # 新风机 + +***注意:部分美的的"中央新风机"产品,其实使用了空调的协议。如果你的新风机被识别为空调,参阅[内置新风系统](AC_hans.md#%E5%86%85%E7%BD%AE%E6%96%B0%E9%A3%8E%E7%B3%BB%E7%BB%9F)*** + ## 特性 - 支持风速调节 - 支持预设模式 diff --git a/doc/images/alipay.png b/doc/images/alipay.png new file mode 100644 index 00000000..0dbe29dc Binary files /dev/null and b/doc/images/alipay.png differ diff --git a/doc/images/wechatpay.png b/doc/images/wechatpay.png new file mode 100644 index 00000000..a1e468ae Binary files /dev/null and b/doc/images/wechatpay.png differ