Help Please! Gosund SW2 on Tasmota

I have loaded the Template and Script from https://templates.blakadder.com/gosund_SW2.html

However it’s not working, the front touch panel doesn’t respond and when using the Tasmota UI it will show the light as “on” but there is not relay click and the “red” out line has no power.

Hi, I was watching to see if. There was any response to this…I brought some of these switches last month and was wreaking my brain and deep in forums trying to get these working. I am experiencing the same issues you are, I was able to get the light to do different things by experimenting with the “off” value in the script…but the behavior was still very wonky.

Eventually I broke down and just install the other 3 of 4 in the walls and just use them via the tuya app. It’s a pain because the HA does not get dimmer info from tuya so it’s just a switch I can toggle on and off. It is however a dimmer on Google home so I can use Google and the physical slide to adjust the brightness (which sucks)… hopefully someone a lot smarter than we are comes up with a fix…

I ended up sending them back and getting Martin Jerry’s. So much easier to both flash and use.

So I’m also running into this issue. I’m currently trying to debug and figure out what is wrong. For reference this Gosund SW2 is version 4.0 manufactured in April 2021. It contains an ESP8266EX and I was able to successfully flash it with Tasmota (scripting).

I followed the template and scripting steps listed here: Gosund SW2 Dimmer Template for Tasmota

This template and script did not work.

I later found this template:

Gosund SW2                   {"NAME":"Gosund Dimmer","GPIO":[1,3200,1,3232,32,0,1,1,320,576,416,1,1,0],"FLAG":0,"BASE":18}

Here: Tasmota/TEMPLATES.md at 4173340c6a5648c30a05f916b82c0f70e242de0e · arendst/Tasmota · GitHub

Which was updated for Tasmota version 9, but it also didn’t work.

I suspect that the GPIO mapping has changed or something related to the commands in the script but since I only started getting into this I don’t know how to troubleshoot the issue yet.

One interesting note here: I own a total of 9 Gosund switches. My original set was able to be done using Tuya-Convert, but the newest 4 cannot. The interesting part though is that the newer set shows up in Tuya as a Dimmer rather than a Light Switch. I’m not sure if that’s related to the issue here or if it’s just coincidence.

Thinking that it was an issue with the switch I flashed a second one and both have the same issue.

Tasmota loads properly and is configurable but the switch doesn’t work. It won’t trigger the relay, nor will it properly light dimmer lights on the front. If there is someone willing to help direct me to resources for better understanding how to figure out which gpio maps to what or how to debug the Tasmota script I don’t mind doing the leg work.

Been having the same issues. After struggling with tasmota I tried ESPHome. Still doesn’t work correctly but I was able to get relay to function in Home Assistant. Also I noticed that the ESPHome firmware was using the tuya serial protocol and not a special scripting protocol. I could see the touch strip reading my finger in the serial monitor of ESPHome but I’m assuming it is off in scaling since I could not get the LED bulbs above strobing and the LEDs on the touch strip failed to light up.

I bought a couple Gosund DS1 dimmers a while ago and they worked great with esphome configuration here: https://github.com/a-lost-shadow/gosund-sw2 I bought 6 more dimmers, first SW2 models, then some more DS1 models, but none of them worked with the esphome config - I saw the same weird behavior above. I managed to modify the config though and all the dimmers are working perfectly now with esphome (both my SW2s and new DS1s both use the same new config). I will post the esphome config on github soon. I am also finishing up a version of esphome to configure one of these dimmers as a ‘remote’, so you can dim a circuit with more than one dimmer (like from the top/bottom of the stairs) and I’ll post that too.

I got the SW2 V4 working by changing the script. Check on the slider board to see which version you have.

The script I use is:

>D 100
a=0
b=""
c=""
f=50
g=""
le="54"
dimval=1
>B
dp0
a=pwr[1]
=>Power 0
=>Dimmer 0
>E
b=SerialReceived
=>print SerialData is %b%
;Capture first boot up after power down
c=sb(b 0 2)
=>print FirstSerialData is %c%
if c=="72"
then
  =>print FirstBoot
  b=""
  =>print FirstBootOK
endif
if sl(b)>0
then
  if sl(b)==47
  then
    c=sb(b -5 2)
  else
    c=sb(b -8 2)
  endif
  f=(hd(c)*2)/3
  =#setDim(f)
  a=""
  b=""
  c=""
else
  f=Dimmer
  if chg[f]>0
  then
    =#setDim(f)
  endif
endif
if pwr[1]!=a
then
  if pwr[1]==1
  then
    f=Dimmer
    a=1
    =#setDim(f)
  else
    =>SerialSend5 30
    a=0
  endif
endif
#setDim(dimval)
  =>print dimval is %dimval%
  =>dimmer %dimval%
  le=hn((dimval*7/100)+81)
  =>print le is %le%
  g=hn((f/2)+129)
  =>print g is %g%
  =>print a is %a%
  =>SerialSend5 %g%
  if pwr[1]==1
  then
    =>SerialSend5 %le%
  endif
  =>print a is %a%

Using that script, the only problem I have is when I lose power, I have to set the dimmer to a non-zero value and switch on and off in HomeAssistant to make the switch work again. After doing that, everything works great again until the next power lost.

Hope this can be helpful to someone.

I just got a Shelly Plus wall dimmer which is the exact same hardware except it has an ESP32 chip inside