twocolors / node-red-contrib-midea-hvac

Nodes for controlling Midea HVAC in Node-RED
MIT License
5 stars 2 forks source link

Automatic Token/Key retrieve not working #19

Open bandit7311 opened 9 months ago

bandit7311 commented 9 months ago

Hey there,

is it possible to set the Token / Key / Device ID manually in the flow? As it seems not to be possible anymore to retrieve this info through the Cloud

Thanks Solong B

twocolors commented 9 months ago

use SmartHome and re-install node (will install new node-mideahvac 0.3.1 where fix get token )

bandit7311 commented 9 months ago

Thanks, did that but the discover still says no Midea HVAC devices found, ping work to device, OSK103 in use, what else can be the issue? @twocolors

Thanks B

dosordie commented 8 months ago

With the fix from new node-mideahvac i get the token ect on the cli midea discover tool. But in node red my ac will not be found (it is an a other subnet) Is there a way to enter the auth key / token manualy? If yes, in witch file?

dosordie commented 8 months ago

With the fix from new node-mideahvac i get the token ect on the cli midea discover tool. But in node red my ac will not be found (it is an a other subnet) Is there a way to enter the auth key / token manualy? If yes, in witch file?

I hardcoded the ip / key / token in the config.js file and it worked fine case "osk103": options = { communicationMethod: "sk103", host: "192.168.160.30", port: "6444", id: ".......0b................", key: ".........1eaf..........................", token: ".....23ECE52FE..................", };

I noticed that the token is only valid for a few hours. How can I modify the script so that it finds devices in a different subnet, or can I specify the IP?

dosordie commented 8 months ago

NodeMidea To test it, I have the Wifi dongle in the same subnet as the iobroker / nodered.

Then the AC is also found, but in the debug log the Auth Token and Key are undefined.

With the CLI Midea discover tool you can get an auth token and key without any problems

dosordie commented 8 months ago

i compared the discover.js with the discover.js from node-mideahvac Then i changed the folloing part to: if (cloudClient) { await cloudClient.getToken(appliances[i].id.toString(16), appliances[i].udpId) .then(pair => { appliances[i].key = pair.key; appliances[i].token = pair.token;

And it works fine :)

the device in a different subnet also works. but only if I replace the IP "255.255.255.255" with "192.168.160.255" in discover.js Could you create a variable for the first three digits here? I think node-mideahvac did this in his discover.js

bandit7311 commented 8 months ago

For me it does not discover any device, the AC is ping-able from nodered, dont know how to help. For me a non-auto-discover with just adding the values manually like ip address and id/key/token much better...

Solong B