Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magic Home IR controller with rotary encoder #1250

Closed
lj502 opened this issue Oct 7, 2018 · 4 comments
Closed

Magic Home IR controller with rotary encoder #1250

lj502 opened this issue Oct 7, 2018 · 4 comments
Milestone

Comments

@lj502
Copy link

lj502 commented Oct 7, 2018

First off, Espurna is great. I used the rotary encoder code from the Xiaomi Smart desk lamp and made a new device with 3 rgb outputs, IR control, and added a rotary encoder that allows local on/off/dim control. It works great and makes this so much more useful. The encoder uses gpio's 1,3 with 0 as the button, this keeps gpio 4 for IR and all is good. Wow I had a question but I'm blank now, I'll be back

John

@xoseperez
Copy link
Owner

No worries! Come back when you remember the question. 😄

@lj502
Copy link
Author

lj502 commented Oct 7, 2018

With the IR remote we have dim up and dim down buttons, is there any way to do the same with switches connected to gpio's. I have a use where there is already buttons installed on an old jukebox and I need to use those as dim up and dim down, something like lightStepBrightness ?

Thanks for all your work here!
John

@xoseperez
Copy link
Owner

No, that's not implemented, but it can be a good enhancement. There is still room to add more actions to the button handler.

@xoseperez xoseperez added the enhancement New feature or request label Oct 8, 2018
@xoseperez xoseperez added this to the 1.13.4 milestone Oct 8, 2018
@xoseperez
Copy link
Owner

Implemented with latest dev commit. You can use with the BUTTON_MODE_DIM_DOWN and BUTTON_MODE_DIM_UP actions.:

#elif defined(WEMOS_D1_MINI)

    // Info
    #define MANUFACTURER        "WEMOS"
    #define DEVICE              "D1_MINI"
    #define RELAY_PROVIDER      RELAY_PROVIDER_LIGHT
    #define LIGHT_PROVIDER      LIGHT_PROVIDER_DIMMER
    #define DUMMY_RELAY_COUNT   1

    // Buttons
    #define BUTTON1_PIN         12
    #define BUTTON1_MODE        BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
    #define BUTTON1_CLICK       BUTTON_MODE_DIM_UP

    #define BUTTON2_PIN         14
    #define BUTTON2_MODE        BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
    #define BUTTON2_CLICK       BUTTON_MODE_DIM_DOWN

    // Light
    #define LIGHT_CHANNELS      1
    #define LIGHT_CH1_PIN       4
    #define LIGHT_CH1_INVERSE   0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants