georgezhao2010 / midea_ac_lan

Auto-configure and then control your Midea M-Smart devices (Air conditioner, Fan, Water heater, Washer, etc) via local area network.
MIT License
1.42k stars 233 forks source link

请求支持 美的 空气能热水器 #189

Closed coolmaxter closed 1 year ago

coolmaxter commented 1 year ago

请帮忙支持 美的的空气能热水器, 可以帮助debug/test/抓包 型号:RSJ18RD Type: CD

hhchaobin commented 1 year ago

赞同,希望增加空气能热水器,省得跑楼顶看温度洗澡

ootank2018 commented 1 year ago

赞同,等了好久了,哪怕初期只显示温度也可以接受

CatSamaDD commented 1 year ago

我想请求支持美的空气能热水器的wifi线控器,如果有需要可以免费包邮提供线控器实物用于测试

georgezhao2010 commented 1 year ago

会考虑添加该类型的,我以为基本没人用这个产品呢

georgezhao2010 commented 1 year ago

请有空气能热水器的将自己的产品类型(空气能热水器CD),品牌,型号,SN发到我邮箱

georgezhao2010 commented 1 year ago

除了基本的热水器功能(设定温度,显示当前温度等),你们空气能热水器还希望获得哪些传感器数值或者额外的开关呢?

georgezhao2010 commented 1 year ago

已于更新 https://github.com/georgezhao2010/midea_ac_lan/commit/ac04f543239336aa4c736f9fac0393490398e381 (v0.3.19-beta3) 中支持,请Clone本项目代码进行试用, 看看有什么问题。

CatSamaDD commented 1 year ago

QQ截图20230825034544 试用了,空气能热水器wifi线控器,型号:KJRH-86A2/ND,目前看是能搜索并添加设备。但是添加后仅有3个传感器实体,无任何开关,且传感器状态未知。

2023-08-25 03:50:30.146 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Received broadcast from ('192.168.0.108', 6445): 837000c8200f00005a5a0111b8007a8000000000195c3203190817147de50e0000a30000000000000000018000000000b905fb1292299b389c1abf42fb85b7aabff6d72113984260ef22e9c4dbaf53d1f3078927690d2da96ab0d29a0bd8f8e4e84840b4236bc19aefd3b0a994b2e792c14cbfd850727c911861001dc093eaae9d7c3acf9c4574034398068744680f584bdfb3e16e33d88768cc4c3d0658937d96fbcce99f70c976413c2f05f60f82e7109fae88ac65141270367e13c56fbe0823373ac0e3292c1c805f07a9a28a3484 2023-08-25 03:50:30.146 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Declassified reply: 6c00a8c02c1900003030303043443331313030304b383641323133313642313030323631504c57500d6d696465615f63645f3032363100009f0002000000100000000000cd00ba0000000000382187a893fd058701052017010300000000000000000000000000000000000000000000000000000000000000000000 2023-08-25 03:50:30.146 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Found a supported device: {'device_id': 179220396303741, 'type': 205, 'ip_address': '192.168.0.108', 'port': 6444, 'model': '000K86A2', 'sn': '0000CD311000K86A21316B100261PLWP', 'protocol': 3}

2023-08-25 03:50:30.187 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Received broadcast from ('192.168.0.108', 6445): 837000c8200f00005a5a0111b8007a8000000000445c3203190817147de50e0000a30000000000000000018000000000b905fb1292299b389c1abf42fb85b7aabff6d72113984260ef22e9c4dbaf53d1f3078927690d2da96ab0d29a0bd8f8e4e84840b4236bc19aefd3b0a994b2e792c14cbfd850727c911861001dc093eaae9d7c3acf9c4574034398068744680f584bdfb3e16e33d88768cc4c3d0658937d96fbcce99f70c976413c2f05f60f82e7cc67b411a71e9a91f520c17fe483f2ff23373ac0e3292c1c805f07a9a28a3484 2023-08-25 03:50:36.904 DEBUG (MainThread) [custom_components.midea_ac_lan.config_flow] Try to using saved token and key, token: C956E9B842731B780ECACF6AFE243BF9F2E0443104EC0B8B88ED5F0ED415F96586313780A65940DDBEBF44D3741BD5A26EA3DB7152DFC3335026600C39E7A3AD, key: AE8ED4A8C0044D688B9540416BBC6DB8EEA11E595C2F459B95CDFE870688F673 2023-08-25 03:50:36.905 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:36.917 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:36.918 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:36.991 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:36.991 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:50:38.127 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:38.140 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:38.140 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:38.215 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:38.215 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:50:38.218 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:38.245 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:38.245 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:38.346 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:38.347 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:38.608 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000003', 'body': '010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:38.608 ERROR (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Error in process message, msg = aa2dcd00000000000003010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004ef 2023-08-25 03:50:38.609 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa1ccd000000000000a0', 'body': '000000000000000000000000000000000000', 'message type': 'a0', 'body type': '00'} 2023-08-25 03:50:38.861 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Received: {'header': 'aa0ccd000000000000a0', 'body': '00cd', 'message type': 'a0', 'body type': '00'} 2023-08-25 03:50:38.861 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Subtype: 0. Device protocol version: 0 2023-08-25 03:50:38.861 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:50:48.864 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Socket error OSError(9, 'Bad file descriptor') 2023-08-25 03:50:48.864 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:48.888 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:48.888 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:48.986 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:48.986 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:49.262 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000003', 'body': '010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:49.262 ERROR (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Error in process message, msg = aa2dcd00000000000003010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004ef 2023-08-25 03:50:49.263 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:51:19.474 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 03:51:19.789 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000003', 'body': '010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004', 'message type': '03', 'body type': '01'} 2023-08-25 03:51:19.789 ERROR (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Error in process message, msg = aa2dcd00000000000003010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004ef

georgezhao2010 commented 1 year ago

QQ截图20230825034544 试用了,空气能热水器wifi线控器,型号:KJRH-86A2/ND,目前看是能搜索并添加设备。但是添加后仅有3个传感器实体,无任何开关,且传感器状态未知。

2023-08-25 03:50:30.146 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Received broadcast from ('192.168.0.108', 6445): 837000c8200f00005a5a0111b8007a8000000000195c3203190817147de50e0000a30000000000000000018000000000b905fb1292299b389c1abf42fb85b7aabff6d72113984260ef22e9c4dbaf53d1f3078927690d2da96ab0d29a0bd8f8e4e84840b4236bc19aefd3b0a994b2e792c14cbfd850727c911861001dc093eaae9d7c3acf9c4574034398068744680f584bdfb3e16e33d88768cc4c3d0658937d96fbcce99f70c976413c2f05f60f82e7109fae88ac65141270367e13c56fbe0823373ac0e3292c1c805f07a9a28a3484 2023-08-25 03:50:30.146 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Declassified reply: 6c00a8c02c1900003030303043443331313030304b383641323133313642313030323631504c57500d6d696465615f63645f3032363100009f0002000000100000000000cd00ba0000000000382187a893fd058701052017010300000000000000000000000000000000000000000000000000000000000000000000 2023-08-25 03:50:30.146 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Found a supported device: {'device_id': 179220396303741, 'type': 205, 'ip_address': '192.168.0.108', 'port': 6444, 'model': '000K86A2', 'sn': '0000CD311000K86A21316B100261PLWP', 'protocol': 3}

2023-08-25 03:50:30.187 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.discover] Received broadcast from ('192.168.0.108', 6445): 837000c8200f00005a5a0111b8007a8000000000445c3203190817147de50e0000a30000000000000000018000000000b905fb1292299b389c1abf42fb85b7aabff6d72113984260ef22e9c4dbaf53d1f3078927690d2da96ab0d29a0bd8f8e4e84840b4236bc19aefd3b0a994b2e792c14cbfd850727c911861001dc093eaae9d7c3acf9c4574034398068744680f584bdfb3e16e33d88768cc4c3d0658937d96fbcce99f70c976413c2f05f60f82e7cc67b411a71e9a91f520c17fe483f2ff23373ac0e3292c1c805f07a9a28a3484 2023-08-25 03:50:36.904 DEBUG (MainThread) [custom_components.midea_ac_lan.config_flow] Try to using saved token and key, token: C956E9B842731B780ECACF6AFE243BF9F2E0443104EC0B8B88ED5F0ED415F96586313780A65940DDBEBF44D3741BD5A26EA3DB7152DFC3335026600C39E7A3AD, key: AE8ED4A8C0044D688B9540416BBC6DB8EEA11E595C2F459B95CDFE870688F673 2023-08-25 03:50:36.905 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:36.917 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:36.918 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:36.991 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:36.991 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:50:38.127 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:38.140 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:38.140 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:38.215 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:38.215 DEBUG (MainThread) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:50:38.218 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:38.245 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:38.245 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:38.346 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:38.347 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:38.608 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000003', 'body': '010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:38.608 ERROR (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Error in process message, msg = aa2dcd00000000000003010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004ef 2023-08-25 03:50:38.609 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa1ccd000000000000a0', 'body': '000000000000000000000000000000000000', 'message type': 'a0', 'body type': '00'} 2023-08-25 03:50:38.861 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Received: {'header': 'aa0ccd000000000000a0', 'body': '00cd', 'message type': 'a0', 'body type': '00'} 2023-08-25 03:50:38.861 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Subtype: 0. Device protocol version: 0 2023-08-25 03:50:38.861 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:50:48.864 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Socket error OSError(9, 'Bad file descriptor') 2023-08-25 03:50:48.864 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connecting to 192.168.0.108:6444 2023-08-25 03:50:48.888 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Connected 2023-08-25 03:50:48.888 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Handshaking 2023-08-25 03:50:48.986 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Authentication success 2023-08-25 03:50:48.986 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:49.262 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000003', 'body': '010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004', 'message type': '03', 'body type': '01'} 2023-08-25 03:50:49.262 ERROR (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Error in process message, msg = aa2dcd00000000000003010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004ef 2023-08-25 03:50:49.263 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'available': True} 2023-08-25 03:51:19.474 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 03:51:19.789 DEBUG (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000003', 'body': '010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004', 'message type': '03', 'body type': '01'} 2023-08-25 03:51:19.789 ERROR (Heat Pump Water Heater) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Error in process message, msg = aa2dcd00000000000003010115aa9b99915c5d5eb46a000000000000000000aa0000aa00000001000000000004ef

我知道什么情况了,你重新Clone一下看看

CatSamaDD commented 1 year ago

重新clone以后现在3个传感器正常显示温度。 QQ截图20230825221148 设备可以显示电源状态和设定温度。 但是不能进行ON/OFF切换,也不能调整温度,调整温度会报错 2 3

2023-08-25 22:18:48.627 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140292748060368] type 'bytearray' is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1910, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1950, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 226, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 811, in entity_service_call future.result() # pop exception if have ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1034, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 851, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/water_heater/init.py", line 370, in async_service_temperature_set await entity.async_set_temperature(*kwargs) File "/usr/src/homeassistant/homeassistant/components/water_heater/init.py", line 293, in async_set_temperature await self.hass.async_add_executor_job( File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/midea_ac_lan/water_heater.py", line 91, in set_temperature self._device.set_attribute("target_temperature", temperature) File "/config/custom_components/midea_ac_lan/midea/devices/cd/device.py", line 85, in set_attribute self.build_send(message) File "/config/custom_components/midea_ac_lan/midea/core/device.py", line 169, in build_send data = cmd.serialize() ^^^^^^^^^^^^^^^ File "/config/custom_components/midea_ac_lan/midea/core/message.py", line 140, in serialize stream = self.header + self.body ^^^^^^^^^^^ File "/config/custom_components/midea_ac_lan/midea/core/message.py", line 104, in header length = self.HEADER_LENGTH + len(self.body) ^^^^^^^^^ File "/config/custom_components/midea_ac_lan/midea/core/message.py", line 135, in body if self._body: ^^^^^^^^^^ File "/config/custom_components/midea_ac_lan/midea/devices/cd/message.py", line 53, in _body return bytearray[ ^^^^^^^^^^ TypeError: type 'bytearray' is not subscriptable

CatSamaDD commented 1 year ago

然后功能上的需求的话,除了开关切换、温度设置,还有电辅热功能的启闭。我这个空气能热水器有电辅热功能,冬天升温效果不好时可以用开启电辅热变成电热水器。 然后还有个预约功能,他这个预约功能不是指定时间开启/关闭。而是指定用水时间后会提前开启加热,保证在你设置的用水时间范围内热水已经加热好了。 这两个功能如果能实现的话是最好不过了。

georgezhao2010 commented 1 year ago

然后功能上的需求的话,除了开关切换、温度设置,还有电辅热功能的启闭。我这个空气能热水器有电辅热功能,冬天升温效果不好时可以用开启电辅热变成电热水器。 然后还有个预约功能,他这个预约功能不是指定时间开启/关闭。而是指定用水时间后会提前开启加热,保证在你设置的用水时间范围内热水已经加热好了。 这两个功能如果能实现的话是最好不过了。

主要是他的电辅热功能我不是很理解,有三档,另外设置电辅热的时候是否还要同时设置电辅热温度?我没看见电辅热跟预约功能有什么联系,倒是跟一个温度值有关。

myTable["openPTC"] = messageBytes[6] myTable["openPTCTemp"] = bit.rshift(bit.band(messageBytes[8], 0x02),

可否给我解释一下其中的逻辑?

georgezhao2010 commented 1 year ago

...

关于错误,你需要手动做一点小小修改,

打开custom_components/midea_ac_lan/midea/devices/cd/message.py, 第53-61行

原有代码是

        return bytearray[
            0x01, power,
            self.read_field("modeValue"),
            target_temperature,
            self.read_field("trValue"),
            self.read_field("openPTC"),
            self.read_field("ptcTemp"),
            self.read_field("byte8")
        ]

方括号前后各加一个圆括号,改为

        return bytearray([
            0x01, power,
            self.read_field("modeValue"),
            target_temperature,
            self.read_field("trValue"),
            self.read_field("openPTC"),
            self.read_field("ptcTemp"),
            self.read_field("byte8")
        ])

就省得下新的了,然后再试试看控制是否有效。

CatSamaDD commented 1 year ago

然后功能上的需求的话,除了开关切换、温度设置,还有电辅热功能的启闭。我这个空气能热水器有电辅热功能,冬天升温效果不好时可以用开启电辅热变成电热水器。 然后还有个预约功能,他这个预约功能不是指定时间开启/关闭。而是指定用水时间后会提前开启加热,保证在你设置的用水时间范围内热水已经加热好了。 这两个功能如果能实现的话是最好不过了。

主要是他的电辅热功能我不是很理解,有三档,另外设置电辅热的时候是否还要同时设置电辅热温度?我没看见电辅热跟预约功能有什么联系,倒是跟一个温度值有关。

myTable["openPTC"] = messageBytes[6] myTable["openPTCTemp"] = bit.rshift(bit.band(messageBytes[8], 0x02),

可否给我解释一下其中的逻辑?

是我没表达清楚,我刚去重新摆弄了下,所谓的电辅热,其实就是一个”快热“模式,相对于不开启电辅热,纯空气能运行模式就是”标准“模式。 然后我之前提到的”预约“功能,应该也是作为一个独立的模式存在的,叫”预约“模式,这样加起来是3个模式,也就是三个档位。

标准模式运行的时候,有可能达不到设定温度,比如我设定温度是70度,但在标准模式,以我当地现在的情况最高只能加热到55度,这是空气能工作原理决定的,不过因为空气能储水罐容积都比较大,所以夏天完全够用。

而天冷的时候,用快热模式,就会用电加热,不光是加热快,也没有了空气能的温度上限,会一直加热到设定的温度。

至于预约模式,预约的功能之前说了就是设置一个时间段,提前开启加热,保证时间段内热水已经加热至设定的温度。但是在美的这里因为预约是作为一个单独的模式存在的,当开启预约模式以后,就不能手动去选择是否用电加热了,由热水器自动控制。根据我的感觉来看,比如我之前提到的,纯空气能加热达不到70度,但我预约晚上8点到晚上12点,温度设定70度,他就会自动开启用电加热,在晚上8点前帮我加热到70度。但如果我设置50度,空气能就可以达到,为了省电他可能就不用电去加热了。这个应该就是你提到的电辅热跟一个温度值有关吧的原因,那个温度值我估计就是阈值,当你开启预约模式,并且设定温度在这个阈值之上,他就会用电加热。 这个预约模式可以用美的美居控制,但功能本身是不依赖网络的,可以最多同时预约2个时间段 1 2

CatSamaDD commented 1 year ago

...

关于错误,你需要手动做一点小小修改,

打开custom_components/midea_ac_lan/midea/devices/cd/message.py, 第53-61行

原有代码是

        return bytearray[
            0x01, power,
            self.read_field("modeValue"),
            target_temperature,
            self.read_field("trValue"),
            self.read_field("openPTC"),
            self.read_field("ptcTemp"),
            self.read_field("byte8")
        ]

方括号前后各加一个圆括号,改为

        return bytearray([
            0x01, power,
            self.read_field("modeValue"),
            target_temperature,
            self.read_field("trValue"),
            self.read_field("openPTC"),
            self.read_field("ptcTemp"),
            self.read_field("byte8")
        ])

就省得下新的了,然后再试试看控制是否有效。

控制温度降低可以,升高不行。点升高温度,温度数值会消失,然后没有反应。 先点温度降低,然后立刻点温度升高,会报错。 3

QQ截图20230825233230

2023-08-25 23:32:48.184 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 23:32:48.511 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000003', 'body': '010115988f8d7f5f5e62b46a00000000000000000098000f980000000100002d000004', 'message type': '03', 'body type': '01'} 2023-08-25 23:32:48.512 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'power': True, 'max_temperature': 75, 'min_temperature': 38, 'target_temperature': 61, 'outdoor_temperature': 32.0, 'condenser_temperature': 32.5, 'compressor_temperature': 34.0} 2023-08-25 23:33:46.556 DEBUG (SyncWorker_54) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa13cd00000000000002', 'body': '0101010296f1000000', 'message type': '02', 'body type': '01'} 2023-08-25 23:33:46.790 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa13cd00000000000002', 'body': '0101010296f1000000', 'message type': '02', 'body type': '01'} 2023-08-25 23:33:46.791 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'power': True, 'target_temperature': 60} 2023-08-25 23:33:47.134 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000005', 'body': '010195968f8d7f5f5e62b46a00000000000000000096000f960000000100002d000004', 'message type': '05', 'body type': '01'} 2023-08-25 23:33:47.134 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'power': True, 'max_temperature': 75, 'min_temperature': 38, 'target_temperature': 60, 'outdoor_temperature': 32.0, 'condenser_temperature': 32.5, 'compressor_temperature': 34.0} 2023-08-25 23:33:50.243 DEBUG (SyncWorker_26) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa13cd00000000000002', 'body': '0101010292f1000000', 'message type': '02', 'body type': '01'} 2023-08-25 23:33:50.431 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa13cd00000000000002', 'body': '0101010292f1000000', 'message type': '02', 'body type': '01'} 2023-08-25 23:33:50.431 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'power': True, 'target_temperature': 58} 2023-08-25 23:33:50.431 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Sending: {'header': 'aa0ccd00000000000003', 'body': '0101', 'message type': '03', 'body type': '01'} 2023-08-25 23:33:50.757 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.devices.cd.device] [179220396303741] Received: {'header': 'aa2dcd00000000000005', 'body': '010195928f8d7f5f5e62b46a00000000000000000092000f920000000100002d000004', 'message type': '05', 'body type': '01'} 2023-08-25 23:33:50.757 DEBUG (美的空气能热水器) [custom_components.midea_ac_lan.midea.core.device] [179220396303741] Status update: {'power': True, 'max_temperature': 75, 'min_temperature': 38, 'target_temperature': 58, 'outdoor_temperature': 32.0, 'condenser_temperature': 32.5, 'compressor_temperature': 34.0}

然后小建议是控温应该是不需要以0.5度为单位,虽然我看下调0.5度过一会会自动调整为下调1度。

georgezhao2010 commented 1 year ago

...

奇怪的是,默认设置的是整数温度。

你下载个最新的版本,最好能多记录一两个小时的日志,然后把日志发到我邮箱吧,我研究下状态

georgezhao2010 commented 1 year ago

请各位空气能热水器用户抓紧时间向我提供长时间日志,其中包含在HA中操作的内容。

如果下一版本发布时仍无法完成空气能热水器的问题验证,那么下个版本将不会发布空气能热水器的内容。

coolmaxter commented 1 year ago

image 我也是发生一样的问题 调节升高后给的是只有°,降低可以不过这个热水器本身不支持0.5°调节,所以应该要去掉0.5度调节, log收集中 image

CatSamaDD commented 1 year ago

发件人: George @.> 发送时间: 2023年8月26日 14:12 收件人: @.> 抄送: @.>; @.> 主题: Re: [georgezhao2010/midea_ac_lan] 请求支持 美的 空气能热水器 (Issue #189)

...

奇怪的是,默认设置的是整数温度。

你下载个最新的版本,最好能多记录一两个小时的日志,然后把日志发到我邮箱吧,我研究下状态

― Reply to this email directly, view it on GitHubhttps://github.com/georgezhao2010/midea_ac_lan/issues/189#issuecomment-1694186873, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AII6PIGLPMS424K6NQNI2BLXXGHUFANCNFSM6AAAAAAVPIMVJ4. You are receiving this because you commented.Message ID: @.***>

georgezhao2010 commented 1 year ago

发件人: George @.> 发送时间: 2023年8月26日 14:12 收件人: @.> 抄送: @.>; @.> 主题: Re: [georgezhao2010/midea_ac_lan] 请求支持 美的 空气能热水器 (Issue #189) ... 奇怪的是,默认设置的是整数温度。 你下载个最新的版本,最好能多记录一两个小时的日志,然后把日志发到我邮箱吧,我研究下状态 ― Reply to this email directly, view it on GitHub<#189 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AII6PIGLPMS424K6NQNI2BLXXGHUFANCNFSM6AAAAAAVPIMVJ4. You are receiving this because you commented.Message ID: @.***>

没有邮件也没在任何地方看到你的日志,你这是啥?

CatSamaDD commented 1 year ago

发件人: George @.**> 发送时间: 2023年8月26日 14:12 收件人: @.**> 抄送: @.**>; @.**> 主题: Re: [georgezhao2010/midea_ac_lan] 请求支持 美的 空气能热水器 (Issue #189) ... 奇怪的是,默认设置的是整数温度。 你下载个最新的版本,最好能多记录一两个小时的日志,然后把日志发到我邮箱吧,我研究下状态 ― Reply to this email directly, view it on GitHub<#189 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AII6PIGLPMS424K6NQNI2BLXXGHUFANCNFSM6AAAAAAVPIMVJ4. You are receiving this because you commented.Message ID: @.***>

没有邮件也没在任何地方看到你的日志,你这是啥?

回错邮件了,回成github的订阅邮件了,我重发过。

georgezhao2010 commented 1 year ago

我问一下大家,空气能热水器有个单独的水泵开关吗?怎么我觉得美的的脚本里有明显错误,就算是有个水泵开关也不可能正常开闭呢?

hhchaobin commented 1 year ago

我问一下大家,空气能热水器有个单独的水泵开关吗?怎么我觉得美的的脚本里有明显错误,就算是有个水泵开关也不可能正常开闭呢?

我们家的没有单独的水泵开关,空气能的水是下进上出,进水我家单独装了一个水龙头就是了

georgezhao2010 commented 1 year ago

请大家pull最新的代码,然后测试一下功能是否全部正常。

扩展传感器是否都能正确显示,调温是否正常,aux_heating(电辅热)开关是否工作正常。

基本接近完成

CatSamaDD commented 1 year ago

额 没有更新啊 还是2day gao

georgezhao2010 commented 1 year ago

额 没有更新啊 还是2day gao

8好意思,重新pull一下,我忘了push

coolmaxter commented 1 year ago

新的版本 调整 温度, 开关(power)都正常。 image 但是本次新加的 电热 和 压缩机状态不对 电热开了会自动关闭 app上其实没有电热的开关我这边叫做快热 image 查询我家安装的这款是支持电热的,所以我估计和兼容性有关 然后是压缩机状态这个状态不对 上面图的压缩机和冷凝器温度有这么大的差距其实就是压缩机在工作了但是显示的没有在工作

CatSamaDD commented 1 year ago

跟楼上是一样的情况,电热开关不生效。 如https://github.com/georgezhao2010/midea_ac_lan/issues/189#issuecomment-1693527915 提到的, 美的空气能热水器的电热不是单独控制的,而是根据不同的运行模式切换自动选择的。 不可能在“标准”模式下,启动电加热。也不可能在“快热”模式下,关闭电加热。

所以从逻辑上来说应该是做一个切换开关,类似空调的制冷、制热、除湿,在标准、快热、预约三个模式中选择一个。 而电热是否启动,如果有条件的话应该是作为一个传感器存在,而不是开关,当然没有也不是特别有影响。

georgezhao2010 commented 1 year ago

楼上二位,你们是从操作逻辑上理解,我是从指令层面上理解。

不管模式也好,开关也好,最后都落实到发往热水器的指令是否正确,而其实从指令层面,并没有“模式”这种概念,只有这个功能打开、那个功能关闭。也有可能必须同时打开几个功能,才能构成你们所说的模式切换。

所以你们测试的时候,就要包含在美居App上进行模式切换,然后日志发给我的时候,还要告诉我你们在日志的什么时间点切换了什么功能或模式。否则几百行日志,让我用肉眼去分辨每一条和每一条的区别,很难。就算我看出一条和一条区别了,我也不知道你们进行了什么操作导致的这种区别。

OK?

georgezhao2010 commented 1 year ago

supported in v0.3.19