Skip to content

Commit

Permalink
add a error code sensor for C3
Browse files Browse the repository at this point in the history
  • Loading branch information
georgezhao2010 committed Oct 16, 2023
1 parent c517ced commit 37ae40f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/midea_ac_lan/midea/devices/c3/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class DeviceAttributes(StrEnum):
silent_mode = "silent_mode"
eco_mode = "eco_mode"
tbh = "tbh"
error_code = "error_code"


class MideaC3Device(MiedaDevice):
Expand Down Expand Up @@ -117,7 +118,8 @@ def __init__(
DeviceAttributes.status_heating: None,
DeviceAttributes.status_ibh: None,
DeviceAttributes.total_produced_energy: None,
DeviceAttributes.outdoor_temperature: None
DeviceAttributes.outdoor_temperature: None,
DeviceAttributes.error_code: 0
})

def build_query(self):
Expand Down
1 change: 1 addition & 0 deletions custom_components/midea_ac_lan/midea/devices/c3/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def __init__(self, body, data_offset=0):
self.dhw_temp_max = body[data_offset + 19]
self.dhw_temp_min = body[data_offset + 20]
self.tank_actual_temperature = body[data_offset + 21]
self.error_code = body[data_offset + 22]


class C3Notify1MessageBody(MessageBody):
Expand Down
5 changes: 5 additions & 0 deletions custom_components/midea_ac_lan/midea_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,11 @@
"icon": "mdi:home-thermometer-outline",
"device_class": BinarySensorDeviceClass.RUNNING,
},
C3Attributes.error_code: {
"type": Platform.SENSOR,
"name": "Error Code",
"icon": "mdi:alpha-e-circle"
},
C3Attributes.tank_actual_temperature: {
"type": Platform.SENSOR,
"name": "Tank Actual Temperature",
Expand Down
1 change: 1 addition & 0 deletions doc/C3.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
| binary_sensor.{DEVICEID}_zone2_room_temp_mode | binary_sensor | Zone2 Room Temperature Mode |
| binary_sensor.{DEVICEID}_status_ibh | binary_sensor | IBH Status |
| binary_sensor.{DEVICEID}_status_heating | binary_sensor | Heating Status |
| sensor.{DEVICEID}_error_code | sensor | Error Code |
| sensor.{DEVICEID}_tank_actual_temperature | sensor | Tank Actual Temperature |
| sensor.{DEVICEID}_total_energy_consumption | sensor | Total Energy Consumption.</br>The first value may be delayed because updates are only sent when the device is active |
| sensor.{DEVICEID}_total_produced_energy | sensor | Total Produced Energy |
Expand Down
1 change: 1 addition & 0 deletions doc/C3_hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
| binary_sensor.{DEVICEID}_zone2_room_temp_mode | binary_sensor | Zone2 Room Temperature Mode | 区域2室温模式 |
| binary_sensor.{DEVICEID}_status_ibh | binary_sensor | IBH Status | IBH状态 |
| binary_sensor.{DEVICEID}_status_heating | binary_sensor | Heating Status | 加热状态 |
| sensor.{DEVICEID}_error_code | sensor | Error Code | 错误码 |
| sensor.{DEVICEID}_tank_actual_temperature | sensor | Tank Actual Temperature | 水箱实际温度 |
| sensor.{DEVICEID}_total_energy_consumption | sensor | Total Energy Consumption | 总能耗。</br>第一个值可能会延迟,因为更新仅在设备处于活动状态时发送 |
| sensor.{DEVICEID}_total_produced_energy | sensor | Total Produced Energy | 总计产生能量 |
Expand Down

0 comments on commit 37ae40f

Please sign in to comment.