Giter Club home page Giter Club logo

domoticz_sonoff_ewelink_api_plugin's People

Contributors

marcelslabosz avatar

Watchers

 avatar  avatar  avatar

domoticz_sonoff_ewelink_api_plugin's Issues

Auth token renewal

Sometimes retrieved auth token expires. I think, plugin should require login and password of the account to automate process of token renewal.

Authentication failed in Domoticz

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'}

invalid json response body

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

Error after first install:

domoticz@domoserver:/domoticz/plugins/sonoff_ewelink$ node -v
v12.20.2
domoticz@domoserver:
/domoticz/plugins/sonoff_ewelink$ node get_credentials.js
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ść

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ź.

onHeartbeat failed FileNotFoundError

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.