logo elektroda
logo elektroda
X
logo elektroda

Configuring OpenBK7231T on Deta 6914HA Light and Fan Switch for Tasmota Style Firmware

digitalsko 993 9
ADVERTISEMENT
  • #1 20405579
    digitalsko
    Level 2  
    Hey Everyone,

    I've successfully flashed OpenBK7231T onto the 6914HA device and have correctly mapped the Buttons, Relays and WifiLed. Mapping below.

    I'm trying to implement the config as per the blakadder template from https://templates.blakadder.com/deta_6914HA.html but cannot work out if it's even possible.
    Does this implementation of Tasmota style FW have
    SetOption73 1
    to decouple buttons from relays ?

    Button 2 operates Relay 2 to turn the fan on, and then Button 3 should cycle the power level.

    I need the relays to be in the following state for each setting.
    Fan on Low - R2 on
    Fan on Medium - R2, R3 on
    Fan on High - R2, R3, R4 on

    Let me know if it's possible, or if I should just swap out for an ESP12 chip instead

    Cheers


    Device Mapping
    P1 - Button 2
    P10 - WifiLed
    P9 - Relay 3
    P8 - Button 3
    P6 - Relay 2
    P26 - Relay 1
    P7 - Relay 4
    P14 - Button 1
  • ADVERTISEMENT
  • #2 20405650
    p.kaczmarek2
    Moderator Smart Home
    Hello,
    digitalsko wrote:

    Does this implementation of Tasmota style FW have
    SetOption73 1
    to decouple buttons from relays ?

    I can add this option for you, but in general, our approach is to use Btn_ScriptOnly role, which does not toggle relays automatically or just set a channel like 20 for the button.

    digitalsko wrote:

    Button 2 operates Relay 2 to turn the fan on, and then Button 3 should cycle the power level.

    I need the relays to be in the following state for each setting.
    Fan on Low - R2 on
    Fan on Medium - R2, R3 on
    Fan on High - R2, R3, R4 on

    I can write you such a script, wait a moment....

    Dodano po 3 [godziny] 59 [minuty]:

    Hello again @digitalsko ,
    thanks to our OpenBeken device Simulator, which allows me to simulate any device on Windows and quickly develop scripts, I've prepared the following script for you:
    
    
    setChannelType 10 OffLowMidHigh
    setChannelLabel 1 "Relay 1"
    setChannelLabel 2 "Relay 2"
    setChannelLabel 3 "Relay 3"
    setChannelLabel 10 "Fan Speed"
    
    // hide raw relay channel buttons from gui
    setChannelVisible 1 0
    setChannelVisible 2 0
    setChannelVisible 3 0
    
    // optional gui buttons
    startDriver httpButtons
    
    setButtonLabel 0 "Toggle Fan"
    setButtonLabel 1 "Next Fan Speed"
    setButtonCommand 0 Do_Power_Press
    setButtonCommand 1 Do_Cycle_Press
    setButtonEnabled 0 1
    setButtonEnabled 1 1
    
    // button colour
    addChangeHandler Channel10 == 0 setButtonColor 0 red
    addChangeHandler Channel10 != 0 setButtonColor 0 green
    // off by default
    setButtonColor 0 red
    
    // translate fan state (0-4) to relay states
    addChangeHandler Channel10 == 0 backlog SetChannel 1 0; SetChannel 2 0; SetChannel 3 0
    // Fan on Low - R2 on
    addChangeHandler Channel10 == 1 backlog SetChannel 1 1; SetChannel 2 0; SetChannel 3 0
    // Fan on Medium - R2, R3 on
    addChangeHandler Channel10 == 2 backlog SetChannel 1 1; SetChannel 2 1; SetChannel 3 0
    // Fan on High - R2, R3, R4 on
    addChangeHandler Channel10 == 3 backlog SetChannel 1 1; SetChannel 2 1; SetChannel 3 1
    // change to OnClick if you want?
    addEventHandler OnPress 11 Do_Power_Press
    addEventHandler OnPress 9 Do_Cycle_Press
    // power press will just toggle channel 10 - so if non zero it goes to 0, if zero, then goes to 1
    alias Do_Power_Press toggleChannel 10
    // cycle press will cycle values 0, 1, 2 and 3 for channel 10?
    // AddChannel [ChannelIndex][ValueToAdd][ClampMin][ClampMax][bWrapInsteadOfClamp]
    alias Do_Cycle_Press addChannel 10 1 1 3 1
    

    I am not sure if that's exactly the behaviour you need, but you can modify it to fit your needs, and if any issue arise, I can also do a modification for you. I'm here to help.

    Here is a short demonstration of the script:



    You must update to latest version in order to use all features from this script.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20406140
    digitalsko
    Level 2  
    wow thank you !!
    I'm updating now and testing with the script in autoexec.bat
    I'll let you know how it goes

    EDIT

    Ok so Button 1 and Relay 1 are for the light switch and then Button 2 is for fan on, and Button 3 is for fan speed. The fan controls are R2, R3, R4
    Currently the script is using R1 for the fan on, which would turn on the light.
    I'll see if I can modify the script and let you know if I'm successful

    Cheers

    EDIT 2

    Ok so I've got the logic working in the webpage correctly with the right relays, but how do I make it so that when I push the physical button 3 that it calls the "Next Fan Speed" alias instead of controlling relay 3 only ?
  • ADVERTISEMENT
  • #4 20406166
    p.kaczmarek2
    Moderator Smart Home
    Wait, so you have an extra light switch there, I wasn't aware about?

    So.... assign an empty channel, maybe channel 5 (or 0? ) to Relay and a Btn.
    No scripting needed.

    The light would work in a "native" way, without script.

    That is assuming I understood you well.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20406237
    digitalsko
    Level 2  
    sorry I didn't make it clear it was a light and fan switch.
    I've sorted out the relay mapping, but now just need to map physical button 3 (P8) to use the "addEventHandler OnPress 9 Do_Cycle_Press"

    any ideas ?

    cheers
  • #6 20406271
    p.kaczmarek2
    Moderator Smart Home
    
    addEventHandler OnPress 9 Do_Cycle_Press
    

    We're currently building video tutorials and documentation for our firmware so it may not be clear, but 9 here is a pin index, as in "P9". If you want to use P8, you should use index 8 here, like that:
    
    addEventHandler OnPress 8 Do_Cycle_Press
    

    Btw, would you be kind enough to post some more info about your device (photos, packaging photos, where to buy) so we can include it on our templates list here:
    https://openbekeniot.github.io/webapp/devicesList.html
    Thanks!
    Helpful post? Buy me a coffee.
  • #7 20407141
    digitalsko
    Level 2  
    I wasn't sure if the numbers referred to physical or dummy pins.
    I needed to change P1 (Btn2) & P8 (Btn3) in module config to remove the reference to the physical relays (made them 0)
    Also needed to make these changes
    addEventHandler OnPress 1 Do_Power_Press
    addEventHandler OnPress 9 Do_Cycle_Press
    addEventHandler OnPress 8 Do_Cycle_Press


    I'll do a post with pics once it's all done and working in HA.

    many thanks again
  • #8 20407315
    p.kaczmarek2
    Moderator Smart Home
    If you have time, you can always post a separate detailed review/article and get some gift from our forum:
    https://www.elektroda.com/rtvforum/topic3950844.html

    Why do you have Cycle Press for two buttons? For both 9 and 8?
    Helpful post? Buy me a coffee.
  • #9 20467535
    wolfieeewolf
    Level 11  
    >>20407141

    Any chance you can post the code you have?

    I have the same one and I'm trying to code it.

    would like to see how you tackled the relay cycle thing.
  • #10 20467597
    p.kaczmarek2
    Moderator Smart Home
    @wolfieeewolf I am confident that he used the code from my post here:
    https://www.elektroda.com/rtvforum/topic3952371.html#20405650
    which is the same code which is in the comment in that source file:
    https://github.com/openshwprojects/OpenBK7231...src/selftest/selftest_demo_fanCyclingRelays.c
    Starting at /*, there is full source code for the script.

    I think it could work for you, but it has different channel numbers used than you have.
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around configuring the OpenBK7231T firmware on the Deta 6914HA light and fan switch to achieve Tasmota-style functionality. The user successfully flashed the firmware and mapped the device's buttons and relays. They seek to implement a configuration based on a Blakadder template but are unsure if the firmware supports the SetOption73 command to decouple buttons from relays. The user aims to control fan speeds through button presses, with specific relay states for low, medium, and high settings. Responses include suggestions for scripting and mapping physical buttons to specific functions, as well as clarifications on using event handlers for button actions. The conversation also touches on sharing code and experiences with similar devices.
Summary generated by the language model.
ADVERTISEMENT