Have to recreate ewelink listener after every restart

Listener is not active after restart of the server.
I am using ewelink listener a lot. I am receiving all changes from my smart switches in my house.
Today I was doing several restarts of node-red and I realized, that after each restart listener is not sending any msg messages. Even if simply connect it to debug node is not sending anything. Although it is showin "connected" icon. I have to recreate ewelink listener again, select credentials created before and it is working. I don't like this behavious, because that means I will have to do manually after every restart.
Any idea what could be the reason for that?
I am pasting also log after start of node-red.

demokedes@NodeRed:~$ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
14 Feb 19:25:03 - [info]
Welcome to Node-RED
14 Feb 19:25:03 - [info] Node-RED version: v2.2.0
14 Feb 19:25:03 - [info] Node.js  version: v16.14.0
14 Feb 19:25:03 - [info] Linux 5.4.0-1069-azure x64 LE
14 Feb 19:25:03 - [info] Loading palette nodes
Mon, 14 Feb 2022 19:25:04 GMT node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. at node:internal/modules/cjs/loader:1103:14
14 Feb 19:25:05 - [info] RedBot version: 0.19.11 (node-red-contrib-chatbot)
14 Feb 19:25:07 - [info] Dashboard version 3.1.5 started at /ui
14 Feb 19:25:07 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
14 Feb 19:25:07 - [info] Settings file  : /home/demokedes/.node-red/settings.js
14 Feb 19:25:07 - [info] Context store  : 'default' [module=memory]
14 Feb 19:25:07 - [info] User directory : /home/demokedes/.node-red
14 Feb 19:25:07 - [warn] Flows file name not set. Generating name using hostname.
14 Feb 19:25:07 - [info] Flows file     : /home/demokedes/.node-red/flows_NodeRed.json
14 Feb 19:25:07 - [info] Server now running at
14 Feb 19:25:07 - [warn]
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
14 Feb 19:25:07 - [info] Starting flows
14 Feb 19:25:07 - [info] Started flows
![Screenshot 2022-02-14 203144|634x190](upload://mQHo7f919W3IC7mcAYI4A0ER0vU.jpeg)

Screenshot 2022-02-14 203144

You might want to search the GitHub issues page for the node Issues · ottoszika/node-red-contrib-ewelink · GitHub and if you don't find something open an issue.

Just did
Thank you.

I use Ewelink in NR for control / report on a bunch of cottage devices (water heater, heat, etc...).

What you may not be seeing is that very often (way too often) when working within the Ewelink NR tab, after DEPLOY, (deploy set to only nodes that have been changed) the Ewelink nodes are getting server msgs like "400" or "401" or "406". They go from green "Connected" to yellow "Connecting" and then to green "Connected", making everything look fine however it is not. I had to add this code to my receiver output so I knew when the problem happens (again, way too often). "notice" is a pop-up on the Dashboard.

// Error 400 Bad Request Error 
// Error 401 Unauthorized Error
// Error 406 Not Acceptable

if (msg.payload.error === 400 || msg.payload.error === 401 || msg.payload.error === 406 ) 
    var notice = {payload: "Authentication error!"};
    node.status({fill: "red", shape: "dot", text: msg.payload.error+":"+msg.payload.msg});
    return [notice, retry_AUTH];


I suspect it has something to do with the fact that each access identity can have only one session (you can register or "share" the account with another identity but that is different), and that maybe when we DEPLOY it looks like a request to create a second session by our NR identity. I find that to fix the problem you can double click the receiver node, click the "pencil" icon to edit the eWeLink Credentials, put the cursor on the password field (but don't touch the keyboard, just put the cursor there), then UPDATE, UPDATE. Somehow that causes a stop of the previous session (most times).

Given the way the server manages access I think the Ewelink nodes should try to log out before they try to log in ( after DEPLOY, send disconnect, send connect). The suggestion I make above at least saves you the time of deleting and re-entering all the credential stuff again. I had sent messages (eons ago) to @skydiver asking about this (aand who could address it) but there has been no response.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.