mac-zhou / midea-ac-py

Home Assistant Custom Integration for Midea Group(Hualing, Senville, Klimaire, AirCon, Century, Pridiom, Thermocore, Comfee, Toshiba, Carrier, Goodman, Friedrich, Samsung, Kenmore, Trane, Lennox, LG and much more) Air Conditioners via LAN.
MIT License
519 stars 101 forks source link

No need for logs when devices are off #206

Open andreasc1 opened 1 year ago

andreasc1 commented 1 year ago

Describe the bug (描述一下问题) Hi, log files of HA are flooded with communication error messages. no need to flood the log files with all these kind of messages when the devices are off:

Screenshots / Logs / Pcap File(屏幕截图/日志/抓包文件) If applicable, add screenshots or your home-assistant log file or pcap file to help explain your problem. 请提交相关截图,日志,抓包让开发者能够更快的解决问题 2023-01-11 13:54:35.736 ERROR (SyncWorker_11) [msmart.lan] Connect Error: 192.168.1.92:6444 timed out 2023-01-11 13:54:35.738 ERROR (SyncWorker_10) [msmart.lan] Connect Error: 192.168.1.93:6444 timed out 2023-01-11 13:54:35.738 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.1.70:6444 timed out 2023-01-11 13:54:35.739 ERROR (SyncWorker_12) [msmart.lan] Connect Error: 192.168.1.91:6444 timed out 2023-01-11 13:54:35.743 ERROR (SyncWorker_11) [msmart.lan] Sokcet is None: 192.168.1.92:6444 2023-01-11 13:54:35.746 ERROR (SyncWorker_10) [msmart.lan] Sokcet is None: 192.168.1.93:6444 2023-01-11 13:54:35.748 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.1.70:6444 2023-01-11 13:54:35.751 ERROR (SyncWorker_12) [msmart.lan] Sokcet is None: 192.168.1.91:6444 2023-01-11 13:54:35.753 ERROR (SyncWorker_11) [msmart.security] unexpected data length 2023-01-11 13:54:35.757 ERROR (SyncWorker_5) [msmart.security] unexpected data length 2023-01-11 13:54:35.760 ERROR (SyncWorker_12) [msmart.security] unexpected data length 2023-01-11 13:54:35.761 ERROR (SyncWorker_11) [msmart.lan] Authentication failed for None -> 192.168.1.92:6444 retries: 0 time: 238416.93 2023-01-11 13:54:35.767 ERROR (SyncWorker_5) [msmart.lan] Authentication failed for None -> 192.168.1.70:6444 retries: 0 time: 238416.94 2023-01-11 13:54:35.769 ERROR (SyncWorker_12) [msmart.lan] Authentication failed for None -> 192.168.1.91:6444 retries: 0 time: 238416.9 Versions (版本信息)

mill1000 commented 1 year ago

How is the integration supposed to know the device is "off", instead of experiencing a temporary loss of connectivity?

liakjim commented 1 year ago

+1

andreasc1 commented 1 year ago

How is the integration supposed to know the device is "off", instead of experiencing a temporary loss of connectivity?

yes i get what you are saying. If the latest status of the device is off (or idle, i don't know how it is defined) then it should not export any connectivity errors? but i understand that if there's actually an error the integratio wont report it..

liakjim commented 1 year ago

There are also the following warnings:

Logger: msmart.device.AC.appliance Source: /usr/local/lib/python3.10/site-packages/msmart/device/AC/appliance.py:114 First occurred: 9:37:53 AM (19 occurrences) Last logged: 9:49:54 AM

Got Null from 192.168.3.8:6444 Version: 2 Count: 0 Spend time: 3.01 Got Null from 192.168.3.8:6444 Version: 2 Count: 0 Spend time: 2.01 Got Null from 192.168.3.8:6444 Version: 2 Count: 0 Spend time: 5.01 Got Null from 192.168.3.8:6444 Version: 2 Count: 0 Spend time: 3.0 Got Null from 192.168.3.8:6444 Version: 2 Count: 0 Spend time: 5.0

and the following error:

Logger: msmart.lan Source: /usr/local/lib/python3.10/site-packages/msmart/lan.py:70 First occurred: 9:38:18 AM (1 occurrences) Last logged: 9:38:18 AM

Send 192.168.3.126:39932 -> 192.168.3.8:6444 retries: 0 time: 165.03 Error: [Errno 32] Broken pipe

mill1000 commented 1 year ago

yes i get what you are saying. If the latest status of the device is off (or idle, i don't know how it is defined) then it should not export any connectivity errors? but i understand that if there's actually an error the integratio wont report it..

At least with my unit, when it's "off" the network is still connected and reachable by the integration (temperatures are still polled). The only time the device is unreachable is when power is completely removed (i.e. unplugged) at which point I just disable the integration in HA