logo elektroda
logo elektroda
X
logo elektroda

Which WiFi controlled relay module for Home Assistant? ATLO-SW1-TUYA

p.kaczmarek2 759 7
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • ATLO-SW1-TUYA WiFi relay module with folded instruction manual in Polish, top view on the device and documents. .
    The ATLO-SW1-TUYA is another tiny (43x39x22 mm) relay module offering control of a single receiver via WiFi. It is mounted in a box and, in addition to WiFi, it can work with a classic bistable switch. Here I will show how to change its firmware to connect it to Home Assistant. The whole thing is available to buy for £30.

    I got this unit from a reader along with a whole set of similar relays for several rooms - I just uploaded the firmware at his request.

    We start by unpacking. The product designation is ATLO-SW1-TUYA, and you can also see the name of its importer, although this is less important here as many shops sell similar products.
    White box of the ATLO-SW1-TUYA module with identification label, barcode, and importer’s details. ATLO-SW1-TUYA WiFi relay switch module and Polish instruction manual on a white background. .
    The kit also comes with Polish-language instructions for assembly and pairing with Tuya. Pairing will not be necessary for us in this particular case.
    Installation manual of the ATLO-SW1-TUYA relay module with a technical specifications table and dimension diagram. The image shows a small ATLO-SW1-TUYA Wi-Fi relay module and a Polish user manual laid out side by side. Small WiFi relay module ATLO-SW1-TUYA next to unfolded Polish installation manual. .
    The product itself has an additional buckle which makes it easy to install:
    White ATLO-SW1-TUYA Wi-Fi relay module with screw terminals and technical specification on top of the case. Small white ATLO-SW1-TUYA relay module on a white background, with a light bulb symbol on top of the case. .
    Time to look inside and change the firmware .
    Open ATLO-SW1-TUYA relay module with visible PCB and removed white cover. .
    The power section is again on a BP2525, which is a non-isolated step-down converter. This means that there may be mains potential across the PCB (and WiFi module). Then there is a 3.3V LDO powering the WiFi module.
    Close-up of the ATLO-SW1-TUYA relay module PCB showing the BP2525 chip and SMD components. Close-up of the ATLO-SW1-TUYA relay module’s PCB showing electronic components and part labels. .
    The relay was set 'on its side' to reduce the height of the product. The module used here is a CB3S (WiFi + BT) based on the BK7231N.
    ATLO-SW1-TUYA relay module with capacitors, a relay, and a CB3S (WiFi/BT) module visible on the PCB. Close-up of the ATLO-SW1-TUYA relay module PCB showing a terminal block, relay, capacitor, and CB3S module. .
    It's time to change its firmware so that it's cloud-free and connected to Home Assistant.
    We upload OpenBeken: https://github.com/openshwprojects/OpenBK7231T_App
    Download the flasher: https://github.com/openshwprojects/BK7231GUIFlashTool
    We will need to solder 3.3V, GND, RX and TX. We will use a USB to UART converter for programming.
    Here is the pinout of the module (bottom view!):
    Bottom view of the CB3S module with labeled pinout and dimensions in millimeters. .
    So first we solder the RX and TX - whittle down the pins, wires, solder:
    ATLO-SW1-TUYA relay module PCB with red and purple power/programming wires soldered on. ATLO-SW1-TUYA relay module with soldered wires for programming, close-up view of the circuit board and electronics. .
    Now we need to connect the power supply. We basically have two options:
    - feed 3.3V from our LDO to the 3.3V line (or the 3.3V pin of the WiFi module)
    - connect 5V to the input of the LDO (this will give us 3.3V at its output)
    Do as you wish, the AMS1117 leads are in the network.
    Green PCB of ATLO-SW1-TUYA relay module with black, white, red, and purple wires soldered to it. Close-up of an ATLO-SW1-TUYA module PCB with RX and TX wires soldered on. .
    We follow the flasher instructions - start reading the flash (this will give us the GPIO configurations) and disconnect the 3.3V momentarily.
    Screenshot of BK7231 Easy UART Flasher showing the extracted GPIO configuration and device template for CB3S/BK7231N in JSON format and a text summary. .
    Success! Tuya JSON is:
    Code: JSON
    Log in, to see the code
    .
    Verbal description:
    
    Device seems to be using CB3S module, which is BK7231N chip.
    - Relay (channel 1) on P6
    - WiFi LED on P9
    - TglChannelToggle (channel 1) on P8
    - Pair/Toggle All Pin on P26
    

    OBK template:
    Code: JSON
    Log in, to see the code

    Instructions for importing the template:



    HA Discovery Instructions:



    Other related material on YT Elektroda.com:
    https://www.youtube.com/@elektrodacom
    Project repository:
    https://github.com/openshwprojects/OpenBK7231T_App
    After the import, it is still a good idea to add the PowerSave 1 command to the autostart, as these types of gadgets have weak power supplies and capacitors damage quickly in them.

    In summary , this was another easy to reprogram product. We didn't even have to guess the role of the GPIO, as my flasher read and decoded everything correctly. After this short operation we can enjoy a fully cloud-independent relay controlled by WiFi.
    Thanks to Bartek for providing me with a set of hardware to change the firmware, hopefully it will work well with your Home Assistant.
    I've been monitoring the inside of these types of devices for a good few years now and fortunately they are still fully 'programmable', so if anyone wants cloudless automation at a low cost then by all means go ahead and buy.
    And how do you use this type of product, do you change the firmware, do you like the manufacturer's cloud, or do you buy something that can already work locally on its own? .

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 11775 posts with rating 9904, helped 562 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 21567250
    sq3evp
    Level 37  
    I have something similar, different logo but looks identical.
    Similar modules are probably mainly a matter of the chip fitted?
  • ADVERTISEMENT
  • #3 21567255
    p.kaczmarek2
    Moderator Smart Home
    Rather, the interior will be more or less as I have shown. It's just that the importers are pulling these products and adding their logos on them. Show pictures (maybe from the inside too).
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21567612
    truten23
    Level 12  
    A person holds an OXT WiFi voltage-free relay module with visible labels and connectors.
    sq3evp wrote:
    I have something similar, different logo but looks identical.
    Similar modules are probably mainly a matter of the chip fitted?
    .
    I also use modules of this type.
    They are described as OXT.
    They come in various configurations. D operating one bulb and one switch, two bulbs and two switches. And in a version with a voltage-free relay: We can plug in and control a completely separate circuit.
    In my case they work on the original cloud and I operate them via Tuya.
    Their big advantage is that they support bistable (regular) and monostable (bell) switches.
    When I bought them, changing the switch type was not at all a certainty on some relays.
    The relays themselves work quite stably, although lag is sometimes noticeable. Despite the 600Mb internet...
    OXT Wi-Fi relay installed in a flush-mounted wall box with visible wiring and a detached light switch. .
  • #5 21568298
    sq3evp
    Level 37  
    p.kaczmarek2 wrote:
    Rather, the interior will be more or less as I have shown. It's just that the importers are pulling these products and adding their logos on them. Show pictures (maybe from the inside too).
    .
    This is the kind of thing I have - connected already, photo from the seller's website.
    Which WiFi controlled relay module for Home Assistant? ATLO-SW1-TUYA .
    It is powered by applying phase (L) through the switch contacts to the L-in.
  • ADVERTISEMENT
  • #6 21568308
    p.kaczmarek2
    Moderator Smart Home
    OXT I have also already programmed some:
    Powerless relay on WiFi - OXT SWT10 - interior, programming .
    @sq3evp monitor that smart switch what you have and let me know if it breaks down, I've had instances like that before:
    How to fix a smart device that crunches, squeaks and makes strange sounds?
    Helpful post? Buy me a coffee.
  • #7 21568517
    sq3evp
    Level 37  
    p.kaczmarek2 wrote:
    OXT I have also already programmed some:
    Voiceless relay on WiFi - OXT SWT10 - interior, programming .
    @sq3evp monitor that smart switch what you have and let me know if it breaks down, I've had instances like that before:
    How do I fix a smart device that crunches, squeaks and makes strange noises?
    .

    It's going to be hard because it's on a suspended ceiling. You have worried me but I will monitor, thanks for the warning.
    So far I can't hear the crickets, just the relay switching on/off on the module when voltage is applied to it. It was supposed to be different, but the box turned out to be too shallow (there are other wires going through it and so far I have no idea how to reposition it).
  • #8 21568604
    truten23
    Level 12  
    @sq3evp, maybe nothing to worry about in the meantime.
    Of my 5 installed OXTs, in two years of use only one relay failed, twice. It was offline and unresponsive to the switch. It needed a hard reset in the form of disabling the protection on the light.

    @p.kaczmarek2, do you think this could be a symptom of a drying capacitor on the power supply? Does this type have this?
    I'm a bit puzzled whether to go for our native Zamel and relays using the Supel cloud?
    Do you think it is worth it?
ADVERTISEMENT