Logo
TreatLife Light and Fan Dimmer (DS03)
US
TreatLife Light and Fan

Available from:
Amazon.com
Banggood.com




Manufacturer:
Treatlife.tech

Install method:
USB to Serial

GPIO #Component
GPIO00 None
GPIO01 Tuya Tx
GPIO02 None
GPIO03 Tuya Rx
GPIO04 None
GPIO05 None
GPIO09 None
GPIO10 None
GPIO12 None
GPIO13 None
GPIO14 None
GPIO15 None
GPIO16 None
FLAG None
Configuration (old format, will be converted to new template when applied)
{"NAME":"DS03 Fan/Light","GPIO":[0,107,0,108,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}

This device now comes with a Wi-Fi module incompatible with Tasmota

01/14/2022 - module received from Amazon has ESP module, so some are still being sold. Had to hold reset button (very bottom of switch) while programming with 3.3v, GND, TX, RX, and GPIO0 wires soldered to Tuya board.

08/06/2021 - module just recieved from amazon contained Tuya WB3S module which cannot be flashed with Tasmota. That module is pin compatible with ESP-12 and can ordered via Ebay, or harvested from another board (I used an ESP8266MOD from a D1 mini). Once the ESP is swapped, you must pull GPIO15 low by connecting it to GND so that the ESP will boot.


Flashed via Serial, using the same method as the Treatlife DS02S. May work with Tuya-Convert. Unknown at this time.

Additional troubleshooting can be done based on the DS02S template, since it has most of the same features: Treatlife DS02S

Before we begin: We might need to set the TuyaMCU baudrate to 115200 bps (Tasmota default is 9600 for TuyaMCU).

You can see if you’re getting heartbeat messages from the Tuya MCU Chip by changing the WebLog level to 4 (This can be changed back to default by entering weblog 2)

WebLog 4

If you’re getting messages that say something like {"TuyaReceived":{"Data":"55AA030000010104","Cmnd":0,"CmndData":"01"}} you don’t need to change the baudrate. If you’re seeing the ping (such as TYA: Send "55AA030000010104") to the MCU but no reply, you’ll need to change the baudrate with the command below:

SetOption97 1

This will set the baudrate to 115200. After this, you should start receiving heartbeat replies from the TuyaMCU (like TYA: Heartbeat), and the Red LED might come on for a few seconds.

Note that if you disassembled the switch to flash Tasmota via a serial connection, you may not see communication back from the MCU without reassembling the switch and connecting the switch to your mains power.

There must be two sets of commands ran to make this work for both a fan and light. Additionally, the fan speed can only be controlled over MQTT or similar, unless custom rules are written.

  1. Let’s enable the functions of the switch:
Backlog TuyaMCU 11,1;TuyaMCU 21,10;TuyaMCU 12,9;DimmerRange 100,1000;ledtable 0

These commands bind the software to the specific types of controls that the MCU uses. More information can be found in the Tasmota TuyaMCU guide. The last two commands set the dimming range from 100 to 1000, which was observed from when I set the brightness to minimum and maximum. Finally, the ledtable sets the scale properly so that it dims from 10-100 properly.

Rule1 on TuyaReceived#Data=55AA03070005030400010016 do publish2 stat/%topic%/speed 3,1 endon on TuyaReceived#Data=55AA03070005030400010117 do publish2 stat/%topic%/speed 3,1 endon on TuyaReceived#Data=55AA03070005030400010218 do publish2 stat/%topic%/speed 3,2 endon on TuyaReceived#Data=55AA03070005030400010319 do publish2 stat/%topic%/speed 3,3 endon

Enable rule with Rule1 1

This will monitor the TuyaMCU for changes to the speed of the fan and publish them to MQTT. These rules could be changed to allow other integrations, but for the purposes of Home Assistant, we’re keeping it simple. If this does not work as intended (Check your MQTT broker to make sure the messages are getting published), you may have to check your dpIDs and make sure they match the rules. Additional information can be found in the TuyaMCU Guide as well as the DS02S guide.

2a.

The fan speed data ID may be different between switches. If so, here’s what I had referenced. Check yours against this.

Lowest 55AA03070005030400010016 Low 55AA03070005030400010117 Medium 55AA03070005030400010218 High 55AA03070005030400010319

Note about fan speed IDs: Lowest and Low are the same voltage output (I checked with a multi-meter). I believe the “Lowest” setting ID is there for cosmetic reasons, since there are 8 LEDs, they wanted 4 of them lit for the fan. That is the reason you will see that the ‘Lowest’ and ‘Low’ IDs publish the same MQTT information

Home Assistant Fan YAML:

fan:
  - platform: mqtt
    name: "TreatLife Fan"
    state_topic: "stat/Treatlife-DS03/POWER1"
    command_topic: "cmnd/Treatlife-DS03/POWER1"
    preset_mode_state_topic: "stat/Treatlife-DS03/speed"
    preset_mode_command_topic: "cmnd/Treatlife-DS03/TuyaSend4"
    qos: 0
    payload_on: "ON"
    payload_off: "OFF"
    preset_mode_command_template: >
      {% if value == 'low' %}
        3,1
      {% elif value == 'medium' %}
        3,2
      {% elif value == 'high' %}
        3,3
      {% endif %}
    preset_mode_value_template: >
      {% if value == '3,1' %}
        low
      {% elif value == '3,2' %}
        medium
      {% elif value == '3,3' %}
        high
      {% endif %}
    availability_topic: tele/Treatlife-DS03/LWT
    payload_available: Online
    payload_not_available: Offline
    preset_modes:
      - 'low'
      - 'medium'
      - 'high'

Here is an alternate config for the fan so it comes on when a preset is selected:

fan:
  - platform: mqtt
    name: "TreatLife Fan"
    state_topic: "stat/Treatlife-DS03/POWER1"
    command_topic: "cmnd/Treatlife-DS03/POWER1"
    preset_mode_state_topic: "stat/Treatlife-DS03/speed"
    preset_mode_command_topic: "cmnd/Treatlife-DS03/Backlog"
    qos: 0
    payload_on: "ON"
    payload_off: "OFF"
    preset_mode_command_template: >
      {% if value == 'low' %}
        TuyaSend4 3,1;Power1 ON
      {% elif value == 'medium' %}
        TuyaSend4 3,2;Power1 ON
      {% elif value == 'high' %}
        TuyaSend4 3,3;Power1 ON
      {% endif %}
    preset_mode_value_template: >
      {% if value == '3,1' %}
        low
      {% elif value == '3,2' %}
        medium
      {% elif value == '3,3' %}
        high
      {% endif %}
    availability_topic: tele/Treatlife-DS03/LWT
    payload_available: Online
    payload_not_available: Offline
    preset_modes:
      - 'low'
      - 'medium'
      - 'high'

Home Assistant Dimmer YAML:

light:
  - platform: mqtt
    name: "TreatLife Dimmer"
    state_topic: "stat/Treatlife-DS03/POWER2"
    command_topic: "cmnd/Treatlife-DS03/POWER2"
    availability_topic: "tele/Treatlife-DS03/LWT"
    brightness_state_topic: "stat/Treatlife-DS03/RESULT"
    brightness_command_topic: "cmnd/Treatlife-DS03/Dimmer"
    brightness_scale: 100
    brightness_value_template: "{{ value_json.Dimmer }}"
    qos: 1
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    retain: false