logo elektroda
logo elektroda
X
logo elektroda

[BK7231T][WB3S] Tuya Smart Valve Controller (water switch)

dmitridiavo 7653 23
ADVERTISEMENT
  • Hello to all
    In this post, I will share teardown of Tuya Smart Valve controller.
    [BK7231T][WB3S] Tuya Smart Valve Controller (water switch) [BK7231T][WB3S] Tuya Smart Valve Controller (water switch) [BK7231T][WB3S] Tuya Smart Valve Controller (water switch)
    These controllers come with different chips. I bought this one from aliexpress. It contains a chip wb3s.
    For firmware, it is enough to remove one cover. Connecting to the chip is easy.
    [BK7231T][WB3S] Tuya Smart Valve Controller (water switch) [BK7231T][WB3S] Tuya Smart Valve Controller (water switch)
    I successfully flashed it with OpenBK7231T using usb-to-uart-3.3v and standard connection (TXD1, RXD1, GND, VCC and CEN for reset).
    The diagram below is a bottom view. When connecting, do not confuse left and right.
    [BK7231T][WB3S] Tuya Smart Valve Controller (water switch)
    Pins need to be configured like this:
    PinVal
    1Led
    6Rel
    24Btn
    Thank you for your attention

    Cool? Ranking DIY
    About Author
    dmitridiavo
    Level 2  
    Offline 
    dmitridiavo wrote 4 posts with rating 7. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20358108
    p.kaczmarek2
    Moderator Smart Home
    Thank you, this is most likely the first water valve controller on our forum, nice. If I may ask, what are you going to use it for?

    dmitridiavo wrote:

    The diagram below is a bottom view. When connecting, do not confuse left and right.

    Yes, this is unfortunate, other modules have their drawing from top view and it may be confusing for beginners. At least I have my own drawing of WB3S, but not complete:
    [BK7231T][WB3S] Tuya Smart Valve Controller (water switch)
    [BK7231T][WB3S] Tuya Smart Valve Controller (water switch)
    Helpful post? Buy me a coffee.
  • #3 20358131
    dmitridiavo
    Level 2  
    I connected it and the water leakage sensor to the home assistant (via MQTT). And created automation to close the water in case of a leak.
    HA config for valve controller:
    Spoiler:
    - platform: mqtt
      name: "Water Cold"
      unique_id: "water_col"
      state_topic: "valverelay/cold/0/get"
      command_topic: "valverelay/cold/0/set"
      availability_topic: "valverelay/cold/connected"
      qos: 1
      payload_on: "1"
      payload_off: "0"
      payload_available: "online"
      payload_not_available: "offline"
      retain: false

    Next I will install this controller on the water supply valve in the apartment (Unfortunately it is only compatible with long handles, as in the promotional photo).
  • ADVERTISEMENT
  • #4 20359022
    gulson
    System Administrator
    Thank you for the presentations. A very nice solution. No need to change the water valve, just overlap the existing valve and valve knob. Thanks to the firmware change, you can integrate with your other devices in Home Assistant. You described very well, if the water sensor detects a leak or flooding, the valve will be turned off!
  • #5 20359502
    Anonymous
    Level 1  
  • #6 20359974
    adversus
    Level 32  
    spec220 wrote:
    There is a servo + return spring in the valve, or just the servo? What if there is a power loss?


    Servo (no spring, not this model :) and it is powered by 12V. Generally, it is enough to make a little effort and everything is described on the internet, my friend.
  • #7 20388117
    haydendepeiza
    Level 2  
    Hi good day, my smart valve controller is stuck in lock off position and wont reset via the switch, do you know a way to hard reset or short the board for it to reset?
  • #8 20476512
    paulp
    Level 5  
    I doubt this is still relevant, but for future reference: If it is stuck in any position, pull the keyring on the bottom of the valve housing. This will disengage one of the gears in the gearbox and break the handle free
  • #9 20476537
    haydendepeiza
    Level 2  
    Thanks for the suggestion, however it seems to be more of a main board or software issue as the device would not reset. I have pulled the pin but it just releases and then returns to the last position. The device have since gone cold tho, no lights nothing, no evidence of it getting wet inside as well. May have to invest in a new one.
  • #10 20662568
    NorthernMan54
    Level 4  
    This is the config from my Gowfeel WiFi Smart Valve that I purchased from Amazon

    Code: JSON
    Log in, to see the code
  • #11 21031761
    alexandrumilitaru
    Level 3  
    Hi all,

    Not sure if this is still active, but I flashed the same device, it worked like a charm then, after being without power for a few months, it seems it reverted by itself to the original Tuya firmware, has anyone experienced this ? is there a backup firmware in case what I flashed failed somehow ?

    Thank you,
  • ADVERTISEMENT
  • #12 21031763
    p.kaczmarek2
    Moderator Smart Home
    I don't think it's possible. Are you saying that you flashed BK7231 with OpenBeken and after few months it has returned to Tuya? Are you really sure? Maybe you've just got your OBK booted into AP mode and that's it? Is the AP being broadcasted?
    Helpful post? Buy me a coffee.
  • #13 21031798
    alexandrumilitaru
    Level 3  
    Screenshot of OpenBK7231T interface with toggle options. So, I have not yet taken it out to test. I have it in my maintenance room attached to some water pipes. However the web interface disappeared and the only port open is 6668 which is used by Tuya. It still connects to the wifi, however I had that configured in both instances.

    I am sure i flashed it as I configured it to work with my home assistant, I scheduled on and off times and the interface was there. I then moved it from my computer to the maintenance room and tested for 1 month with success.
    During the winter (it is attached to a sprinkler system) I disconnected everything. I think it was 4 months and yesterday I restarted everything with the results above.

    I will disconnect it today and attempt to read the firmware, I will update this thread, however if there is no backup firmware this just gets stranger.

    If you have any ideas as to what i can check on it please feel free to tell me and I will post results.


    Edit:

    I followed the flash procedure, added the firmware in the flasher, tested everything, I had the interface, control of inputs and outputs, all functionality, so I say the flash was ok, also it survived multiple power cycles initially. I did not have it as an AP but rather it connected to my Wifi.
    (I have attached an image of the interface I was seeing)

    Thank you,
  • #14 21031834
    p.kaczmarek2
    Moderator Smart Home
    I don't think that OBK device can revert itself to Tuya because that would require having a Tuya firmware backup in the 2MB flash and there is no space for that.

    Unless....

    How did you flash the device? Did you use the UART flasher? Have you ever done OBK OTA?

    There is a slight, very little, possibility that you somehow had Tuya OTA RBL in the OTA partition when flashing OBK via UART wires and somehow it persistent and executed itself lately, but I still think it's almost next to impossible. Futhermore, if it were to happen, it would happen with the next OBK reboot and not after 4 months....
    Helpful post? Buy me a coffee.
  • #15 21031844
    alexandrumilitaru
    Level 3  
    I have not done OTA ever (if it's over the air). I will attach some other pictures I took on the day.
    I used the UART, powered the chip via Arduino and tested everything in the end.
    If there is anything I can extract via UART I will do so.

    Electronic circuit board with a communication module in hand. Electronic setup with Arduino connected via UART on a wooden table.

    And this is the UART not visible in the other image:
    USB-UART converter with attached colored wires on a table.

    Also it seems that it also lost the IP I had statically assigned (.105) so definitely not what I set. It is now DHCP.
  • #16 21031881
    p.kaczmarek2
    Moderator Smart Home
    Well, I can only recommend two things:
    - try doing fast 5 power off/on cycles to check whether it will appear as OBK access point (maybe it's indeed still OBK, but that Tuya port is strange)
    - if it's indeed Tuya, then connect the flasher and reflash the device... the OBK config should be still inside, so don't clear the 2MB of flash memory, or even do a read first
    Let me know how it goes, as this issue seems to be very strange indeed.

    Was this device paired with Tuya before flashing? I am asking so we can determine whether it was possible for it to pull Tuya OTA before being UART-flashed with OBK
    Helpful post? Buy me a coffee.
  • #17 21031888
    alexandrumilitaru
    Level 3  
    Will do a full read before any write and will update on what I find.
    Yes initially i paired with Tuya, opened an account in their cloud and connected it there.
    After that I decided to flash and I did the procedure.
  • #18 21031897
    p.kaczmarek2
    Moderator Smart Home
    Have you ever restarted this device after flashing OBK by wires and if so, did you restart often?

    I am asking because as far as I know only reboot is required to start the OTA process so the only way you could have gotten away with OBK so long with Tuya RBL in the flash is keeping the device on without rebooting it.... unless I'm wrong, who knows
    Helpful post? Buy me a coffee.
  • #19 21031930
    alexandrumilitaru
    Level 3  
    So first your idea gave me an idea, I still have the tuya account configured and the app too. So I powered the valve on and it appeared as online in the Tuya app. So I think your assumption is correct. It does OTA and that OTA somehow survives the flash (is this expected?)

    I have done multiple power cycles as stated in my tests, the OBK survived them all. It may be that it did not survive all, but some and also kept the schedule, it was still turning off and on by itself at the configured times.

    However for sure multiple powercycles were done with OBK still being present.

    Maybe OTA is scheduled periodically?
    I will read all settings however not sure if there is a way to kill the OTA or see when it auto updated.

    I am also thinking of reflashing and denying it internet access,however killing the OTA would be preferred.
  • #20 21031934
    p.kaczmarek2
    Moderator Smart Home
    Your case is extremally rare. i think I have seen such a report maybe one more time at most and we already had hundreds of users and devices.
    alexandrumilitaru wrote:
    So I think your assumption is correct. It does OTA and that OTA somehow survives the flash (is this expected?)

    Your Tuya firmware has started the update, so it pulled the RBL data to the OTA partition. This is a first unusual event, as it does not happen often and people often flash without starting Tuya.
    Then, accidentally, you flashed OBK just after Tuya saved RBL.
    Then, I don't know why and how, RBL update didn't start for long time, but you also didn't update OBK via OTA as well, so RBL must have been sitting in the partition for long time.
    That could explain the things you describe.

    In order to avoid it in the future, you can just do OBK OTA after flashing OBK via wires. There is a single OTA partition and if you just do OBK update to laster version, it will overwrite any previous content of OTA partition.
    Helpful post? Buy me a coffee.
  • #21 21031942
    alexandrumilitaru
    Level 3  
    Will do, and THANK YOU for the assistance!

    Would me reading the chip give any additional value for a root cause or it's not really helpful?

    Anyway will reflash via UART then again via OTA and monitor it.

    Thanks,
    Alex
  • ADVERTISEMENT
  • #22 21031957
    p.kaczmarek2
    Moderator Smart Home
    I don't think you can do much more here. Providing me 2MB backup of your flash would also potentially leak your WiFI data to me. So instead, just for research purposes, let me know once you reflash OBK whether your OBK config was kept in the device. I think it should be.

    And then just do OTA here:
    OTA interface page for BK7231T with file upload feature.
    Feel free to ask if you have any futher questions or issues.
    Helpful post? Buy me a coffee.
  • #23 21073790
    cezar8421
    Level 11  
    I successfully uploaded the alternative software using tuya-cloudcutter, i.e. no soldering.
    The corresponding hardware profile in the list is GR-W-105 Water Shutoff Valve v1.1.5 in the Tuya Generic brand. I have also included a sample YAML configuration for ESPHome below:

    Code: YAML
    Log in, to see the code
    .
  • #24 21387205
    Rawbear
    Level 1  
    Success! Same valve motor. I had trouble with the FTDI serial adapter throwing exceptions when connecting but I was eventually able to backup and write with the UA version of the firmware. `Thanks for the info and the links.

Topic summary

The discussion revolves around the Tuya Smart Valve Controller, specifically the model featuring the WB3S chip. Users share insights on tearing down the device, flashing it with OpenBK7231T firmware, and integrating it with Home Assistant for automation, such as shutting off water in case of leaks. Various configurations and wiring diagrams are provided, along with troubleshooting advice for issues like the device getting stuck in a locked position. Some users report experiences with the device reverting to original firmware after power loss, prompting discussions on potential causes and solutions, including the use of UART for reflashing and the implications of OTA updates. Additionally, alternative flashing methods using tuya-cloudcutter are mentioned.
Summary generated by the language model.
ADVERTISEMENT