logo elektroda
logo elektroda
X
logo elektroda

ERC309 Kinetic Relay Switches: TYWE3S Replaced by CB3S - Teardown and Flashing Guide

rchristescu 1395 3
ADVERTISEMENT
  • Helpful post
    #1 21039537
    rchristescu
    Level 7  
    I recently bought few ERC309 kinematic relays and switches.
    Relay: https://www.rovo.ro/produse-smart/releu-rovo-erc309-kinetic-1-canal-5a-wifi-rf433-tuya.html
    Switch: https://www.vonmag.ro/produse/info/es2154-pre...6emeWXD--N5MyjGiiAk4gMZ_FcufOVxcaAiAmEALw_wcB
    Rovo ERC309 relay with wires connected to a rectangular panel on a green measuring mat.
    I like that the switch does not require any power, battery or wires.
    Before buying them, I checked that they are supported by Tasmota.
    https://templates.blakadder.com/ERC309.html
    However, after receiving them and disassemble the first one, I get a big surprise. There is not ESP8266 inside anymore, TYWE3S has been replaced by CB3S.
    CB3S module on a circuit board with electronic components.
    The housing is two parts, fixed together by 7 clips. Not so easy to open without small scratches (for me at least), but doesn't matter, the relay is supposed to be hidden anyhow.

    Open relay housing of Rovo ERC309 with visible internal electronics.

    So, no ESP means no Tasmota, that means no Openhab (I don't use Home Assistant). After first disappointment, I start to search and I found two methods to solve the issue.
    Method 1 - Brain transplant
    I used the great tutorial from @blakadder: https://blakadder.com/replace-tuya-esp12/
    I take out the wifi pcb, replaced the CB3S with an ESP12F flashed with Tasmota, then solder back the wifi pcb.
    Relay with ESP12F module mounted on a desk.
    Template: {"NAME":"Kinetic Switch","GPIO":[1,2272,1,2304,1,1,0,0,1,1,1,1,1,0],"FLAG":0,"BASE":54}
    It works like a charm!

    Method 2 - OpenBeken
    After using method 1 for 3 relays, I accidentally found this site and the OpenBeken project. Thanks a lot for this great firmware!
    So, I take out the wifi pcb, flash the CB3S using BK7231Flasher.exe, connect to device AP and make some basic configurations (wifi, names, mqtt). Then solder back the wifi pcb and connect to mains power.
    For the module configuration I got some inspiration from this topic:
    https://www.elektroda.com/rtvforum/topic3898502.html
    So I create a file autoexec.bat with the following content:
    startDriver TuyaMCU
    setChannelType 1 toggle
    linkTuyaMCUOutputToChannel 1 1 1
    

    and upload the file using Web Application.
    After manually restarting the device, it works perfectly!
    JSON template:
    Code: JSON
    Log in, to see the code

    One small final note: With original firmware, as well with Tasmota, the red led follow the relay (led on when relay is on and led off when relay is off). With OBK, the led blink one time about 1ms when relay become on, all the rest it is off, except when starting, it blinks till connecting to wifi. For me this is not important at all because the relays will not be visible, but I am just curious why this different behavior. I have some experience with Tasmota but I am pretty new to OBK.
  • ADVERTISEMENT
  • #2 21039733
    p.kaczmarek2
    Moderator Smart Home
    Thank you for your presentation. Regarding your question, it seems that your device is using TuyaMCU. TuyaMCU devices usually have the WiFi LED controlled by the MCU itself. You can only affect it by reporting a WiFi state. OpenBeken will not report "connected to cloud" WiFi state unless you connect MQTT, so maybe you need to add the following line to autoexec.bat:
    
    tuyaMcu_defWiFiState 0x04
    

    Please try it out and let me know. Remember to save the autoexec.bat and reboot the device.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21039843
    rchristescu
    Level 7  

    I added the line in autoexec.bat, save it and manually restarted the device but led behavior remains the same: Blinking at startup till connecting, then just a short blink only when switching from off to on.

    MQTT works just fine. MQTT Topic is 'Kinetic0x'.
    When switched to ON, it publishes on topic 'Kinetic0x/1/get' the message '1' and when switched to OFF it publishes '0' on the same topic.
    To control it via MQTT, I have to publish on topic 'Kinetic0x/1/set' the message '1' for switching ON and message '0' for switching OFF.
  • #4 21040091
    p.kaczmarek2
    Moderator Smart Home
    What happens when you try to request all dpIDs from the TuyaMCU? Do it in the Web App Log, so you have the reply.
    
    tuyaMcu_sendQueryState
    


    Futhermore, can you confirm whether the LED we speak about is connected to the MCU and not to the WiFi module?


    Those kind of issues are easiest to solve when you have unflashed device and can take UART traffic capture between TuyaMCU and WiFi module.
    Here is a generic TuyaMCU guide: https://www.elektroda.com/rtvforum/topic4038151.html
    Helpful post? Buy me a coffee.
ADVERTISEMENT