Giter VIP home page Giter VIP logo

Comments (3)

toblum avatar toblum commented on August 19, 2024

Dear @fthmhmt,

extending the API is easy and could be done directly in McLighting.ino.

But set_switch is only a shortcut for alerdy existing API endpoints, I think:
/set_switch=1 is equal to /set_brightness?c=255
and
/set_switch=0 is equal to /set_brightness?c=0

Isn't it possible to use these API calls in OpenHAB?

Best regards
Tobias

from mclighting.

fthmhmt avatar fthmhmt commented on August 19, 2024

Got it working with the settings below. It will dimm also the LEDs :)

rules/mqtt.rules

rule "Neopixel Lights"
    when
        Item NeoPixel received command
    then
        switch(receivedCommand) {
            case ON  : sendHttpGetRequest("http://192.168.xxx.xxx/set_brightness?p=100")
            case OFF : sendHttpGetRequest("http://192.168.xxx.xxx/set_brightness?p=0")
        }
end

items/mqtt.items
Dimmer NeoPixel "Neopixel Lights" <light> ["Lighting"] { http=">[*:POST:http://192.168.xxx.xxx/set_brightness?p=%2$s]" }

sitemaps/mqtt.sitemaps

Frame label="NeoPixel Lights" {
        Slider item=NeoPixel switchSupport
        Switch item=NeoPixel
}

Will get SK6812 LEDs because they have a second LED in Warmwhite or Coldwhite but your Code does not support it. I am not a programmer but I found here the Post of @semaf where Adafruit Neopixel supports SK6812. Is it hard to combine it with your Code?

from mclighting.

toblum avatar toblum commented on August 19, 2024

Dear @fthmhmt,

great that you figured it out.

I don't have any SK6812 available here, so I don't know what exaclty to do, to make them work. If the neopixel library natively supports them, it could be sufficient to enhance the API endpoints with an additional parameter to control the warm white led, But I'm not sure.

Best regards
Tobias

from mclighting.

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.