logo elektroda
logo elektroda
X
logo elektroda

MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken

PSlowik 2421 11
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20536765
    PSlowik
    Level 12  
    Hello and welcome

    I have a pair of MOES lighting switches, model WS-EUB, purchased from ali, I would like to get rid of the tuya, so thanks to the help of p.kaczmarek2, I uploaded soft BK7231T via UART.
    The soft uploaded wifi I put it on my WIFI but I got stuck at the stage of setting this BK :(

    the LED on the front panel of the switch is blinking all the time now :(
    On org software, I attach it below, it flashed until it was paired with the tuya app.

    Could you please advise what to do next?

    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken


    I am also attaching the log
  • ADVERTISEMENT
  • #2 20536828
    p.kaczmarek2
    Moderator Smart Home
    At this point, you're already up and running TuyaMCU - startDriver TuyaMCU in autoexec.bat, right?
    If not, then in Open Web Application, in LittleFS, do autoexec.bat and there enter "startDriver TuyaMCU" so that it starts automatically at system startup. Do a reboot.

    I also see you posted the log:
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 08 07 02 00 04 00 00 00 00 1B 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 7, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 0
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 07 00 05 01 01 00 01 01 0F 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=0]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 1, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 00 00 00 01 01 01 
    

    this log shows the dpID of the variables responsible for the relays/buttons, but it's in such a form that I don't know what is what.

    Can you do the following test:
    1. In Web App Logs, clear the log
    2. Press the first touch button
    3. Copy this web app log, and note which ones dpID from the log corresponds to him
    4. Repeat steps 1 2 and 3 for each touch button

    The pictures don't show how many buttons it has. Four touch buttons? Two?
    Helpful post? Buy me a coffee.
  • #3 20536904
    PSlowik
    Level 12  
    As for LittleFS, I don't know what it is, where it is etc :/

    The on/off switch is just a single button physical button



  • ADVERTISEMENT
  • Helpful post
    #4 20536983
    p.kaczmarek2
    Moderator Smart Home
    Autoexec is created here:
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken

    here "Create file":
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken
    since you say only one button, I think I already know how to configure it

    In autoexec.bat paste:
    
    startDriver TuyaMCU
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 bool 1
    

    save, reboot. You should get a button on the GUI that controls the relay. Check.
    Helpful post? Buy me a coffee.
  • #5 20537010
    PSlowik
    Level 12  
    I confirm there is a button and it reacts like pressing the keys on the plate lighting up green or the relay is working I don't know yet because the mammpkytki are fully assembled but I will test it soon.
    But what to do with the LED that blinks all the time ...?
    In tuya it worked so that if the light was not turned on, the diode barely shines and when the light is turned on, the diode starts to shine strongly ...
    And now it's blinking...
  • ADVERTISEMENT
  • Helpful post
    #6 20537015
    p.kaczmarek2
    Moderator Smart Home
    Most likely the LED indicates that the MCU thinks it is not paired. OpenBeken defaults to the "paired" state when you also connect MQTT, but if you want a shortcut and silence the LED, try adding the following to autoexec at the end:
    tuyaMcu_defWiFiState 4
    This will set the MCU's WiFi state to 4, which is "connected to router and to cloud", and should calm the LED down.

    You can find the command documentation here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/README.md

    Unless it's about another diode, then we'll think about it.
    Helpful post? Buy me a coffee.
  • #7 20537036
    PSlowik
    Level 12  
    haha it actually worked the diode reacts perfectly, now just some MQTT and then recommends 2-button switches :) )

    Do you have to recreate the autoexec every time you run it? because it disappears after reboot

    I confirm the relay is working, the light is on :D
    You are great!

    Now spr to set mqtt because OpenBK is probably not integrated with HA??
  • #8 20537113
    p.kaczmarek2
    Moderator Smart Home
    For normal devices there is automatic HA discovery where everything happens by itself:
    https://www.youtube.com/watch?v=pkcspey25V4&ab_channel=Elektrodacom
    This way you can pair a lot and everything configures itself.

    Unfortunately, your device is weird by the manufacturer - I don't know why it needs TuyaMCU and UART control to control ONE relay and you have to write the Yaml code for it manually.

    Start by configuring MQTT in Configure MQTT. On the web panel, the MQTT status should be connected.
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken


    Then in Home Assistant add the device via configuration.yaml:
    Code: YAML
    Log in, to see the code

    change the names of course, I'm testing on a simulator on windows. You will have a different name than me, you will probably enter something else as "Client Topic" (I have WindowsOBK there)
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 20538497
    PSlowik
    Level 12  
    :) :) :)
    It worked :) :) I'm really glad…

    It will still help if I put soft on the 2-button switch ;) if I can.

    Please tell me how is the overall stability of this software? Much better because it doesn't work in the cloud...

    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken
  • #10 20538784
    p.kaczmarek2
    Moderator Smart Home
    Remember to enable autoexec too startDriver SSDP for Windows to see devices:
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken

    Stability test showed it can run for months, here is a screenshot of the status as of January 11, 2023 :
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken
    Uptime 46 days
    MOES 1-2 Light Switch: WB2S BK7231T TuyaMCU configuration for OpenBeken

    Recently, we have additionally enabled the watchdog to be able to automatically restart the software in the event of a possible suspension of the software


    soft with two buttons probably similarly only you set 2 toggles and map two TuyaMCU variables, probably ID 1 and 2
    Helpful post? Buy me a coffee.
  • #11 20562539
    p.kaczmarek2
    Moderator Smart Home
    UPDATE 2023-05-01

    From today, Home Assistant Discovery also works for Toggle channels from TuyaMCU. This means you don't have to write YAML by hand anymore.

    Configuration below:
    p.kaczmarek2 wrote:

    In autoexec.bat paste:
    
    startDriver TuyaMCU
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 bool 1
    

    save, reboot. You should get a button on the GUI that controls the relay. Check.

    It is seen by Home Assistant Discovery and can be added automatically to the HA.
    Helpful post? Buy me a coffee.
  • #12 21359163
    styb113
    Level 3  
    Hello,
    I have a similar device to this one with 3 buttons and relays. It also has RF functionality. If I flash it with OpenBK how do I have to configure the settings for the TUYA MCU?
    Printed circuit board with a communication module and electronic components.
    Printed circuit board with three buttons and contacts on a white background.

Topic summary

The discussion revolves around configuring the MOES WS-EUB light switches with the BK7231T firmware to replace the Tuya software using OpenBeken. The user initially faced issues with the LED blinking continuously after uploading the firmware. Solutions provided included creating an autoexec.bat file to start the TuyaMCU driver and configuring the device to recognize its state. The LED blinking was resolved by setting the WiFi state to indicate a connection. The user successfully tested the relay functionality and sought advice on integrating MQTT with Home Assistant, which was confirmed to work without manual YAML configuration due to recent updates. Stability of the software was also discussed, indicating it can run for extended periods without issues.
Summary generated by the language model.
ADVERTISEMENT