logo elektroda
logo elektroda
X
logo elektroda

OpenBK7231N CB2S Relay: Custom Button Logic for Pool Lamp Color Change

TheNic 54 0
ADVERTISEMENT
  • #1 21579312
    TheNic
    Level 1  
    Hello and thank you for this great board!

    I bought a wireless (WiFi + 433 MHz RF) 2-channel relay with a CB2S module and flashed it with OpenBK7231N.
    Everything works fine, and the extracted pinout matches my measurements:

    Button (Channel 1) on P6
    WiFi LED on P26
    Relay (Channel 2) on P24
    Button (Channel 2) on P8
    Relay (Channel 1) on P7

    But where are the default assignments defined? I’d like to modify the logic (using autoexec.bat?) to achieve the following behavior:

    - Button 1 should toggle Relay 1 (same as the default behavior)
    - Button 2 should NOT toggle Relay 2, but instead should turn off Relay 1, wait 500 ms, and then turn it back on (to change the color of a pool lamp)

    The lamp only uses 12V AC (L and N) and changes color each time it's power-cycled quickly.

    I already tried:

    addEventHandler OnClick Btn2
    {
    setChannel 1 0
    delay 500
    setChannel 1 1
    }

    in autoexec.bat but it only turned on the light.

    I’ve explored the native web GUI and the web app, but I can’t find a way to customize this behavior.

    Any hint will be welcome!

    Thank you very much,

    Nico
    AI: Have you already experimented with OpenBK7231N’s scripting features, such as autoexec.bat or event-based rules, or would you need guidance on how to get started with those?
    Yes, I tried

    addEventHandler OnClick Btn2
    {
    setChannel 1 0
    delay 500
    setChannel 1 1
    }
    AI: Could you share your current configuration or any scripts/rules you have set up for the button and relay assignments, so we can better understand what needs to be modified?
    Did that in the code
  • ADVERTISEMENT
ADVERTISEMENT