node-red-contrib-ewelink
node-red-contrib-ewelink copied to clipboard
Limit 6 devices
Hi thank you for your efforts.
While trying to implement a dynamic flow i came across a limitation. It seems you can only connect six devices on a single account. to connect more you have to use another account. Also generic device do not produce a response object
Hello @E1cid,
Are you getting an "Authentication error" or a "Service Temporary Unavailable"? (https://github.com/ottoszika/node-red-contrib-ewelink/issues/74)
Thanks, Otto
i got the service temp unavailable in html format. As i said it happens after the 6th device. i workred around it by add multiple accounts and sharing devices.
Ditto. #503 temporarily unavailable.
Im having disconected error after some hours, already shared my devices with 3 accounts but the error still appears, only 2 devices are connected per account the 6 devices can be all shared between accounts? or just the 6 of them?
I share all my devices with other accounts, just found that easier. I find that you can not log in on mobile app without the ewelink nodes losing connection. I therefore use one account for mobile app and other accounts for node-red.
Yes I created 2 extra accounts just for node-red but I still loose the connection , only 2 devices per account stay connected
From: E1cidmailto:[email protected] Sent: 4 de junho de 2020 19:30 To: ottoszika/node-red-contrib-ewelinkmailto:[email protected] Cc: Bruno Miguel Matalotomailto:[email protected]; Commentmailto:[email protected] Subject: Re: [ottoszika/node-red-contrib-ewelink] Limit 6 devices (#77)
I share all my devices with other accounts, just found that easier. I find that you can not log in on mobile app without the ewelink nodes losing connection. I therefor use one account for mobile app and other accounts for node-red.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ottoszika/node-red-contrib-ewelink/issues/77#issuecomment-639032674, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHZRDZQWSPTEXVDQBFVSKO3RU7R4RANCNFSM4KBNYW4Q.
Are they devices or listeners?
All devices and just 1 listener
Com os melhores cumprimentos, Bruno Mataloto, nº70082 DCTI
From: E1cid [email protected] Sent: Thursday, June 4, 2020 7:33:19 PM To: ottoszika/node-red-contrib-ewelink [email protected] Cc: Bruno Miguel Mataloto [email protected]; Comment [email protected] Subject: Re: [ottoszika/node-red-contrib-ewelink] Limit 6 devices (#77)
Are they devices or listeners?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ottoszika/node-red-contrib-ewelink/issues/77#issuecomment-639034542, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHZRDZQTUFHAMWJZBSQNYC3RU7SG7ANCNFSM4KBNYW4Q.
Same as my set up, i am not seeing any issues. Have you tried restarting the node_red server? I have 12 devices over 2 accounts and a listener on its own account.
The listener should be in a separate account?
Com os melhores cumprimentos, Bruno Mataloto, nº70082 DCTI
From: E1cid [email protected] Sent: Thursday, June 4, 2020 8:28:10 PM To: ottoszika/node-red-contrib-ewelink [email protected] Cc: Bruno Miguel Mataloto [email protected]; Comment [email protected] Subject: Re: [ottoszika/node-red-contrib-ewelink] Limit 6 devices (#77)
Same as my set up, i am not seeing any issues. Have you tried restarting the node_red server? I have 12 devices over 2 accounts and a listener on its own account.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ottoszika/node-red-contrib-ewelink/issues/77#issuecomment-639068985, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHZRDZUBHMILABST67QFDODRU7YUVANCNFSM4KBNYW4Q.
I don't think it has to be, but mine is.
I am afraid I am still stucking on 401 authorizatio error issue. You have mentioned in previous conversations that you have made a global connection which use 1 login at the same time, but I did not find how to do it. Or - Is there a chance for example to specify deviceId as a node property over a JSON format in msg.payload? It could solve the problem as we will have only 1 node for switch on and off and deviceId we want to switch will be in msg.payload......
Here I have same issue, even after paid "Annual Advanced subscription"
I keep having 6 account limit. I shared the devices over 3 accounts (owner + 2 shared) but always only 6 nodes connected, no matter which account I use. Other nodes return: FetchError: invalid json response body at https://eu-api.coolkit.cc:8080/api/user/login reason: Unexpected token < in JSON at position 0
P.S.: I'm glad to try to help with the code if someone give me some hint about where to start.
Hi all,
I have found a solution to read Ewelink devices status, doest matter how many.
I have used Devices node to read all devices status, and after filtering any of them
To send a command to Ewelink I am using IFTTT
Hi all,
I have found a solution to read Ewelink devices status, doest matter how many.
I have used Devices node to read all devices status, and after filtering any of them
To send a command to Ewelink I am using IFTTT
Hi sergey08, that's smart. If we get an equivalent method to write status, we can solve every situation. Nonetheless, it would be nice to have the nodes working as they are now!
Node palette has an update 5 days ago!!!
Version 2.0
https://flows.nodered.org/node/node-red-contrib-ewelink
Maybe fix it
IMHO lib should use serverless mode: saving token and reuse it. Other thing I noticed is that if you send many commands at the same time (to different sonoff devices) they will fail. May be it is a similar problem for connection?
P.S: I'm using the latest version.
I managed to overcome the limit of 6 devices making a connection pool and reusing them when needed. I just modified the 'ready' promise function in file ewelink-connect.js like this:
ready (RED, node, config) {
// Get credentials node
const credentialsNode = RED.nodes.getNode(config.auth);
// Check for valid credential node
if (!credentialsNode) {
throw new Error('No credentials provided!');
}
// Set the node status to 'connecting'
this.setNodeStatusToConnecting(node);
if (globalThis.connectionPool == undefined)
globalThis.connectionPool = [];
// search for stored connection(Promise) in global array
for (let storedConnection of globalThis.connectionPool) {
if (storedConnection.credential == config.auth) {
this.setNodeStatusToConnected(node);
return storedConnection.connection;
}
}
let connectionPromise = new Promise((resolve, reject) => {
credentialsNode.connection.getCredentials().then(response => {
if (response.error) {
this.setNodeStatusToDisconnected(node);
return reject(response);
}
this.setNodeStatusToConnected(node);
return resolve (credentialsNode.connection);
})
.catch(error => {
this.setNodeStatusToDisconnected (node);
reject(error);
});
});
let newConnection = {
credential: config.auth,
connection: connectionPromise
};
globalThis.connectionPool.push(newConnection); //append to global array for reuse
return connectionPromise;
}
I'm a beginner with js so maybe this is not the best solution. Anyway it works on my setup. I'm happy to elaborate it in a better way if someone points me in the right direction.
Very interesting. Good job!!!
Look works!!!!!
I have found ewelink-connect.js in the path /.node-red/node_modules/node-red-contrib-ewelink/src/utils Is this file the one we have to edit?
I have tried and I think you miss a , at the end
.... }; globalThis.connectionPool.push(newConnection); //append to global array for reuse
return connectionPromise; },
That the only way node keep working for me.
Thanks a lot!!!!
Very interesting. Good job!!!
Look works!!!!!
I have found ewelink-connect.js in the path /.node-red/node_modules/node-red-contrib-ewelink/src/utils Is this file the one we have to edit?
I have tried and I think you miss a , at the end
.... }; globalThis.connectionPool.push(newConnection); //append to global array for reuse
return connectionPromise; },
That the only way node keep working for me.
Thanks a lot!!!!
I confirm, the file is that one. And you're right about the comma at the end. Sorry, it wasn't clear.
I also confirm this works perfectly, is there any reason this is not included in the codebase?
Great work @1101101011011110 , thank you very much!
Thank you @nareso for pointing this in another issue.
Hallo zusammen, habe auch versucht oben genannten code zu verwenden. Leider habe ich immer noch das Problem das mindestens 2 meiner 8 Geräte als nicht conncted angezeigt werden. Was aber lustig ist..... 1 Gerät ist definiv offline da nicht eingesteckt wird aber manchmal als connected angezeigt?