Comments (13)
Docs where updated.
Thanks @ttz642 for your feedback.
from ewelink-api.
I'm in south america, the app works instantaneously, but the API takes up to 15-20 secs to toggle on/off any device. Im using the correct region. Also, i tried with other regions, and no better results... any advice to get lower delay?
Do you log in each time or have you got an application running which only logs in once?
from ewelink-api.
I've split my application into services that run constantly and thus only connect once, or reconnect on error.
www - operator interface to control panel to show/change state of devices & edit switching table
events - captures events from the devices (via the cloud at the moment, looking to implement over LAN)
lanSwitcher - process to change device state
scheduler - changes device state according to the switching table which has state of devices over complete day in 5 min slots
I use REST (ie web services) to send messages between services.
Might package up one day and upload to github when I get the time.
interface to control panel to show/change state of devices
from ewelink-api.
Hello @ttz642
You're right, by default is connecting to us server, and finding your right region and switching in case of an error, that's why the delay.
So, first thing is to update documentation to specific you need to set your region and leave empty in case of not knowing.
I never had troubles like people are reporting on #21, probably because i'm on us
region.
Conclusion, you need to set region ever, specially if you're connecting with api key and token.
The second part, the lan mode.
There are a couple of PRs open for this feature, but the original author didn't respond on the last weeks.
I will try to push this changes to include on next weeks.
from ewelink-api.
Martin,
The second part, the lan mode.
There are a couple of PRs open for this feature, but the original author didn't respond on the last weeks.
I will try to push this changes to include on next weeks.
I will test / debug . . .
--
Steve
from ewelink-api.
Hello @ttz642
Docs where updated, here are the list of pages who have changed:
- quickstart
- class-instantiation
- demos/node
- demos/serverless
Would be great if you can take a look and let me know if i missed something.
Thanks.-
from ewelink-api.
Martin,
- quickstart
- class-instantiation
For consistency could you change quickstart to use connection as all other sections of the documentation use rather then being different and using conn?
Also could you add the warning you have in:
- class-instantiation
- demos/serverless
to: - quickstart
- demos/node
Also perhaps change the demos/serverless examples to use the region returned from the login for the subsequent access using accesstoken and apikey, ie:
- const region = login.region;
Otherwise looks good.
--
Steve
from ewelink-api.
Martin,
Docs where updated.
One last minor suggestion, perhaps add:
console.log('region: ', login.region);
to the login method so it's the same as the serverless demo.
from ewelink-api.
Hi,
I am using ewelink-api.
I've used the toggle function five times in a row.
It works between five and six seconds. Is this normal ?
ok1 Fri Jan 03 2020 21:52:52 GMT+0300 (GMT+03:00)
ok2 Fri Jan 03 2020 21:52:56 GMT+0300 (GMT+03:00)
ok3 Fri Jan 03 2020 21:53:01 GMT+0300 (GMT+03:00)
ok4 Fri Jan 03 2020 21:53:05 GMT+0300 (GMT+03:00)
ok5 Fri Jan 03 2020 21:53:10 GMT+0300 (GMT+03:00)
from ewelink-api.
Hi,
I am using ewelink-api.
I've used the toggle function five times in a row.
It works between five and six seconds. Is this normal ?
I experienced it at ~ 6s and got it down to ~ 2s. I think there are some tweaks needed for the performance of the code.
doganbulut what region are you in, are you using the correct one? See issue #53
I'm guessing GMT+3 you should be using eu, see what gets returned. Call class instantiation with no region and the getCredentials, see: https://ewelink-api.now.sh/docs/class-instantiation
After migrating to the 2.0 code I might have a look seeing where the bottlenecks are.
from ewelink-api.
I'm in south america, the app works instantaneously, but the API takes up to 15-20 secs to toggle on/off any device. Im using the correct region. Also, i tried with other regions, and no better results... any advice to get lower delay?
from ewelink-api.
I'm in south america, the app works instantaneously, but the API takes up to 15-20 secs to toggle on/off any device. Im using the correct region. Also, i tried with other regions, and no better results... any advice to get lower delay?
Do you log in each time or have you got an application running which only logs in once?
I login each time. How can i let the session open?
from ewelink-api.
Hey @jmarfia
You can try to get your access token and api key and use instead of login with user/pass all the time.
First, get your credentials: https://github.com/skydiver/ewelink-api/blob/master/docs/available-methods/getcredentials.md
Initialize the class using at
and apiKey
: https://github.com/skydiver/ewelink-api/blob/master/docs/class-instantiation.md
Get your device as usual: https://github.com/skydiver/ewelink-api/blob/master/docs/available-methods/getdevice.md
from ewelink-api.
Related Issues (20)
- Install error
- Trouble with getDevicePowerUsage
- How do I know the type of device (Power meter, thermometer, etc.)? HOT 1
- Slow api, ETIMEDOUT, ECONRESET, ECONNREFUSED HOT 14
- problem with setInterval wsp.send('ping') openWebSocket.js HOT 1
- { error: 500, msg: 'SyntaxError: Unexpected token < in JSON at position 0' } HOT 1
- New and Simple REST API with Ready Scripts
- Error 401: Wrong account or password HOT 21
- ewelink
- Unable to install on Raspberry Pi
- THR316 doesn't update
- Unable to use power consumption with sonoff POW Elite HOT 6
- Get Voltage and current on POWR2 device HOT 2
- CoolkIt: Announcement regarding the expiration of the APPID referenced in this project and the cessation of maintenance of the v1 interface, suggesting migration HOT 7
- Error 401: Wrong account or password -- again HOT 54
- Error: 406 { error: 406, msg: 'Authentication failed' } HOT 21
- Support for changing the network indicator led?
- Is There Any PHP Version HOT 1
- error: 401, msg: 'Wrong account or password'
- Sonoff Dual R3 - Power Consumption Issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ewelink-api.