Code Monkey home page Code Monkey logo

Comments (5)

st2000 avatar st2000 commented on August 30, 2024

Figured it out. There is no issue with the fine software in this project. Rather, this turned out to be working around Alexa offerings. In the end, to control a relative device I found it best to always exit the call back routine with a command to set the brightness level to a known value. Say, 128. This way we can assume the command is to increase the brightness if the formal parameter is greater than 128 and decrease the brightness if the formal parameter is less than 128. The exceptions are the command for turning on / off the light. This usually results in a value of 128. But if the user said 100%, the value is set to 255. When the user turns off the light the value is 0.

I can fork the project and add my Lutron code in the Arduino example directory. Then you could pull it back in if you want. I also used this same idea to control the volume of my TV. I can add that example as well.

from espalexa.

Aircoookie avatar Aircoookie commented on August 30, 2024

That's great! Initially I didn't understand your application but now I get that you wanted to add a device that only supports relative change (brighter/dimmer). Awesome that you found a solution! Feel free to fork the project and add your code, I could add it as an example code to control relative devices!

from espalexa.

st2000 avatar st2000 commented on August 30, 2024

I might have bitten off more than I can chew. I did a fork and will try to make a clean example. Right now my code not only controls a Lutron wall switch but also a Samsung TV. I would like to make an example for only the Lutron wall switch. But I am also using the IRremoteESP8266 project to develop the IR pulses necessary to control the Lutron wall switch. So, how common is it to include code from a different project in an example? I'm thinking this isn't so bad as I am using the IRremoteESP8266 project as it - no modifications. Regardless, I'll make an example and let you decide what to do.

from espalexa.

Aircoookie avatar Aircoookie commented on August 30, 2024

No problem at all! I really appreciate that you put in the time to write an example! Also, I like that you include the IR code, because now we don't only have an example on how to handle relative values, but also how to control IR devices from Espalexa. Thank you!

from espalexa.

st2000 avatar st2000 commented on August 30, 2024

Found some time to test the example here: https://github.com/st2000/Espalexa/tree/master/examples/EspalexaRelativeDimmer . Thought it reset when Alexa told it to turn on/off the light. But it is behaving now. So I uploaded it into my fork of your project. As I've never done a fork before, I'm not sure what is next. If you can try the example and let me know if it works for you - that would be great. Other wise I'm not sure what to add. Maybe a picture of the circuit or a schematic? (It is 2 resistors, 1 transistor & 1 IR LED.)

from espalexa.

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.