logo elektroda
logo elektroda
X
logo elektroda

Configuring Cree Lighting CMACC-CMSC-UNV-WH Scene Controller for Device Group Control

hikeit 1086 7
ADVERTISEMENT
  • #1 20788771
    hikeit
    Level 2  

    I picked up a few of these Cree switch dimmer things... they are really just 4-button scene controllers.
    https://www.amazon.com/Cree-Lighting-CMACC-CMSC-UNV-WH-Controller-Compatible/dp/B09JFDLXFC/
    White control panel with four buttons and a central LED indicator.

    I've had a rather difficult time flashing them (CBU module), but I did manage to get one booting up.

    It doesn't have a dimmer, it just has 4 buttons and an LED indicator.

    There isn't a template out there that works, I suppose this might be close: https://www.elektroda.com/rtvforum/topic3961578.html

    I would like to use the buttons to control a Device Group of lights... what would I put into the autoexec to make that happen?
    Would I somehow create a virtual light object and then set up autoexec actions to modify that virtual light, and then add the virtual light to a device group?
    I honestly have no idea what I'm doing here, I'm a heavy Home Assistant and ESPHome user with lots of Z-Wave and Zigbee devices, this is my first foray into Tasmota/Tuya/OpenBK... the device groups functionality is what pulled me in :)
  • ADVERTISEMENT
  • #2 20789575
    p.kaczmarek2
    Moderator Smart Home
    Let's start with getting GPIO ready. Do a template extraction:
    https://www.youtube.com/watch?v=WunlqIMAdgw
    Next, tell me, do you only want to control the power of the lights (on or off) or all parameters? We have a SmartLEDButton that can control lights in a bit more advanced manner.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20792518
    hikeit
    Level 2  
    I would like to control the lights in a more advanced way, i.e. on/off with a single press on the top left or bottom left buttons, different things (like specific color/brightnesses or random rainbow chase or something) for the top right and bottom right, and double taps for example, dim up/down for some buttons held down).

    Unfortunately extraction failed...
    Sorry, no meaningful pins data found. This device may be TuyaMCU or a custom one with no Tuya config data.
    The device seems to be using the wb3s module, which is using BK7231T.
    And the Tuya section starts at an UNCOMMON POSITION 0.

    It does not have a tuyaMCU, and it runs on a CBU module, so I think it is just a weird device with highly customized firmware that doesn't have data in normal places...

    the buttons are directly wired to pins on the board.
    View of an electronic module mounted on a green circuit board with pin markings. Circuit board with a CBU module and buttons.

    i now have the GPIOs working from the 4 buttons and the LED:
       "6": "Btn_ScriptOnly;0",
        "7": "Btn_ScriptOnly;0",
        "8": "Btn_ScriptOnly;0",
        "14": "LED;6",
        "15": "AlwaysLow;0",
        "17": "AlwaysLow;0",
        "26": "Btn_ScriptOnly;0"


    now i guess i need to understand the SmartLED Button functionality?

    I added overrides for channels 1-5 as "dimmer" and followed some documentation elsewhere suggesting this as one option:

    // set button hold/repeat/etc times
    SetButtonTimes 8 1 1
    // alias to turn off LED after 4 secs (repeating event with 1 repeat)
    alias add_turnoff_event addRepeatingEvent 0 1 led_enableAll 0
    alias add_turnon_event addRepeatingEvent 0 1 led_enableAll 1
    // button events - 23, 22, etc are pin numbers
    addEventHandler OnHold 7 add_dimmer 1
    addEventHandler OnHold 6 add_dimmer -1
    addEventHandler OnDblClick 6 led_dimmer 5
    addEventHandler OnDblClick 7 led_dimmer 100
    addEventHandler OnClick 6 add_turnoff_event
    addEventHandler OnClick 7 add_turnon_event


    Would I want to refine this or is there a better way?
    Thanks!!!
  • ADVERTISEMENT
  • #4 20793636
    p.kaczmarek2
    Moderator Smart Home
    There are many ways to do it in OBK. You can use Btn_SmartLED, you can use Btn_NextDimmer, etc, etc, see:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/ioRoles.md

    You can also script it manually, just like you did.

    You can also enable "force show RGBCW controller" flag and then setup Tasmota Device Groups in the DGR settings, if you are going to use them directly.

    Have you seen basic DGR tutorial?




    What is your target setup here, let me know if I can help you somehow futher.
    Helpful post? Buy me a coffee.
  • #5 20793940
    hikeit
    Level 2  

    My target setup is this:
    I have a bunch of places around the house with 2-4 bulbs, sometimes they are ceiling can lights with 5-6" LED-replacement panels, sometimes they are track lights with BR30 bulbs, sometimes they are a pair of A19 bulbs in lamps on bedside tables or in wall sconces.

    1. I want to have RGBTW control of all of those bulbs from Home Assistant (either through the Home Assistant REST API, Matter protocol, or MQTT), and by Alexa/Google Home/etc through their respective Home Assistant integrations.
    2. I want wall switches that provide a very intuitive control interface both for my family and for guests... push the top of a toggle and it turns on, push the bottom and it turns off. Push-and-hold to dim up or dim down. Additional buttons/toggles/double taps etc for scenes, color changes, switching from color to warm white or cool white, etc, or possibly using the additional buttons to control something else, like a set of LED strips under the bed or under a cabinet in the kitchen or behind the TV.
    3. Some locations have two switches, like both ends of the kitchen, or both sides of the bed. For bedside tables, I'll probably be adding remote switches as there aren't already wall switch locations there, but it should ideally "work the same" from a user experience perspective.
    --> Having two switches means that the switch, even though it doesn't have a dimmer or RGB LED built in, needs to receive the device group commands as well to work in 3-way mode, so I think using "force show RGBCW controller" won't work, right?

    Right now I have a test installation above the wet bar in the den... 4 Daybetter A19 bulbs (BK1731T) in a track light with one of these CREE scene dimmers (BK1731N). These are all flashed with OpenBeken, and are added to the same Jesse_Counter device group. The manual script above seems to work well, and after years of various iterations of home automation, this is the first time I have something that "just works" and that my family and guests will be able to use without being told how, so overall this is a big win!

    I'm wondering if this is how you would recommend deploying them, given what I am trying to accomplish as the end state, or if the SmartLED or NextDimmer is simpler or cleaner with the same result?
    Reading the ioRoles page, it seems like the SmartLED control would *ALMOST* work, but I want the top to be on and dim up always, and the bottom to be off and dim down always, so it would need to be modified...

    I can put together/submit a device teardown as well now that I have the GPIOs working if that is helpful.
  • ADVERTISEMENT
  • #6 20795053
    hikeit
    Level 2  

    Okay, simple question for you:

    SetButtonTimes 5 3 1

    I think this means that if I hold it longer than 500ms, it is considered held down, and will issue a repeating button held event every 100ms.

    So what does the 3 refer to? I am having trouble getting it to respond properly to a double click, is that because of the 3? Does it mean I have 300ms between clicks for it to count them up for what is a double click?
  • Helpful post
    #7 20795215
    p.kaczmarek2
    Moderator Smart Home
    hikeit wrote:

    --> Having two switches means that the switch, even though it doesn't have a dimmer or RGB LED built in, needs to receive the device group commands as well to work in 3-way mode, so I think using "force show RGBCW controller" won't work, right?

    This is the correct way to do it. I think I did something like that on one of my tutorials.

    hikeit wrote:
    The manual script above seems to work well, and after years of various iterations of home automation, this is the first time I have something that "just works" and that my family and guests will be able to use without being told how, so overall this is a big win!

    Thank you!

    hikeit wrote:

    I'm wondering if this is how you would recommend deploying them, given what I am trying to accomplish as the end state, or if the SmartLED or NextDimmer is simpler or cleaner with the same result?

    Scripts are more customizable, so I would stay with the scripts.

    hikeit wrote:

    I can put together/submit a device teardown as well now that I have the GPIOs working if that is helpful.

    Please do, we can send you some free gifts for submitting a complete article.

    hikeit wrote:

    So what does the 3 refer to? I am having trouble getting it to respond properly to a double click, is that because of the 3? does it mean i have 300ms between clicks for it to count them up for what is a double click?

    I must admit that I have never changed those settings except the lat value, which is the "repeat frequency for hold events", but here is a description of them from code:
    
    // SetButtonTimes [ValLongPress] [ValShortPress] [ValRepeat]
    // Each value is times 100ms, so: SetButtonTimes 2 1 1 means 200ms long press, 100ms short and 100ms repeat
    

    Here is it in code:
    https://github.com/search?q=repo%3Aopenshwprojects%2FOpenBK7231T_App%20BTN_SHORT_MS&type=code
    But in generic, yes, if you release a button, and do not click it again within BTN_SHORT_MS it fires a, for example, double click event. If not, you can still go up to the triple or quadruple click.... or even 5x click,
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around configuring the Cree Lighting CMACC-CMSC-UNV-WH scene controller for advanced control of a device group of lights. The user seeks to utilize the controller's four buttons for various functions, including on/off control, color and brightness adjustments, and scene changes. Initial challenges included flashing the device and extracting GPIO data due to its custom firmware. Suggestions include using specific button configurations and scripting for enhanced functionality, as well as utilizing the OpenBK7231T firmware for more customizable control options. The user aims for integration with Home Assistant and voice control systems like Alexa and Google Home.
Summary generated by the language model.
ADVERTISEMENT