marcelslabosz / domoticz_sonoff_ewelink_api_plugin Goto Github PK
View Code? Open in Web Editor NEWDomoticz plugin for Sonoff Original Soft eWeLink API
Domoticz plugin for Sonoff Original Soft eWeLink API
Sometimes retrieved auth token expires. I think, plugin should require login and password of the account to automate process of token renewal.
Hi,
Everything is fine until I activate the device in domoticz.
There is an authentication error in Domoticz.
2021-09-25 03:01:24.946 SONOFF S26 hardware started.
2021-09-25 03:01:24.945 Status: SONOFF S26: (SONOFF S26) Entering work loop.
2021-09-25 03:01:24.946 Status: SONOFF S26: (SONOFF S26) Started.
2021-09-25 03:01:25.164 SONOFF S26: (SONOFF S26) Starting Sonoff API plugin. language: fr
2021-09-25 03:01:25.162 Status: SONOFF S26: (SONOFF S26) Initialized version 0.1.0, author 'Marcel Słabosz'
2021-09-25 03:01:34.080 SONOFF S26: (SONOFF S26) Try to refresh device status...
2021-09-25 03:03:43.955 SONOFF S26: (SONOFF S26) onCommand called for Unit 1: Parameter 'On', Level: 0
2021-09-25 03:03:43.913 Status: User: Admin (IP: 192.168.1.61) initiated a switch command (217/SONOFF S26 - Switch/On)
2021-09-25 03:03:45.322 SONOFF S26: (SONOFF S26) Api call response status: {'error': 406, 'msg': 'Authentication failed'}
Hi,
I have an error to get credentials.
pi@raspberrypi:~/domoticz/plugins/domoticz_sonoff_ewelink $ node get_credentials.js
Obtaining credentials.../home/pi/node_modules/node-fetch/lib/index.js:273
return Body.Promise.reject(new FetchError(invalid json response body at ${_this2.url} reason: ${err.messag e}
, 'invalid-json'));
^
FetchError: invalid json response body at https://eu-api.coolkit.cc:8080/api/user/login reason: Unexpected token < in JSON at position 0
at /home/pi/node_modules/node-fetch/lib/index.js:273:32
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async eWeLink.getCredentials (/home/pi/node_modules/ewelink-api/src/mixins/getCredentials.js:32:20)
at async /home/pi/domoticz/plugins/domoticz_sonoff_ewelink/get_credentials.js:9:18 {
type: 'invalid-json'
}
thank you
Vincent
Error after first install:
domoticz@domoserver:/domoticz/plugins/sonoff_ewelink$ node -v/domoticz/plugins/sonoff_ewelink$ node get_credentials.js
v12.20.2
domoticz@domoserver:
Obtaining credentials...
(node:1864901) UnhandledPromiseRejectionWarning: FetchError: request to https://it-api.coolkit.cc:8080/api/user/login failed, reason: getaddrinfo ENOTFOUND it-api.coolkit.cc
at ClientRequest. (/home/domoticz/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:314:20)
at TLSSocket.socketErrorListener (_http_client.js:427:9)
at TLSSocket.emit (events.js:314:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:1864901) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1864901) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Credential are correct
Thank you
Aldo
Cześć.
Raczej nie problem tylko pytanie.
Działa mi wszytsko oki.
Chciałbym dodać z-czytywanie z Sonoffa z ewelinka jeszcze temperatury i wilgotności.
mam Sonoff TH16 + AM2301
Dzięki z góry za odpowiedź.
Hi,
I have an error in Domoticz log after add 1 switch.
2020-10-02 14:32:26.693 Error: (SONOFF) "onHeartbeat" failed "FileNotFoundError".
2020-10-02 14:32:26.693 Error: (SONOFF) ----> Line 239 in "/home/pi/domoticz/plugins/domoticz_sonoff_ewelink_api_plugin/plugin.py", function onHeartbeat
2020-10-02 14:32:26.694 Error: (SONOFF) ----> Line 168 in "/home/pi/domoticz/plugins/domoticz_sonoff_ewelink_api_plugin/plugin.py", function on_heartbeat
2020-10-02 14:32:26.694 Error: (SONOFF) ----> Line 185 in "/home/pi/domoticz/plugins/domoticz_sonoff_ewelink_api_plugin/plugin.py", function _refresh_state
2020-10-02 14:32:26.694 Error: (SONOFF) ----> Line 175 in "/home/pi/domoticz/plugins/domoticz_sonoff_ewelink_api_plugin/plugin.py", function _call_api
2020-10-02 14:32:26.695 Error: (SONOFF) ----> Line 803 in "/usr/lib/python3.7/subprocess.py", function __init__
2020-10-02 14:32:26.695 Error: (SONOFF) ----> Line 1522 in "/usr/lib/python3.7/subprocess.py", function _execute_child
2020-10-02 14:32:26.903 Error: (SONOFF) "onCommand" failed "FileNotFoundError".
2020-10-02 14:32:26.904 Error: (SONOFF) ----> Line 224 in "/home/pi/domoticz/plugins/domoticz_sonoff_ewelink_api_plugin/plugin.py", function onCommand
2020-10-02 14:32:26.904 Error: (SONOFF) ----> Line 147 in "/home/pi/domoticz/plugins/domoticz_sonoff_ewelink_api_plugin/plugin.py", function on_command
2020-10-02 14:32:26.904 Error: (SONOFF) ----> Line 175 in "/home/pi/domoticz/plugins/domoticz_sonoff_ewelink_api_plugin/plugin.py", function _call_api
2020-10-02 14:32:26.905 Error: (SONOFF) ----> Line 803 in "/usr/lib/python3.7/subprocess.py", function __init__
2020-10-02 14:32:26.905 Error: (SONOFF) ----> Line 1522 in "/usr/lib/python3.7/subprocess.py", function _execute_child
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.