logo elektroda
logo elektroda
X
logo elektroda

Configuring OpenBeken on Currysmarter Switch (2 gang) for MQTT Messaging and Relay Control

mircofreiberg 591 3
ADVERTISEMENT
  • #1 21209283
    mircofreiberg
    Level 2  
    Hi, as a heavy tasmota user I recently discovered openbeken to be flashed on CBUs to gain mqtt features.

    I am using nodered mqtt to realize my complete home Automation. I have a currysmarter 2 gang touch switch flashed successfully and created the pin setup as well. Works great.

    Now, I want the two buttons to NOT control the relay but send a mqtt message only. Additionally, I want the relays to be controlled via incoming mqtt message. Well, like I can do with tasmota.

    Ideally, I can also modify the mqtt topics, so I can be completely compatible with my tasmota devices (cmnd/... & stat/... & tele/...) .

    Any hint is well appreciated :)
  • ADVERTISEMENT
  • Helpful post
    #2 21209637
    p.kaczmarek2
    Moderator Smart Home
    Set the button roles to Btn_ScriptOnly so they don't have automatic interactions and then use event handlers.
    Search for "On3Click " in our docs page:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    Also see:
    https://www.elektroda.com/rtvforum/find.php?q=On3Click
    https://www.elektroda.com/rtvforum/find.php?q=OnDblClick
    When you get such event working, you can invoke any command there. For example, SendGET or publish:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Check out "SendGet" and "Publish" commands in the docs page above.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21210213
    mircofreiberg
    Level 2  
    >>21209637 Thank you, that was very helpful. Still, the button is triggering the relays. Here is what I added:

    setPinRole 28 Btn
    setPinChannel 28 0
    SetButtonTimes 10 3 5
    
    addEventHandler OnClick 28 publish stat/2gswitch/button2 singleClick


    any idea how I can avoid triggering the relay? When I hear it correctly, the relay gets activated and then immediately deactivated again (sounds like a double click sound).
  • #4 21210361
    p.kaczmarek2
    Moderator Smart Home
    p.kaczmarek2 wrote:
    Set the button roles to Btn_ScriptOnly so they don't have automatic interactions

    mircofreiberg wrote:

    setPinRole 28 Btn

    You are still using Btn role, which has automatic interactions with relays. If you do not want to trigger automatically anything, you need to use Btn_ScriptOnly role.

    See roles doc:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/ioRoles.md[/code]
    Helpful post? Buy me a coffee.
ADVERTISEMENT