Closed KhArtNJava closed 2 years ago
Interestingly I had similar symptoms on my recently installed Midea unit. I ran the discover and it came back with a set of token/key and the controls worked with a HACS install. Nice and easy.
A day later (today), I couldn't control the unit - cloud worked via the Midea Air app - but after rerunning discover, I get a brand new key and token (same local IP).
My worry is this will continue to happen but I hope it's solved now
i saw your midea-discover
log, it's ok.
got token and key mean device's port(6444) is open and connected.
I don't know why can't connect in HA and telenet. it's weird.
Interestingly I had similar symptoms on my recently installed Midea unit. I ran the discover and it came back with a set of token/key and the controls worked with a HACS install. Nice and easy.
A day later (today), I couldn't control the unit - cloud worked via the Midea Air app - but after rerunning discover, I get a brand new key and token (same local IP).
My worry is this will continue to happen but I hope it's solved now
no need to get new token and key. it can reused. show me your home-assistant.log please.
I didn't understand phrase "befor restart HA", so I uploaded two files. The first one is: I added
logger:
default: warn
logs:
custom_components.midea_smart: debug
msmart: debug
to config file and waited when error occurred again - link to this file is https://github.com/mac-zhou/midea-ac-py/files/8106235/home-assistant.zip .
After that I restarted HA and got a new one log: https://github.com/mac-zhou/midea-ac-py/files/8106253/home-assistant.zip Looks like logger settings applied after HA restart...
Update: I don't know, what happened yesterday, but today I can connect to 192.168.0.104 by 6444 port from my Windows machine:
telnet 192.168.0.104 6444
So, 6444 port is really opened.
Also, I can connect to 6444 from HA machine. I've installed Terminal & SSH add-on on my HA, so I've tested port with commands:
apk update
apk add busybox-extras
After that it connected very well:
[core-ssh ~]$ telnet 192.168.0.104 6444
Connected to 192.168.0.104
But it still doesn't work, uploaded a new one updated log file https://github.com/mac-zhou/midea-ac-py/files/8106364/home-assistant.zip
2022-02-21 08:06:59 DEBUG (SyncWorker_5) [msmart.command] Finalize request data: aa23ac0000000000000240428e6603ff00300000000000000000000000003b000000ee5e
2022-02-21 08:06:59 DEBUG (SyncWorker_5) [msmart.device] pkt_builder: 192.168.1.104:6444 len: 104 data: 5a5a011168002000000000005c3b060815021614bf630000002000000000000000000000000000008a4048d48d872cde0249854df66e61173b800a77b3ae27242d1d2664e5b2e612e69219a9bd0152d46683bd6c079bc7f74be3ea1fe89b5ce40e496b6897273f28
2022-02-21 08:06:59 DEBUG (SyncWorker_5) [msmart.lan] Socket None -> 192.168.1.104:6444 retries: 0 time: 1640.92 Closed, Create New Socket
2022-02-21 08:06:59 DEBUG (SyncWorker_5) [msmart.lan] Attempting new connection to 192.168.1.104:6444
2022-02-21 08:07:01 ERROR (SyncWorker_5) [msmart.lan] Connect Error: 192.168.1.104:6444 timed out
2022-02-21 08:07:01 ERROR (SyncWorker_5) [msmart.lan] Sokcet is None: 192.168.1.104:6444
2022-02-21 08:07:01 ERROR (SyncWorker_5) [msmart.security] unexpected data length
2022-02-21 08:07:01 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.midea_ac_35184372114367 fails
So, Windows machine can open 6444 port with telnet. Also telnet connected to 6444 port from HAOS. May be need to make some HaOS configurations to allow HA connect to other IPs by 6444 port? Is there any kind of firewall in HaOS?
Also, I can connect to 6444 from HA machine. I've installed Terminal & SSH add-on on my HA, so I've tested port with commands:
apk update apk add busybox-extras
After that it connected very well:
[core-ssh ~]$ telnet 192.168.0.104 6444 Connected to 192.168.0.104
Did you run midea-discover
on the HA machine?
Also, I can connect to 6444 from HA machine. I've installed Terminal & SSH add-on on my HA, so I've tested port with commands:
apk update apk add busybox-extras
After that it connected very well:
[core-ssh ~]$ telnet 192.168.0.104 6444 Connected to 192.168.0.104
Did you run
midea-discover
on the HA machine?
Thank you for your reply. No, I did run on my Windows machine, because I don't know how to install midea-discover on HaOS. bash console of HaOS (SSH add-on) is not the same as, for example, Ubuntu console, that I usually use.
Can you advise how to install it on HaOS (raspberry pi 4)?
I guess you have solved it? 😄
After my above issue and recreating the tokens, it’s working well. Thanks!
On Wed, 23 Feb 2022 at 09:12, Mac_Zhou @.***> wrote:
I guess you have solved it? 😄
— Reply to this email directly, view it on GitHub https://github.com/mac-zhou/midea-ac-py/issues/130#issuecomment-1048576425, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALI243U2NQFYSWEOTM6KTDU4SQGJANCNFSM5O5AX7EA . You are receiving this because you commented.Message ID: @.***>
It struck again, after a few days of successful control, at 1528 today (no HA restarts, I wasn't home etc) I started getting these messages in the log:
2022-02-23 15:28:09 WARNING (SyncWorker_12) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:28:24 WARNING (SyncWorker_4) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:28:39 WARNING (SyncWorker_13) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:28:54 WARNING (SyncWorker_13) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:29:09 WARNING (SyncWorker_20) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:29:24 WARNING (SyncWorker_18) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:29:39 WARNING (SyncWorker_10) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:29:54 WARNING (SyncWorker_6) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:30:09 WARNING (SyncWorker_5) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:30:24 WARNING (SyncWorker_15) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:30:39 WARNING (SyncWorker_17) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:30:54 WARNING (SyncWorker_6) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:31:09 WARNING (SyncWorker_17) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:31:24 WARNING (SyncWorker_0) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:31:39 WARNING (SyncWorker_16) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:31:54 WARNING (SyncWorker_15) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:32:09 WARNING (SyncWorker_2) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:32:24 WARNING (SyncWorker_16) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:32:39 WARNING (SyncWorker_14) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:32:54 WARNING (SyncWorker_14) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:33:09 WARNING (SyncWorker_14) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:33:24 WARNING (SyncWorker_11) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:33:39 WARNING (SyncWorker_0) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:33:54 WARNING (SyncWorker_9) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:34:09 WARNING (SyncWorker_5) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 15:34:24 WARNING (SyncWorker_10) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
...
2022-02-23 19:19:40 WARNING (SyncWorker_13) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:19:55 WARNING (SyncWorker_11) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:20:10 WARNING (SyncWorker_5) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:20:25 WARNING (SyncWorker_4) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:20:40 WARNING (SyncWorker_2) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:20:55 WARNING (SyncWorker_0) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:21:10 WARNING (SyncWorker_1) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:21:55 WARNING (SyncWorker_3) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:22:10 WARNING (SyncWorker_0) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:22:25 WARNING (SyncWorker_12) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:22:40 WARNING (SyncWorker_2) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:22:55 WARNING (SyncWorker_21) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:23:10 WARNING (SyncWorker_16) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:23:25 WARNING (SyncWorker_16) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 19:23:40 WARNING (SyncWorker_18) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
...
2022-02-23 20:09:56 WARNING (SyncWorker_12) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 20:10:11 WARNING (SyncWorker_3) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 20:10:26 WARNING (SyncWorker_2) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 20:10:41 WARNING (SyncWorker_9) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 20:10:56 WARNING (SyncWorker_0) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
2022-02-23 20:11:11 WARNING (SyncWorker_1) [msmart.device] Got Null from 192.168.4.107:6444 Version: 3 Count: 0 Spend time: 0.0
Turns out a restart of HA solved it but something goes wrong randomly I think.
I have now tried this https://github.com/mac-zhou/midea-ac-py/issues/132#issuecomment-1047348316 so will keep you updated.
I guess you have solved it? 😄
Yep, thank you. Dug deep into HA, learnt a lot of new for me and found that it was my configuration mistake in IP. Thank you a lot for your work! You are great!
I guess you have solved it? 😄
Yep, thank you. Dug deep into HA, learnt a lot of new for me and found that it was my configuration mistake in IP. Thank you a lot for your work! You are great!
Could you explain a little bit what you mean and how you solved this?
Versions (版本信息)
Describe the bug (描述一下问题) The issue very similar to https://github.com/mac-zhou/midea-ac-py/issues/121 . midea-discover returns different token and key at each run: First run:
Second run:
With configuration
HA can't connect to AC, with errors in logs:
Here is log file attached home-assistant.zip
When I scan opened ports of 192.168.1.104 with Network Scanner (Android app), I see one opened port 6444/tcp (unknown). When I trying to connect with telnet
telnet 192.168.1.104 6444
Connect failed:So, AC has opened port, that can't be accessed with telnet and, probably, HA too (ERROR (SyncWorker_3) [msmart.lan] Connect Error: 192.168.1.104:6444 timed out).
Any ideas, my friends?..