Giter Club home page Giter Club logo

Comments (6)

mariusmotea avatar mariusmotea commented on August 11, 2024

Hi.

The json body must be based on Hue api and you can check how it is parsed here: https://github.com/diyhue/Lights/blob/master/ESP8266/Hue_Gradient_Lightstrip_WS2812/Hue_Gradient_Lightstrip_WS2812.ino#L692-L701

So it must look like: {"gradient": {"points": [ {"color": {"xy": {"x": 0.53, "y": 0.21}}}, {"color": {"xy": {"x": 0.13, "y": 0.2}}}, {"color": {"xy": {"x": 0.3, "y": 0.3}}}]}}

Note that the number of segments is dynamically updated based on the number of "points" from the request witch is a list, in my example are 3, but can be between 2 up to 10.

P.S. The emulated bridge must not be slow, here probably you have another issue.

GitHub
DIY lights with support for diyHue. Contribute to diyhue/Lights development by creating an account on GitHub.

from lights.

Arlodotexe avatar Arlodotexe commented on August 11, 2024

I was poking through this source code quite a bit and saw this was possible, although I tried it and it caused a failure that rebooted the device for some reason.

The provided JSON does work though. Must have been a syntax error. Thank you @mariusmotea! Maybe worth adding to the docs?

from lights.

Arlodotexe avatar Arlodotexe commented on August 11, 2024

Wait, gradients work, but I still need the ability to change individual LEDs for custom effects. It doesn't look like this is possible via the API, would I need to modify and compile my own firmware?

from lights.

Mevel avatar Mevel commented on August 11, 2024

LEDs are grouped into virtual lights. There is no per pixel manipulation via api.

from lights.

mariusmotea avatar mariusmotea commented on August 11, 2024

You can implement custom effects intro the firmware, check fireplace and candle effects that are already there. If you manage to add nice effects feel free to open a pull request with your changes.

from lights.

Arlodotexe avatar Arlodotexe commented on August 11, 2024

It may be more appropriate to say that I'm trying to create dynamic effects using external sensors. Only illuminating where a person is standing, for example, without breaking Hue compatibility.

Seems like something I'd need to add support for under the /state/ endpoint. It wouldn't be compatible with Hue, but it would do the trick.

from lights.

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.