GithubHelp home page GithubHelp logo

Change color ? about ewelink-api HOT 7 CLOSED

skydiver avatar skydiver commented on June 20, 2024
Change color ?

from ewelink-api.

Comments (7)

skydiver avatar skydiver commented on June 20, 2024

Hello @foulek57

I don't have access to this device so i can't answer your question.

Hope someone else can help with your question.

from ewelink-api.

ttz642 avatar ttz642 commented on June 20, 2024

Is it possible to change the led color of light switches?

In bedroom it would be better if off color were pink and on blue. Easier to sleep.

from ewelink-api.

foulek57 avatar foulek57 commented on June 20, 2024

Hello,

I think have find a way, will do some test and come back to you

from ewelink-api.

foulek57 avatar foulek57 commented on June 20, 2024

Hello,

Have fins a way ans it's work !
Juste need to send over thΓ© socket the json with the value at each color red green blue.
Possible to include it in your code ?
I can give you the complet json I send

from ewelink-api.

ttz642 avatar ttz642 commented on June 20, 2024

foulek57, post the json.

I'm guessing it makes sense to create a new method to configure devices, ie:

  • setDeviceConfig()

this would be very similar to:

  • setDevicePowerStateMixin()

from ewelink-api.

foulek57 avatar foulek57 commented on June 20, 2024

Hello,

I don't know if they are the same params on all lighting I need the results of getdevice of the LED strip to compare

from ewelink-api.

foulek57 avatar foulek57 commented on June 20, 2024

Here the script I used for, note that I run it with a server and send my request with a http request

`app.get('/wi16/:device_id/:apikey/:r/:g/:b/:lb', function(req, res)
{
(
async () =>
{
var device_id = req.params.device_id;
var apikey = req.params.apikey;
var r = req.params.r;
var g = req.params.g;
var b = req.params.b;
var lb = req.params.lb;

              const timeStamp = new Date() / 1000;
              const sequence = Math.floor(timeStamp * 1000);
              var payload = {};
              payload.action = 'update';
              payload.userAgent = 'app';
              payload.apikey = '' + apikey;
              payload.deviceid = '' + device_id; 
              payload.params = {};
              payload.params.lightBcolor = b; // 0-255
              payload.params.lightRcolor = r;
              payload.params.lightGcolor = g;
              payload.params.lightbright = lb; // 0-100%
              payload.sequence = '' + sequence; 
              var string = JSON.stringify(payload);
              console.log(string);
              res.send(string);
              socket.send(string);
            }
        )();
        }); `

Have it in the async function of the socket.

from ewelink-api.

Related Issues (20)

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.