Yunshan HW-622 Network Relay Module


Setup with Tasmota of a HW-622 Relay Module from AliExpress and other places. Approx NZ$6 with free shipping at the time (end 2019)

The relay board can either switch mains, or ELV.

This board was a bit fickle to get flashed and up and running with Tasmota, here are some notes.


Board Info

  • Can switch AC or DC as the power for the ELV side is pulled in seperately to the Relay contacts.
  • It has one output only (GPIO4 – 10A relay), and one digital input (GPIO5) that has a screw terminal.
  • Has headers with RX/TX and GND which would also be used as GPIO
  • Has Header with GPIO 0 for flashing (and IO later)
  • Reasonable screw terminals for power, input and relay connections
  • Touted to run on 5V-25V (but I had issues flashing with 5V – might work with general operation?)
  • Reasonably well made, and good mains separation
  • Various board layouts show the board having relay NC in the top corner. It isn’t on mine, this is NO
  • The board I got already had the serial and ‘boot’ header pins soldered in place, but some apparently don’t have these (through holes only).

Original Firmware

I could not get the original http based controls working. I didn’t want to use them, but I understood there was some basic control to begin with and it would have been interesting to see what they had in place. From a quick search, it was supposed to set up a wifi AP at

yunshan_wifi_xx_xx_xx (where xx part is suffix of MAC address)
or possibly
SSID: yunshan_wifi


I rarely got it to bring up an AP, but eventually managed to get it to broadcast an SSID of ESP8266. The above password didn’t work however, and neither did a few other guesses (or blank)

(Since my setup, I found a link that says 1234567890 works… but there is no firmware installed anyway)


HW-622 Sonoff

Mentioned on another link, but I too could not get anything working with a 5V supply. I eventually used a 12V plugpack (was ~1.5A). Remember to connect the gnd of the 12V to the GND of the FTDI adaptor. See my photos for final connections that worked for me to flash.

Flashing Tasmota

I used NodeMCUPyFlasher to eventually get a Tasmota binary installed. Setting of baud rate 57600 and Dial I/O (it may have worked on a higher baud rate, but I wasn’t going to try again…). The unit has 4MB of flash, so no mucking around with smaller binaries of Tasmota that some devices need.

Having more flash also means you can compile in more Tasmota features such as conditions and expressions in rules (although I didn’t bother for my purposes)

Putting into flash mode

  • The timing to set it into boot mode was pretty critical when I was attempting it. There is a jumper for IO0 and ground (marked boot) . Put the link in place, power it up and remove in a couple of seconds. Other timing didn’t seem to work. Some places say to leave the jumper connected until the flashing is complete, but again this didn’t work for me.
  • I also attempted to use some longer leads in place of the jumper so I could just hold them together on powerup, but this didn’t work for me. Might have just been timing again, but the leads could be acting as antenna to the micro.

Tasmota config

HW-622 Tasmota Setup

Originally I just set tasmota to generic and set GPIO4 as Relay1 and GPIO5 as button1. This worked fine, but I remembered the blakadder template database, and this one is up there

That template allows for relay2 on GPIO12? Not sure why but this controls a blue LED right beside the ESP wifi aerial. I changed this to NONE, and also made GPIO5 button 1 (which ended up pretty much the same as what I had configured previously)


Useful page with setup info:
Relay (only) datasheet:
Another useful guide (found later…)

Was supposed to be the product datasheet, but it has moved:

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment