Skip to content

Commit

Permalink
e2 device and documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
georgezhao2010 committed Oct 6, 2022
1 parent 977f9bc commit 664dfa0
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 20 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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.

This component inspired from the repository at [@mac-zhou](https://github.com/mac-zhou/midea-msmart) which provides similar functionality for Midea air conditioners. This component include verbatim or adapted portions of the code from his great projects.

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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -92,4 +92,10 @@ logger:
default: warn
logs:
custom_components.midea_ac_lan: debug
```
```

# 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)
15 changes: 10 additions & 5 deletions README_hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

通过本地局域网控制你的美的M-Smart设备

- 通过HomeAssistant UI完成设备的自动搜索和配置.
- 通过Home Assistant UI完成设备的自动搜索和配置.
- 生成额外的传感器和开关方便进行设备控制.
- 与设备保持TCP长连接以便实时同步设备状态.

本集成部分技术来源来自 [@mac-zhou](https://github.com/mac-zhou/midea-msmart),他的美的midea-msmart提供了类似的功能。 该组件包括来自他的项目中经过改写的部分代码。

同时感谢[@NeoAcheron](https://github.com/NeoAcheron/midea-ac-py)

***注意: 本集成需要HomeAssistant 2022.5或更高版本***
***注意: 本集成需要Home Assistant 2022.5或更高版本***

# 已支持的品牌

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -92,3 +92,8 @@ logger:
logs:
custom_components.midea_ac_lan: debug
```

# 支持我的工作
如果喜欢这个集成,可以使用支付宝或者微信支付赞助我来支持我的工作。

![alipay](doc/images/alipay.png) ![wechatpay](doc/images/wechatpay.png)
4 changes: 4 additions & 0 deletions custom_components/midea_ac_lan/midea/devices/e2/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 5 additions & 1 deletion custom_components/midea_ac_lan/midea/devices/e2/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
24 changes: 19 additions & 5 deletions custom_components/midea_ac_lan/midea_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,13 +912,27 @@
"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",
"device_class": SensorDeviceClass.POWER,
"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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion doc/AC.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Supports swing mode
- Supports preset mode
- Supports auxiliary heating
- Supports build-in fresh air system

### Supported Run-Modes
- Comfort Mode
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions doc/AC_hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- 支持摆风模式设定
- 支持预设模式设定
- 支持电辅热
- 支持内置新风系统

### 支持的模式
- 舒适模式
Expand All @@ -20,7 +21,6 @@
{"temperature_step": 1}
```


## 生成实体
### 默认生成实体
实体ID | 类型 | 描述
Expand Down Expand Up @@ -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实体控制新风机即可。

## 服务
生成以下扩展服务
Expand Down
3 changes: 3 additions & 0 deletions doc/CE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions doc/CE_hans.md
Original file line number Diff line number Diff line change
@@ -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)***

## 特性
- 支持风速调节
- 支持预设模式
Expand Down
Binary file added doc/images/alipay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/wechatpay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 664dfa0

Please sign in to comment.