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

Midea AC became "unavailable" after I upgraded to the latest version this evening. #88

Closed sctale closed 2 years ago

sctale commented 2 years ago

Hello Mr. Zhou,

My Midea AC became "unavailable" after I upgraded to the latest version "f87784e" this evening. There are 6 warnings or errors. It worked very well before this version. I restarted the HASSOS several times, it didn't work. I also deleted this "custom_components" and re-install it, it also didn't work.

Will you fix this in the near future? Thank you for your efforts on this useful C.C.

sctale commented 2 years ago

Warning 1: Logger: msmart.lan Source: /usr/local/lib/python3.9/site-packages/msmart/lan.py:74 First occurred: 21:52:16 (1 occurrences) Last logged: 21:52:16

About to send data again with Device 192.168.20.217:6444 error: [Errno 9] Bad file descriptor

sctale commented 2 years ago

Warning 2: Logger: homeassistant.helpers.entity Source: helpers/entity.py:657 First occurred: 21:52:17 (1 occurrences) Last logged: 21:52:17

Update of climate.midea_ac_63771674493145 is taking over 10 seconds

sctale commented 2 years ago

Warning 3: Logger: msmart.lan Source: /usr/local/lib/python3.9/site-packages/msmart/lan.py:77 First occurred: 21:52:17 (9 occurrences) Last logged: 21:52:21

Couldn't connect with Device 192.168.20.217:6444 retries: 6 error: [Errno 9] Bad file descriptor Couldn't connect with Device 192.168.20.217:6444 retries: 7 error: [Errno 9] Bad file descriptor Couldn't connect with Device 192.168.20.217:6444 retries: 8 error: [Errno 9] Bad file descriptor Couldn't connect with Device 192.168.20.217:6444 retries: 9 error: [Errno 9] Bad file descriptor Couldn't connect with Device 192.168.20.217:6444 retries: 10 error: [Errno 9] Bad file descriptor

sctale commented 2 years ago

Warning 4: Logger: homeassistant.components.climate Source: helpers/entity_platform.py:692

Integration: 空调 (documentation, issues) First occurred: 21:52:22 (1 occurrences) Last logged: 21:52:22

Updating midea_ac climate took longer than the scheduled update interval 0:00:15

sctale commented 2 years ago

Warning 5: Logger: msmart.lan Source: /usr/local/lib/python3.9/site-packages/msmart/lan.py:42 First occurred: 21:51:46 (7 occurrences) Last logged: 21:53:01

Connect Error: 192.168.20.217:6444 timed out

sctale commented 2 years ago

Warning 6: Logger: msmart.lan Source: /usr/local/lib/python3.9/site-packages/msmart/lan.py:58 First occurred: 21:51:46 (7 occurrences) Last logged: 21:53:01

Sokcet is None: 192.168.20.217:6444

sctale commented 2 years ago

image

sctale commented 2 years ago

新的扫描结果,显示不支持,但是原先是支持的。 sid@sid-debian:~$ midea-discover INFO:msmart.cli:msmart version: 0.1.24 INFO:msmart.cli:Sending Device Scan Broadcast... INFO:msmart.cli:Midea Local Data 192.168.20.217 5a5a0111a8007a80000000000000000000000000d9400100003a0000000000000000000000000000fcf86dc00f59c99788b054ddde43e2c2aabaf259283913acdc3d4e8caf893a65682892e11c405887a9527b141872d541468b8b40e8c82ab6782b3672bf39e0ac576c932a05eb3e61643706942438a4ffaf10ee3e95e2223cbf29bf72f38b8f0f34051eeb93982aa88e7775c716f3a2b8be46749c4f7c2dba8c6af760ab17d5b9 INFO:msmart.cli:Decrypt Reply: 192.168.20.217 d914a8c02c19000030303030303032313132323235303738313736323330323830353335303030300d6d696465615f61635f303533350000000001000000040000000000ac00000000000000345bbb1957a301080001021601030000000000000000000000000000000000000000 INFO:msmart.lan:Couldn't connect with Device 192.168.20.217:6444 INFO:msmart.cli:*** Found a unsupported device - type: '0xac' - version: V2 - ip: 192.168.20.217 - port: 6444 - id: 63771674493145 - sn: 00000021122250781762302805350000 - ssid: midea_ac_0535

mac-zhou commented 2 years ago

msmart version is 0.1.33 now, please update.

sctale commented 2 years ago

After updating to 0.1.33, it is still unsupported: INFO:msmart.cli:msmart version: 0.1.33 Currently only supports ac devices. INFO:msmart.cli:Sending Device Scan Broadcast... ERROR:msmart.lan:Connect Error: 192.168.20.217:6444 timed out ERROR:msmart.lan:Sokcet is None: 192.168.20.217:6444 WARNING:msmart.device:Got Null from 192.168.20.217:6444 Version: 2 Count: 0 Time(s): 2.18 INFO:msmart.cli:* Found a device: {'type': 'ac', 'support': False, '**version': 2, 'ip': '192.168.20.217', 'id': 63771674493145, 'port': 6444, 'token': None, 'key': None, 'ssid': 'midea_ac_0535'}

mac-zhou commented 2 years ago

Your air conditioner seems to be slow to respond.

https://github.com/mac-zhou/midea-msmart/blob/5e79c6859ec817381e6a093b942f9d7173103720/msmart/lan.py#L35

You can increase the value of timeout, then see if it can be fixed, like:

self._socket.settimeout(4)

Please confirm to upgrade to the latest version

PL4STER commented 2 years ago

Hello, i update and dead... https://forum.arturhome.pl/uploads/default/original/2X/7/7b367ee7dbdb9a00fac2d5a8077f86fe40523d0b.png AC - unavailable,

mac-zhou commented 2 years ago

Hello, i update and dead... https://forum.arturhome.pl/uploads/default/original/2X/7/7b367ee7dbdb9a00fac2d5a8077f86fe40523d0b.png AC - unavailable,

homeassistant’s log please

PL4STER commented 2 years ago

Please let me know how to check. Weekend HA user: /

PL4STER commented 2 years ago

HACS (Home Assistant Community Store)

Version: 1.14.1 This is a custom integration If you have any issues with this you need to open an issue here: https://github.com/hacs/integration/issues

2021-08-29 11:31:18 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.WEBSOCKET 2021-08-29 11:31:18 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.FRONTEND 2021-08-29 11:31:18 INFO (MainThread) [custom_components.hacs] LovelaceMode.STORAGE mode, cache for /hacsfiles/: True 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.setup] Setup of domain mobile_app took 0.1 seconds 2021-08-29 11:31:18 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.CATEGORIES 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.setup] Setting up notify 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.setup] Setup of domain notify took 0.0 seconds 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.setup] Setup of domain xiaomi_aqara took 0.7 seconds 2021-08-29 11:31:18 INFO (MainThread) [custom_components.hacs] HACS is enabled 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.setup] Setting up device_tracker 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mobile_app 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.mobile_app 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mobile_app 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.mobile_app 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 1.4 seconds 2021-08-29 11:31:18 INFO (SyncWorker_1) [xiaomi_gateway] Discovering Xiaomi Devices 2021-08-29 11:31:18 INFO (MainThread) [homeassistant.components.notify] Setting up notify.mobile_app 2021-08-29 11:31:18 INFO (SyncWorker_1) [xiaomi_gateway] Found 5 devices 2021-08-29 11:31:19 INFO (MainThread) [homeassistant.setup] Setting up ssdp 2021-08-29 11:31:19 INFO (MainThread) [homeassistant.setup] Setup of domain ssdp took 0.0 seconds 2021-08-29 11:31:19 INFO (MainThread) [homeassistant.setup] Setup of domain device_tracker took 0.4 seconds 2021-08-29 11:31:19 INFO (SyncWorker_4) [xiaomi_gateway] Creating Multicast Socket 2021-08-29 11:31:19 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.mobile_app 2021-08-29 11:31:19 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.mobile_app 2021-08-29 11:31:19 INFO (SyncWorker_5) [homeassistant.loader] Loaded weather from homeassistant.components.weather 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.setup] Setting up default_config 2021-08-29 11:31:20 INFO (SyncWorker_2) [homeassistant.loader] Loaded stream from homeassistant.components.stream 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.setup] Setting up weather 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.setup] Setup of domain weather took 0.0 seconds 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.xiaomi_aqara 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.xiaomi_aqara 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.components.weather] Setting up weather.met 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.setup] Setting up stream 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.setup] Setup of domain stream took 0.0 seconds 2021-08-29 11:31:20 INFO (MainThread) [homeassistant.setup] Setup of domain default_config took 0.3 seconds 2021-08-29 11:31:20 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.HACS_REPO 2021-08-29 11:31:21 INFO (MainThread) [custom_components.hacs] <Integration hacs/integration> Registration completed 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] Restore started 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] Restore done 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] Setup task HacsSetupTask.SENSOR 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] Stage changed: HacsStage.WAITING 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] Setup complete, waiting for Home Assistant before startup tasks starts 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] HACS is enabled 2021-08-29 11:31:22 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.hacs 2021-08-29 11:31:22 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 60.70s 2021-08-29 11:31:22 INFO (MainThread) [homeassistant.core] Starting Home Assistant 2021-08-29 11:31:22 INFO (MainThread) [homeassistant.core] Timer:starting 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] Stage changed: HacsStage.STARTUP 2021-08-29 11:31:22 INFO (MainThread) [custom_components.hacs] setup task HacsSetupTask.CATEGORIES 2021-08-29 11:31:22 INFO (SyncWorker_2) [custom_components.hacs] Enable category: HacsCategory.INTEGRATION 2021-08-29 11:31:22 INFO (SyncWorker_2) [custom_components.hacs] Enable category: HacsCategory.PLUGIN 2021-08-29 11:31:22 INFO (SyncWorker_2) [custom_components.hacs] Enable category: HacsCategory.THEME 2021-08-29 11:31:22 INFO (SyncWorker_2) [custom_components.hacs] Enable category: HacsCategory.APPDAEMON 2021-08-29 11:31:22 INFO (SyncWorker_2) [custom_components.hacs] Enable category: HacsCategory.NETDAEMON 2021-08-29 11:31:22 INFO (MainThread) [homeassistant.components.zeroconf] Starting Zeroconf broadcast 2021-08-29 11:31:22 INFO (SyncWorker_1) [homeassistant.loader] Loaded brother from homeassistant.components.brother 2021-08-29 11:31:22 INFO (SyncWorker_8) [homeassistant.loader] Loaded cast from homeassistant.components.cast 2021-08-29 11:31:22 INFO (SyncWorker_3) [homeassistant.loader] Loaded homekit_controller from homeassistant.components.homekit_controller 2021-08-29 11:31:22 INFO (SyncWorker_4) [homeassistant.loader] Loaded ipp from homeassistant.components.ipp 2021-08-29 11:31:22 INFO (SyncWorker_1) [homeassistant.loader] Loaded xiaomi_miio from homeassistant.components.xiaomi_miio 2021-08-29 11:31:22 INFO (SyncWorker_6) [homeassistant.loader] Loaded upnp from homeassistant.components.upnp 2021-08-29 11:31:22 INFO (SyncWorker_0) [homeassistant.loader] Loaded huawei_lte from homeassistant.components.huawei_lte 2021-08-29 11:31:22 INFO (SyncWorker_2) [homeassistant.loader] Loaded samsungtv from homeassistant.components.samsungtv 2021-08-29 11:31:23 INFO (SyncWorker_3) [homeassistant.loader] Loaded plex from homeassistant.components.plex 2021-08-29 11:31:23 INFO (MainThread) [custom_components.hacs] Loading known repositories 2021-08-29 11:31:36 INFO (MainThread) [custom_components.hacs] Stage changed: HacsStage.RUNNING 2021-08-29 11:32:05 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities climate.klimatyzacja_salon 2021-08-29 11:32:58 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [140045361146752] Connection closed by client 2021-08-29 11:42:42 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities climate.klimatyzacja_salon 2021-08-29 11:46:23 INFO (MainThread) [homeassistant.components.analytics] Submitted analytics to Home Assistant servers. Information submitted includes {'uuid': 'ee1887c8ff874110974e9cfdda0ca68e', 'version': '2021.8.8', 'installation_type': 'Home Assistant Supervised', 'supervisor': {'healthy': True, 'supported': False, 'arch': 'amd64'}, 'integrations': ['tag', 'mqtt', 'switch', 'remote', 'device_automation', 'timer', 'forecast_solar', 'script', 'default_config', 'logbook', 'climate', 'binary_sensor', 'network', 'stream', 'system_health', 'onboarding', 'auth', 'notify', 'tts', 'zeroconf', 'frontend', 'mobile_app', 'hassio', 'input_number', 'person', 'analytics', 'webhook', 'automation', 'input_boolean', 'system_log', 'device_tracker', 'ssdp', 'alarm_control_panel', 'history', 'input_select', 'energy', 'google_translate', 'input_text', 'blueprint', 'light', 'homeassistant', 'cloud', 'met', 'config', 'dhcp', 'my', 'search', 'websocket_api', 'scene', 'input_datetime', 'recorder', 'api', 'media_source', 'xiaomi_aqara', 'image', 'map', 'logger', 'persistent_notification', 'sun', 'trace', 'lovelace', 'weather', 'cover', 'group', 'updater', 'zone', 'http', 'counter', 'sensor'], 'custom_integrations': [{'domain': 'xiaomi_gateway3', 'version': <AwesomeVersion SemVer '1.3.0'>}, {'domain': 'hacs', 'version': <AwesomeVersion SemVer '1.14.1'>}, {'domain': 'midea_ac', 'version': <AwesomeVersion SemVer '0.1.33'>}], 'addons': [{'slug': 'core_samba', 'protected': True, 'version': '9.5.1', 'auto_update': True}, {'slug': 'a0d7b954_nodered', 'protected': True, 'version': '10.0.0', 'auto_update': True}, {'slug': '3a87ddeb_sofarsolar_mqtt', 'protected': True, 'version': '1.1', 'auto_update': False}], 'energy': {'configured': False}, 'state_count': 79, 'automation_count': 0, 'integration_count': 69, 'addon_count': 3, 'user_count': 2} 2021-08-29 11:53:39 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities climate.klimatyzacja_salon 2021-08-29 11:58:56 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities climate.klimatyzacja_salon

Logger: homeassistant.helpers.service Source: helpers/service.py:128 First occurred: 11:32:05 (4 occurrences) Last logged: 11:58:56

Unable to find referenced entities climate.klimatyzacja_salon

sctale commented 2 years ago

@mac-zhou Hello Mr. Zhou, I installed the msmart in the different system instead of HASSOS. Does this affect the connection?

mac-zhou commented 2 years ago

@sctale @PL4STER

update msmart pip3 install msmart==0.1.34, then run midea-discover -d , show me the output

sctale commented 2 years ago

INFO:msmart.cli:Debug mode active INFO:msmart.cli:msmart version: 0.1.34 Currently only supports ac devices. INFO:msmart.cli:Sending Device Scan Broadcast... DEBUG:msmart.cli:Midea Local Data 192.168.20.217 5a5a0111a8007a80000000000000000000000000d9400100003a0000000000000000000000000000fcf86dc00f59c99788b054ddde43e2c2aabaf259283913acdc3d4e8caf893a65682892e11c405887a9527b141872d541468b8b40e8c82ab6782b3672bf39e0ac576c932a05eb3e61643706942438a4ffaf10ee3e95e2223cbf29bf72f38b8f0f34051eeb93982aa88e7775c716f3a2b8be46749c4f7c2dba8c6af760ab17d5b9 DEBUG:msmart.cli:Decrypt Reply: 192.168.20.217 d914a8c02c19000030303030303032313132323235303738313736323330323830353335303030300d6d696465615f61635f303533350000000001000000040000000000ac00000000000000345bbb1957a301080001021601030000000000000000000000000000000000000000 DEBUG:msmart.command:Finalize request data: aa20ac00000000000003418100ff03ff0002000000000000000000000000253314 DEBUG:msmart.device:pkt_builder: 192.168.20.217:6444 len: 104 data: 5a5a011168002000000000000625060d1e081514d9400100003a00000000000000000000000000006b000a76e27eed2c3647e57d8602df8b3757ffdc969c69c4ab2caa98d2b8cdf6dbade277ffadf3e7e3b93ad8267a9778269e3644d4b3b9355f4e88925d2b021d DEBUG:msmart.lan:Attempting new connection to 192.168.20.217:6444 ERROR:msmart.lan:Connect Error: 192.168.20.217:6444 timed out ERROR:msmart.lan:Sokcet is None: 192.168.20.217:6444 DEBUG:msmart.lan:Get responses len: 0 DEBUG:msmart.device:Got responses from 192.168.20.217:6444 Version: 2 Count: 0 Time(s): 2.0 WARNING:msmart.device:Got Null from 192.168.20.217:6444 Version: 2 Count: 0 Time(s): 2.0 DEBUG:msmart.cli:{'_lan_service': <msmart.lan.lan object at 0x7f255bc22a30>, '_ip': '192.168.20.217', '_id': 63771674493145, '_port': 6444, '_keep_last_known_online_state': False, '_type': 172, '_updating': False, '_defer_update': False, '_half_temp_step': False, '_support': False, '_online': True, '_active': False, '_protocol_version': 2, '_prompt_tone': False, '_power_state': False, '_target_temperature': 17.0, '_operational_mode': <operational_mode_enum.auto: 1>, '_fan_speed': <fan_speed_enum.Auto: 102>, '_swing_mode': <swing_mode_enum.Off: 0>, '_eco_mode': False, '_turbo_mode': False, 'fahrenheit_unit': False, '_on_timer': None, '_off_timer': None, '_indoor_temperature': 0.0, '_outdoor_temperature': 0.0} INFO:msmart.cli:*** Found a device: {'type': 'ac', 'support': False, 'version': 2, 'ip': '192.168.20.217', 'id': 63771674493145, 'port': 6444, 'token': None, 'key': None, 'ssid': 'midea_ac_0535'}

mac-zhou commented 2 years ago

The point is this error: ERROR:msmart.lan:Connect Error: 192.168.20.217:6444 timed out Socket can't establish a connection in 2s, the WiFi network condition looks bad. You can modify line 35 of the lan.py file,try to modify the settimeout to a larger value, then try for example:

self._socket.settimeout(4)
sctale commented 2 years ago

I powered off the AC just now, and it works. It seems that the AC has been on line in too long time. Thanks for your support all the same. Hope this awesome intergration can support more smart things of Midea in the future.

mac-zhou commented 2 years ago

I powered off the AC just now, and it works. It seems that the AC has been on line in too long time. Thanks for your support all the same. Hope this awesome intergration can support more smart things of Midea in the future.

Is it normal after modifying the timeout? or no change?

sctale commented 2 years ago

@mac-zhou Hello Mr. Zhou. The midea-ac didn't work again, shows timeout. I changed the time to 4 in lan.py as you told. The following message is the scanning result, and 192.168.20.217 is the ac.

C:\Users\HAOHAO>midea-discover -d INFO:msmart.cli:Debug mode active INFO:msmart.cli:msmart version: 0.1.35 Currently only supports ac devices. INFO:msmart.cli:Sending Device Scan Broadcast... DEBUG:asyncio:Using proactor: IocpProactor DEBUG:msmart.scanner:Broadcast message sent: 0 DEBUG:msmart.scanner:Midea Local Data 192.168.20.218 5a5a0111a8007a800000000000000000000000003c69010000860000000000000000000000000000d7cd7690dcd8c0150afd49be40adab1ef7ec9de8f64474826f43eb0f198ae38d2fd2d2c08e2b2d585596d816097520203fe3fb7d30ffdd4ff7c030415b8d17ca822f52e32e82190a1632f64705f9cfd6fb14ecec6f405b68fb64da354047791306c416020931f48926620dfe95e23111cdef74ab783ace9ec2f4968253ce4f39 DEBUG:msmart.scanner:Decrypt Reply: 192.168.20.218 da14a8c02c19000030303030453232313135313030304c51333138393033323130323233303030300d6d696465615f65325f303232330000000002000000040000000000e2004700000000002c3ae88464f90535080117160108000000000000000000000000000000000000000000 DEBUG:msmart.scanner:Midea Local Data 192.168.20.217 5a5a0111a8007a80000000000000000000000000d9400100003a0000000000000000000000000000fcf86dc00f59c99788b054ddde43e2c2aabaf259283913acdc3d4e8caf893a65682892e11c405887a9527b141872d541468b8b40e8c82ab6782b3672bf39e0ac576c932a05eb3e61643706942438a4ffaf10ee3e95e2223cbf29bf72f38b8f0f34051eeb93982aa88e7775c716f3a2b8be46749c4f7c2dba8c6af760ab17d5b9 DEBUG:msmart.scanner:Decrypt Reply: 192.168.20.217 d914a8c02c19000030303030303032313132323235303738313736323330323830353335303030300d6d696465615f61635f303533350000000001000000040000000000ac00000000000000345bbb1957a301080001021601030000000000000000000000000000000000000000 DEBUG:msmart.scanner:Midea Local Data 192.168.20.205 837000c8200f00005a5a0111b8007a800000000054e53913040a15147272310000960000000000000000018000000000f5300b05a896cc99a46fdc52b892b46c63540998f88a7f5ef968bb18e8edbffbb265f5dbc8b212cfe5331745ffd0ba7b48b369bef3f937e46e27ac229e4966f9285ccd40365f9d68f393470e4f702d6c6451847f94bea2ed1e42dd1d9fed751a4bdfb3e16e33d88768cc4c3d0658937d96fbcce99f70c976413c2f05f60f82e7268591320247acb227b1ab9ec815a9928359d38eb485326706de0d9587391180 DEBUG:msmart.scanner:Decrypt Reply: 192.168.20.205 cd14a8c02c1900003030303046413331313536303031303931313331343131303232353543554b580d6d696465615f66615f3232353500008f0002000000000000000000fa001900000000003c20933488af150010012002010300000000000000000000000000000000000000000000000000000000000000000000 DEBUG:msmart.scanner:Socket timeout DEBUG:msmart.scanner: Found a device: {'type': 'e2', 'support': False, 'version': 2, 'ip': '192.168.20.218', 'id': 147334558214460, 'port': 6444, 'token': None, 'key': None, 'ssid': 'midea_e2_0223'}  DEBUG:msmart.command:Finalize request data: aa20ac00000000000003418100ff03ff00020000000000000000000000002a72d0 DEBUG:msmart.device:pkt_builder: 192.168.20.217:6444 len: 104 data: 5a5a011168002000000000005d2a3913040a1514d9400100003a00000000000000000000000000006b000a76e27eed2c3647e57d8602df8bbac583bc52d91853de833a71db0579721545b628b47bbe149d805add1be3353f698015b1f94f584d496f32f02aa37ad4 DEBUG:msmart.lan:Attempting new connection to 192.168.20.217:6444 DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mapp.appsmb.com:443 DEBUG:urllib3.connectionpool:https://mapp.appsmb.com:443 "POST /v1/user/login/id/get HTTP/1.1" 200 None DEBUG:msmart.cloud:Response: {"msg":"ok","result":{"loginId":"b3b81a23-9d49-4f86-90c6-fe75d791834d"},"errorCode":"0"} DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mapp.appsmb.com:443 DEBUG:urllib3.connectionpool:https://mapp.appsmb.com:443 "POST /v1/user/login HTTP/1.1" 200 None DEBUG:msmart.cloud:Response: {"msg":"ok","result":{"originPrivateVersion":"","nickname":"midea_is_best@outlook.com","sessionId":"ea3d6a17f3f54e0ca177b96508b907e120211004115746856","accessToken":"ae86308f286f4a4b01cf67075e01e50ab920ebb829d567559397ded751813801","userId":"4826094","versionCode":"","leftCount":""},"errorCode":"0"} DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mapp.appsmb.com:443 ERROR:msmart.lan:Connect Error: 192.168.20.217:6444 timed out ERROR:msmart.lan:Sokcet is None: 192.168.20.217:6444 DEBUG:msmart.lan:Get responses len: 0 DEBUG:msmart.device:Got responses from 192.168.20.217:6444 Version: 2 Count: 0 Spend time: 4.01 WARNING:msmart.device:Got Null from 192.168.20.217:6444 Version: 2 Count: 0 Spend time: 4.01 DEBUG:msmart.scanner:{'_lan_service': <msmart.lan.lan object at 0x000001FEA9A7F490>, '_ip': '192.168.20.217', '_id': 63771674493145, '_port': 6444, '_keep_last_known_online_state': False, '_type': 172, '_updating': False, '_defer_update': False, '_half_temp_step': False, '_support': False, '_online': True, '_active': False, '_protocol_version': 2, '_prompt_tone': False, '_power_state': False, '_target_temperature': 17.0, '_operational_mode': <operational_mode_enum.auto: 1>, '_fan_speed': <fan_speed_enum.Auto: 102>, '_swing_mode': <swing_mode_enum.Off: 0>, '_eco_mode': False, '_turbo_mode': False, 'fahrenheit_unit': False, '_on_timer': None, '_off_timer': None, '_indoor_temperature': 0.0, '_outdoor_temperature': 0.0} DEBUG:msmart.scanner: Found a device: {'type': 'ac', 'support': False, 'version': 2, 'ip': '192.168.20.217', 'id': 63771674493145, 'port': 6444, 'token': None, 'key': None, 'ssid': 'midea_ac_0535'}  DEBUG:urllib3.connectionpool:https://mapp.appsmb.com:443 "POST /v1/iot/secure/getToken HTTP/1.1" 200 None DEBUG:msmart.cloud:Response: {"result":{"tokenlist":[{"udpId":"1c75158ac50b66a65fc8071870fa18f1","key":"97F1A8EC0C3A4414804EF40EF85570A4FD5BDC72DC5844A29AF5B9320EA0539F","token":"F9AA0D6B84F70C1C2C44A30DC1A34D3CE4154F523FF954270D055917A4E6D49DD889EB80BFCD3B8ADDF65E23C74BA77FC594C9696B6B65ACA2FADF813BABFF4B"}]},"msg":"ok","errorCode":"0"} DEBUG:msmart.lan:Attempting new connection to 192.168.20.205:6444 DEBUG:msmart.lan:Socket 192.168.20.208:53908 -> 192.168.20.205:6444 retries: 0 time: 0.0 tcp_key: None DEBUG:msmart.lan:Sending 192.168.20.208:53908 -> 192.168.20.205:6444 retries: 0 time: 0.0 message: 8370004020000000f9aa0d6b84f70c1c2c44a30dc1a34d3ce4154f523ff954270d055917a4e6d49dd889eb80bfcd3b8addf65e23c74ba77fc594c9696b6b65aca2fadf813babff4b DEBUG:msmart.lan:Recv 192.168.20.208:53908 -> 192.168.20.205:6444 retries: 0 time: 0.92 Response: 83700005200f00004552524f52 ERROR:msmart.security:authentication failed DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mapp.appsmb.com:443 DEBUG:urllib3.connectionpool:https://mapp.appsmb.com:443 "POST /v1/iot/secure/getToken HTTP/1.1" 200 None DEBUG:msmart.cloud:Response: {"result":{"tokenlist":[{"udpId":"8359d38eb485326706de0d9587391180","key":"8B5E1BE51C2F4A02B188B32475353824A02405BA2C80407884898454FFA2F6EA","token":"349227D8EA20D22F32E16DE2552C96A777D051894EE3FBE0F694EDB0157E9AE0E8594110D9C014F655D30E4258DB0815309766750529CCDE714A37FFC9260027"}]},"msg":"ok","errorCode":"0"} DEBUG:msmart.lan:Socket 192.168.20.208:53908 -> 192.168.20.205:6444 retries: 0 time: 1.99 tcp_key: None DEBUG:msmart.lan:Sending 192.168.20.208:53908 -> 192.168.20.205:6444 retries: 0 time: 1.99 message: 8370004020000001349227d8ea20d22f32e16de2552c96a777d051894ee3fbe0f694edb0157e9ae0e8594110d9c014f655d30e4258db0815309766750529ccde714a37ffc9260027 DEBUG:msmart.lan:Recv 192.168.20.208:53908 -> 192.168.20.205:6444 retries: 0 time: 2.05 Response: 837000402001024a0b77a6cda217cdcc033bdf6092da63762cf7fb1032991c2b96f37ce3c0b187d5ffc47ce45a514124d3bce837607e9b3932756e2ce7df01c1fd1b2c79bbfef3ec INFO:msmart.lan:Got TCP key for 192.168.20.208:53908 -> 192.168.20.205:6444 retries: 0 time: 2.05 b3e16823541438c67d8b43e081f4c8e196f9f47f063c31bdcfbbf591baa0872f DEBUG:msmart.scanner: Found a device: {'type': 'fa', 'support': False, 'version': 3, 'ip': '192.168.20.205', 'id': 164926747406962, 'port': 6444, 'token': '349227D8EA20D22F32E16DE2552C96A777D051894EE3FBE0F694EDB0157E9AE0E8594110D9C014F655D30E4258DB0815309766750529CCDE714A37FFC9260027', 'key': '8B5E1BE51C2F4A02B188B32475353824A02405BA2C80407884898454FFA2F6EA', 'ssid': 'midea_fa_2255'}  INFO:msmart.cli: Found a device: {'type': 'e2', 'support': False, 'version': 2, 'ip': '192.168.20.218', 'id': 147334558214460, 'port': 6444, 'token': None, 'key': None, 'ssid': 'midea_e2_0223'}  INFO:msmart.cli: Found a device: {'type': 'ac', 'support': False, 'version': 2, 'ip': '192.168.20.217', 'id': 63771674493145, 'port': 6444, 'token': None, 'key': None, 'ssid': 'midea_ac_0535'}  INFO:msmart.cli: Found a device: {'type': 'fa', 'support': False, 'version': 3, 'ip': '192.168.20.205', 'id': 164926747406962, 'port': 6444, 'token': '349227D8EA20D22F32E16DE2552C96A777D051894EE3FBE0F694EDB0157E9AE0E8594110D9C014F655D30E4258DB0815309766750529CCDE714A37FFC9260027', 'key': '8B5E1BE51C2F4A02B188B32475353824A02405BA2C80407884898454FFA2F6EA', 'ssid': 'midea_fa_2255'} 

mac-zhou commented 2 years ago

midea-discover show can support 192.168.20.217 please update to new version and show me the hass's log

sctale commented 2 years ago

Hello Zhou 神,(直接上中文了) 我的安装环境是X86软路由虚拟机直装HASSOS。没有宿主机,那我的lan.py是不是没办法修改?之前不是很懂,最近研究了好像是HASSOS直接集成了python环境,不知道理解是否正确,那就是说msmart相关的Pyhton文件也在HASSOS里面了?我在同局域网内其他的机器上是可以安装并跑midea-discover命令的,也能显示正常,后来新买的一台美的空调V3的也顺利接入了。就是之前那台一直报错,获取不到信息,也控制不了,一般是出现在我频繁调试和升级HA插件时连续重启的时候。 我现在是想了个自检的方案,空调前端增加一个继电器,如果出现获取不到信息时(一般是实时温度为0),就断开电源,并在几秒后连接电源,这样空调能重新搜索WIFI并正确接入HA。

mac-zhou commented 2 years ago

最新版本还是有这个问题?

mac-zhou commented 2 years ago

如果有问题,请另开个issue吧