Treatlife 3 Way Switch SS01 SS02 Setup



TreatLife SS01 SS02 3 Way Switch

Tasmota Setup Commands (copy and paste each section to one line in the Tasmota Console)

template {"NAME":"Moes/Treatlife 3-Way","GPIO":[21,255,157,255,56,53,0,0,30,10,9,255,255],"FLAG":0,"BASE":18}

module 0

Console will Reboot. Wait for it.

backlog switchtopic 0 ; switchmode1 2 ; switchmode2 5 ; setoption32 7 ; setoption34 1 ; powerretain 1 ; rule1 1

(this is all one line below!)
rule1 on power1#boot=0 do backlog nodelay ; var1 TOGGLE; var2 ""; ledpower1 0 ; ledpower2 0 endon on power1#boot=1 do backlog nodelay ; var2 TOGGLE; var1 ""; ledpower1 1 ; ledpower2 1 endon on power1#state=0 do backlog nodelay ; var1 TOGGLE; var2 ""; ledpower1 0 ; ledpower2 0 endon on power1#state=1 do backlog nodelay ; var2 TOGGLE; var1 ""; ledpower1 1 ; ledpower2 1 endon on event#ON do power2 %var1% endon on event#OFF do power2 %var2% endon

Currently the Red LED is on while the light is off and the White LED is on while the lights is on.  If you want this reversed, go to Configuration, Configure Template and change Led1i to Led1, and Led2 to Led2i.  Click Save.

NOTE: You CANNOT use Auto Discovery with this switch at this time due to the split config.  Please use the configuration below.  The GUI of Tasmota can be confusing as one of the ON/OFF buttons is  the load sensor that toggles automatically.  Use the tasmota-lite.bin file to remove this device from Tasmota HA integration discovery. 

Sample Home Assistant Config 
Remove the "light:" if needed

light:
  - platformmqtt
    name"Hallway Light"
    state_topic"stat/yourTopic/POWER1"
    command_topic"cmnd/yourTopic/EVENT"
    availability_topic"tele/yourTopic/LWT"
    payload_on"ON"
    payload_off"OFF"
    payload_available"Online"
    payload_not_available"Offline"

Take note of the slightly different command topic with the EVENT command.

Thanks @machination for the new set of rules that prevent excessive flash memory writes!

Internal Pictures



Comments

  1. I have several of these 3-way switches installed; all but one of them behaves properly from within Home Assistant. The one strange one will only properly report the state of the light if the 'dumb' switch is down; when the 'dumb' switch is up, the light can be toggled but the state is not updated. Have you run into this situation before? I've tried re-configuring everything about a dozen times and it's the same behavior every time.

    ReplyDelete
  2. I've only run into this when the light load wasn't not enough for the switch to detect the change.

    ReplyDelete
    Replies
    1. But it's able to detect the load when the dumb switch is in one position; wouldn't the load be the same when the dumb switch is in the opposite position?

      Delete
    2. Does it change states properly with the smart switch changing? If so then it could be a traveler issue.

      Delete
    3. When the dumb switch is up, I can turn the lights on/off from the smart switch, but the led indicator stays off. When the dumb switch is down, I can turn the lights on/off from the smart switch but the led is off when the lights are off, and turns on after about two seconds when I turn the lights on. My other switches have the led indicator on when the lights are off (about 0.5 second delay), and off when the lights are on.

      Delete
    4. Look at the Tasmota console. The indicator on the left, is it changing from ON to OFF etc when toggling?

      Delete
    5. Weirdly, it seems to depend on whether the second toggle is ON or not. If the 2nd toggle is OFF, I do see the first toggle changing between OFF and ON when I flip the dumb switch up and down. But if I go over and press the smart switch once, which turns toggle 2 to ON, then I go over and flip the dumb switch up and down, toggle 1 stays OFF the entire time, even though the lights are turning on and off. Also, I'm not using the tasmota GUI to change anything, only the physical dumb and smart switch. The only difference I can think of here compared to all the other 3-ways installed, is that my great room had two separate 3-way switches for the front lights and back lights, which I asked my electrician to combine into a single switch that controlled both rows of lights. I also configured a second Treatlife SS02 and put it in the wall and I see the exact same behavior.

      Delete
    6. Sounds like you have a wiring issue going on and the switch can't read the load is on.

      Delete
  3. I'm having an issue where its only sending the TOGGLE when the switch goes off, but not on.

    05:21:32.987 RUL: EVENT#ON performs "power2 "
    05:21:32.993 MQT: stat/tasmota_ragswag/RESULT = {"POWER2":"OFF"}
    05:21:32.996 MQT: stat/tasmota_ragswag/POWER2 = OFF (retained)
    05:21:33.370 MQT: stat/tasmota_ragswag/RESULT = {"Event":"Done"}
    05:21:33.417 RUL: EVENT#OFF performs "power2 TOGGLE"
    05:21:33.426 MQT: stat/tasmota_ragswag/RESULT = {"POWER2":"ON"}
    05:21:33.431 MQT: stat/tasmota_ragswag/POWER2 = ON (retained)
    05:21:33.682 MQT: stat/tasmota_ragswag/RESULT = {"POWER1":"ON"}
    05:21:33.686 MQT: stat/tasmota_ragswag/POWER1 = ON (retained)

    Any idea why the rule would only send TOGGLE for off? I went and copy and pasted everything again from your instructions and I still can't get it to turn the light on. It was working, I haven't change anything, and now it's not working for turning on.

    ReplyDelete
    Replies
    1. Because there is no on or off in a three way switch relay. Is power1 changing with the state of the load?

      Delete
  4. You may already know, but in a basic 3-way circuit, there are two 3-way switches installed. When installing a "smart" switch, it is only necessary to replace one of the "dumb" switches to make it work correctly. It is however important to replace the right one. The "smart" switch is to replace the "dumb" switch that is connected directly to the incoming line power. To find the correct one, with the power off, disconnect the line/load wire at both "dumb" switches. Put a wire nut on each, turn the power back on and probe with a power detector to determine which is still "hot". This is the one to replace with the "smart" switch. Also, where there are three switches to control one light, one of the switches will be a 4-way. The 4-way does not need to be replaced. Still, only one of the 3-ways needs to be replaced to work correctly.

    ReplyDelete
  5. I had set up my TreatLife 3-way switches to operate lights a long time ago using different instructions and everything was working fine except when I tried to use automation to turn them on and off and noticed that it was doing a toggle every time rather than on vs off. My notes from the time seem to indicate that I used the following but I may have done more

    template {"NAME":"TreatLife 3Way","GPIO":[0,0,0,0,53,29,0,0,30,18,9,0,0],"FLAG":0,"BASE":18}
    Rule1 ON Switch1#state do Power1 2 endon; Rule1 1
    Rule2 ON Button1#state do Power2 2 endon Rule2 1
    Rule3 ON event#OFF do Power2 2 endon ON event#ON do Power2 2 endon; Rule3 1


    I just redid one of them using the instructions here and confirmed that the light is turning on and off correctly from the physical smart and dumb switches and that Toggle1 is reflecting the on/off state of the light.

    This all good.

    My configuration.yaml code fragment for the switch is:

    switch:
    - platform: mqtt
    name: "Study Lights"
    state_topic: "stat/TreatLife4/POWER1"
    command_topic: "cmnd/TreatLife4/EVENT"
    payload_on: "ON"
    payload_off: "OFF"
    availability_topic: "tele/TreatLife4/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"


    What entity would I put on a dashboard card to show the state of the light and to change it?

    And what service do I call within an automation to turn the light on or off ?

    Thanks

    ReplyDelete
    Replies
    1. Once you do the setup I showed the entity in HA will work like any normal switch. Nothing special to do or call.

      Delete
    2. In developer tools, I see switch.TreatLife4-Toggle1 and switch.TreatLife4-Toggle2 (since I used switch for MQTT) which follow Toggle1 and Toggle2 in Tasmota.

      In interactive mode, I suppose I could look at Toggle 1 to see if the light is currently on or off and then decide whether I want to hit the Toggle2 icon or not. Is there a simple way to turn the light on from within an automation though?

      Maybe I should change from switch to light.

      Delete
    3. I figured it out by looking at what was available in HA's Developer menu!

      Delete
    4. I think you are missing the setup up above. It works like a normal light switch.

      Delete
  6. Can this be used with Gosund SW6 too?

    ReplyDelete
  7. I did the setup again and everything is working. Also, I had "so19 1" from the original instructions for the SS02. Should I turn it off?

    ReplyDelete
    Replies
    1. So19 shouldn't be used anymore. I would probably run Tasmota-lite on this switch so the Tasmota integration does not pick it up.

      Delete
  8. Is there a way to get the wifi signal strength into HA?

    ReplyDelete
  9. Please help. I’ve been Tasmotizing since 2018 (Sonoff Basic, 4 Channel, 2 motor switch, etc), Home Assistant since 2019 (Wemos, ESP32 Dev boards, sensors, relays, etc) using Tasmotized and ESPHome flashed devices, so I have knowledge of flashing, customizing.
    Since Sonoff does not have ‘Decora' style switches, I wanted to Tasmotize Tuya based Single Pole, 3-way, dimmer and fan switches to match what I have and work with Alexa. I selected ‘Treatlife’ SS02 series switches. I knew newer units have Non-8266 chips and would need to replace them. With a Hot Air station I'm able to remove Tuya WB3S with little problem and replace with ESP8266 ESP-12F.
    So far, replaced 4 ‘Treatlife’ WB3S chips, (Single Pole SS02S), flashed (Tasmota v11.0), installed switches, discovered with Alexa, ALL work exactly as they should.
    HELP— On 'Treatlife' 3-way; ‘Tasmotized’ ESP-12F, set up WiFi, added template, named, selected Hue Bridge, tested access (by browser GUI), Alexa discovered, then replaced WB3S chip on Daughter board: SS02_LED Board V1.1, 2019-01-19, installed. NOTHING worked right. GUI showed 2 switches, ‘Dumb' switch could turn light on/off but Alexa could not (only operated 2nd switch). GUI showed light ON when it was OFF, etc.
    TRIED: New template, rules [from your site]. NOTHING worked as it should.
    The ONLY way it ‘kind of’ works is using the Single Pole switch template.
    I’m at a dead stop, I can’t solve this problem. ANY web sites, blogs or suggestions would be appreciated.
    Thanks

    ReplyDelete
    Replies
    1. The problem is there is no real on/off with a 3 way switch since the other dumb/smart switch changes the state. The way this switch is designed, the load sensor detects if the light is on and I have it change the fake relay. This is setup for Home Assistant for it to send events. It works fine if you have your voice assistant tied into Home Assistant or some home automation system that can handle doing events.

      Delete

Post a Comment