-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
It is recommended that you use websocket to get device status instead of requesting API #74
Comments
Hi carl, it's good to have an official API documentation! I would like to adopt the new API you've mentioned, however my ewelink device is out of order, and I don't have any other functional device to test right now. It would be hard (if not impossible) to develop such functionality without testing. Due to the virus outbreak I cannot buy a new device from taobao now, let's see if we can do this after things get back to normal. |
OK, I see, thank you for your reply. |
Hi, |
At present, we have two versions (v1 and v2) of the interface, but the document is currently only in Chinese, and the English part only has the v1 interface, which is still being translated. The device data is "thing"
|
@coolkit-carl |
Yes, it works with API, websocket is just to maintain two-way traffic. |
@coolkit-carl |
Please tell me a device ID, I want to check the protocol of the device type it belongs to |
@coolkit-carl its the TH10 and TH16 thermostat sensors. |
Ok, I have found the relevant agreement documents. I am not sure if I can provide it to you. I need to ask my leader. (Expected to reply to you tomorrow) |
i appreciate any help you can/are allowed to give! |
It looks like (based on the old docs I could find) that the full device list is only available in the HTTP API, which is probably alright if you consider only populating the devices at the point the plugin is initialised. After that you can hit the WebSocket API to get the status for a device (I've got a branch that I'm working on with an experimental implementation of this, behind a feature flag). This is going to require quite a bit of testing before it goes for a PR as I've refactored quite a bit of code to cut down on duplication, and I don't have all the devices I'd need to test this fully. Fans, temperature & humidity sensors are particularly worrying gaps. @thepotterfamily generally "params" sent for an update looks to be the same as what you would get when you get the device status. |
This is exactly how i have implemented it in my own fork of this project! |
@thepotterfamily I did wonder after seeing your fork as a result of that PR someone created if we were heading in the same direction :) I had started writing a new plugin from scratch in Typescript but then came back around to seeing how I could start with this plugin and incrementally refactor to get into a state where it could switch between the HTTP, WebSockets & Lan control APIs as desired. |
Ah if you ever feel like helping me out with my fork as well as this one... let me know! |
Hello,
There are some problems in the way of getting the device status of your project. Although the request device list (/api/user/device) can get all the device status, too many requests for the interface will cause great pressure on the coolkit server. It is recommended to use websocket to monitor and get the latest status of the device in real time.
Relevant document address: https://coolkit-technologies.github.io/apiDocs/findStatus_en.html
It can improve your project and hope to adopt it.
Thank you!
The text was updated successfully, but these errors were encountered: