node-mideahvac icon indicating copy to clipboard operation
node-mideahvac copied to clipboard

No Authentication Key and Token

Open jeburkha opened this issue 1 year ago • 12 comments

Hi

Midea-discover finds my appliance, but when I try to get an authentication key and token, I get:

  • Authentication Key: An unknown error occurred
  • Authentication Token: An unknown error occurred

The credentials work on the SmartHome App on my Android phone, but the App is now called SmartHome, not MSmartHome any more. Would appreciate a hint!

jeburkha avatar Oct 08 '23 08:10 jeburkha

@jeburkha I had a same problem. Found out that building serialbridge dongle is really easy (thus I do not need any authentication nor 3rd party cloud):

  • ESP8266 ESP-01S wifi module
  • ESP8266 adapter 3.3V to 5V for ESP-01
  • ESP-01 USB ESP8266 serial for programming (there are versions with programming switch and without - I got without and then followed instructions in this video to add jumpers: https://www.youtube.com/watch?v=6uaIWZCRSz8&t=187s)
  • Jumper cables to connect adapter with AC

⚠️ Do not connect the ESP8266 to AC with the programmer USB module. You have to use the 3.3V to 5V adapter (I damaged one board by not doing this). The programmer is used only for flashing.

image image image image

svobol13 avatar Jan 07 '24 12:01 svobol13

Yes, I know, I already implemented this workaround. But it doesn't solve the problem that it is not possible any more to get an authentication key and token from Smart Home.

jeburkha avatar Jan 07 '24 15:01 jeburkha

I had another look at the code and I think I fixed the issue. Would be great if you can test.

reneklootwijk avatar Jan 07 '24 19:01 reneklootwijk

Ok, great! I will do the test, but it will take some time, because i first have to change the interface...

jeburkha avatar Jan 07 '24 19:01 jeburkha

You can just run the discover command to obtain token and key, no need to change anything on your side.

reneklootwijk avatar Jan 07 '24 19:01 reneklootwijk

Does the discover command work without an interface in my network? Because I changed the interface to the self built one... If not, I first have to change the interface in my AC!

jeburkha avatar Jan 07 '24 19:01 jeburkha

Ah, I think I misunderstood you. You have to put the original dongle in the appliance you mean? The discovery command indeed only works with the original dongle (it does not make sense when using a DIY dongle).

reneklootwijk avatar Jan 07 '24 19:01 reneklootwijk

BTW in my experience a DIY dongle is far more stable than the original dongle. The original dongle periodically loses its WiFi connection and needs to be power cycled to recover again.

reneklootwijk avatar Jan 07 '24 19:01 reneklootwijk

Yes, I use the diy interface at the moment, but it's my request after all, so I'll do the test when I get the chance. But please be patient! Yes I confirm. My original interface lost the connection almost all days.

jeburkha avatar Jan 07 '24 19:01 jeburkha

I wanted to do the test with the original interface this weekend, but unfortunately I can't find it anymore! I probably put it in the original packaging of the air conditioning system and then disposed of the box later. I'm really sorry. But to everyone reading this: Don't buy the original interface. It keeps losing the connection. The DIY interface works much more reliable.

jeburkha avatar Jan 21 '24 14:01 jeburkha

@jeburkha upgraded to 0.3.1 and unfortunately it does not work for me with same error as before.

svobol13 avatar Jan 21 '24 23:01 svobol13

Maybe the issue you experienced was due to a breaking change in node > 20.x where the dns lookup fails. Support for node version > 20.x has been added in version 0.3.3.

reneklootwijk avatar Apr 26 '24 20:04 reneklootwijk