skydiver / ewelink-api

eWeLink API for JavaScript
https://www.npmjs.com/package/ewelink-api
MIT License
264 stars 108 forks source link

Missing colour control? #142

Open scargill opened 3 years ago

scargill commented 3 years ago

Hi

I just grabbed the node-red-contrib-ewelink node set for Node-Red to try out my new Itead Sonoff B05 RGB Smartlamp. Everything works perfectly, but neeither in the NODE set, nor in the API methods can I find any reference to the colour controls, or scenes, schedules or timers. All I seem to be able to do is turn the light on or off - or check it's state etc. HELP...

Regards

Peter Scargill

johnsteeleMolinare commented 2 years ago

Just wanted to check if there is any way to use the colour controls/ brightness for this? On/Off is great but I would need those controls for it to be really useful. Unless anyone knows another node that can do this with the Zigbee Bridge?

scargill commented 2 years ago

I've been busy house-moving and lots of other things like a busy time with my blog- but I'd really like to see colour controls in here... any chance?

AndrazPustotnik commented 1 year ago

I've been busy house-moving and lots of other things like a busy time with my blog- but I'd really like to see colour controls in here... any chance?

I just forked the repo where I converted from CJS to ES6 and added function setDeviceParams(<deviceId>, <paramsObject>). With that function you can change any parameter a light include (r, g, b, brightness, mode...). Try it: npm install AndrazPustotnik/ewelink-api

spoonwzd commented 1 year ago

Some noob questions @AndrazPustotnik

  1. Do I install this directly over the current nod-red-contrib-ewlink package?
  2. Which node does this affect? I assume the eWeLink device node as I see no new node in the list after install.
  3. Can you provide an example flow on how I send the setDeviceParams to an eWeLink device?

I've tried, but I don't seem to be able to figure this out on my own... :(

Thanks in advance.

AndrazPustotnik commented 1 year ago

@spoonwzd You will have to use my forked repo. It is personalized so I can't guarantee anything. It also may not be public in the future. Here is example: 1.) npm install AndrazPustotnik/ewelink-api 2.) import eWeLink from 'ewelink-api' 3.) const eWeLinkConnection = new eWeLink({ email: your_email, password: your_password }); 4.) in async function: let response = await eWeLinkConnection.setDeviceParams(deviceId, params); note that if you don't know device params you can get it by: const devices = await eWeLinkConnection.getDevices() also here is example of params for lights: const params = { colorR: 255, colorG: 25, colorB: 125 }

spoonwzd commented 1 year ago

Thanks @AndrazPustotnik

I'm starting to think I might have better success going the Tasmota route with this Sonoff Zigbee coordinator...

johnsteeleMolinare commented 10 months ago

Just wanted to check if anyone is able to build Andraz’s additional Colour options into the node-red app? I don’t have enough knowledge to follow the method described of using it in this post. It would be great if it was added in a user friendly way to the nodes.

AndrazPustotnik commented 10 months ago

For everybody trying to use skydiver's ewelink-api, it is not working anymore. This is the new api: https://github.com/coolkit-carl/ewelink-api-next