logo elektroda
logo elektroda
X
logo elektroda

[BK7231/CB3S] TreatLife SS01S Single pole switch with neutral, Tuya-CloudCutter remote flashing

tinker_elec 2754 0

TL;DR

  • A July 2023 TreatLife SS01S single-pole switch with neutral uses a CB3S module and BK7231N chip, which the standard tuya-cloudcutter SS01S profile could not flash.
  • Flashing works through Tuya-CloudCutter interactive mode by choosing '1.1.0 - BK7231N / oem_bk7231n_dctrl_switch' and an ESPHome-Kickstart BK7231N OTA image.
  • Rear label lists AC 100V-240V input, 10A maximum resistive load, and 5A incandescent load.
  • CloudCutter eventually installs ESPHome Kickstart, and LibreTiny ESPHome makes the basic light switch work with GPIO P6/P24 mappings.
  • You must manually set the device IP in the ESPHome YAML, because automatic discovery may fail and the hostname or IP can change after flashing.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
📢 Listen (AI voice):
  • I want to thank all the hard working developers and those that write documentation on code. I could not have figured this out without your extensive effort!

    [BK7231/CB3S] TreatLife SS01S Single pole switch with neutral, Tuya-CloudCutter remote flashing[BK7231/CB3S] TreatLife SS01S Single pole switch with neutral, Tuya-CloudCutter remote flashing[BK7231/CB3S] TreatLife SS01S Single pole switch with neutral, Tuya-CloudCutter remote flashing[BK7231/CB3S] TreatLife SS01S Single pole switch with neutral, Tuya-CloudCutter remote flashing[BK7231/CB3S] TreatLife SS01S Single pole switch with neutral, Tuya-CloudCutter remote flashing

    This Treatlife SS01S switch has been available for a while but this version bought July 2023 has the CB3S module with BK7231N chip which does not appear to be supported in tuya-cloudcutter.

    Rear label info:
    - Model: SS01S
    - Input: AC 100V-240V, 50/60Hz
    - Output: 10A Maximum Resistive Load, 5A Incandescent
    - Wireless Standard: IEEE802.11b/g/n
    - Wireless Frequency: 2.4GHz
    - FCC ID: 2ANIFSS01S
    - IC: 24572-SS01S
    - ETL US Listed
    - Intertek 5012525
    - Conforms to UL. STD. 60730-1
    - Conforms to UL. STD. E60730-1
    - Wires: Load, Live, Neutral, Ground

    Tuya app info:
    - Main: v1.1.0
    - MCU: v1.1.0

    Tuya-CloudCutter Info:
    The switch would not flash using the existing Treatlife SS01S profile stating that the exploit failed. I tried multiple profiles and finally successfully flashed to ESPHome Kickstart using interactive mode with the following:
    - Start CloudCutter Interactive mode
    - 2) Flash 3rd Party Firmware
    - > By Firmware version and name
    - > 1.1.0 - BK7231N / oem_bk7231n_dctrl_switch
    - > ESPHome-Kickstart-v23.04.28_bk7231n_app.ota.ug.bin
    - Provide power to switch.
    - Hold main button until LED starts flashing quickly which took about 7s
    - Let go of main button for 1s
    - Hold main button until LED starts flashing slowly which took another 7s
    - CloudCutter detects AP and performs exploit, asks to reboot device, Red LED turns on constant
    - Disconnect power from switch for 1s and apply power again
    - Repeat main button hold 7s , release 1s , Hold 7s until LED is flashing slow again
    - CloudCutter detects again and configures WiFi
    - Do not do anything. LEDs turn off and switch reboots after ~30s.
    - Connects to CloudCutter AP after additional 30s and installs firmware
    - Wait about 45s and look for ESPHome Kickstart AP. If it does not show up then remove power from switch and apply after 1s. Wait another 45s.
    - Connect to the ESPHome Kickstart AP. Should direct you to config page at http:192.168.4.1
    - Select or enter your Wifi Login info and click save.
    - Disconnect from ESPHome Kickstart AP (makes it reboot faster)
    - Wait 60s as it reboots and connects
    - Should see it on router, If not check if ESPHome Kickstart AP is still which probably means login info was wrong.

    Configure Switch in ESPHome - LibreTiny
    You must use the LibreTiny version of ESPHome. Thankfully an addon repository exists that makes it easy to install in HomeAssistant. Thanks greatly!

    - Click button "+ New Device" bottom right
    - Click button "Continue"
    - Input a friendly name that can contain lower/upper alphanumeric and spaces. Do not use special characters. I like to use the position of the device in the house such as "Master Bathroom Ceiling". Do not add "Light", "Switch", "Fan" to the end as these will be added by ESPHome.
    - Click "LibreTiny"
    - Scroll to section "Tuya Inc." and click on "CB3S WiFi Module". Click "Next" button.
    - Ignore Encryption Key and click "Skip" button.
    - Click "Edit" button on the new device with the name you just entered.
    - This will display editor with YAML like:

    esphome:
      name: master-bathroom-ceiling
      friendly_name: Master Bathroom Ceiling
    
    libretiny:
      board: cb3s
      framework:
        version: dev
    
    # Enable logging
    logger:
    
    # Enable Home Assistant API
    api:
      encryption:
        key: "5LLyz69iXxwxFzFhQPxlh2dHKZXVz3jpYNyb5GiSrk8="
    
    ota:
      password: "3a9e7fba5a0b147176db985bc07b45be"
    
    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
    
      # Enable fallback hotspot in case wifi connection fails
      ap:
        ssid: "Master-Bathroom-Ceiling"
        password: "cDu5z715FLWk"
    

    I will leave it up to you to configure the above code to suit your needs. To get the basic light switch working you need to add the following under the code:
    binary_sensor:
      - platform: gpio
        id: button
        name: Button
        internal: True
        pin:
          number: P6
          mode: INPUT_PULLUP
          inverted: True
        on_multi_click:
          # Single press for normal operation
          - timing:
            - ON for at most 1s
            - OFF for at least 0.1s
            then:
              - light.toggle: light_relay
    
    output:
      - platform: gpio
        id: relay
        pin:
          number: P24
          inverted: True
    
    light:
      - platform: binary
        name: Light
        id: light_relay
        output: relay
    

    The VERY IMPORTANT part is that you need to find the IP address of the device you want to flash as it will probably not be discovered automatically. You only need to do this once. In the ESPHome YAML config file you need to add the IP:

    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
      use_address: 192.168.1.162 # example IP to flash from kickstart - replace with your actual device IP
    

    Now that you have that set you can click the "Install" button top right. You should see the firmware compile and install. Note that device hostname will change and most probably the IP will also change after flashing so your will have to find the new info. Look at your router overview/status page for the new info.

    If you want to get more out of the switch then you can use the following YAML:
    # Report the WiFi Signal strength
    sensor:
      - platform: wifi_signal
        name: WiFi Signal
        update_interval: 60s
        filters:
          - delta: 0.01
          - throttle: 300s
    
    # Provide switches to restart device in normal and Safe modes.
    switch:
      - platform: restart
        name: "Restart"
        id: restart_normal
      - platform: safe_mode
        id: restart_safe
        name: "Restart (Safe Mode)"
    
    binary_sensor:
      # This is the physical button button pressed on switch
      - platform: gpio
        id: button
        name: Button
        internal: True
        pin:
          number: P6 # GPIO24
          mode: INPUT_PULLUP
          inverted: True
        # Using timed clicks to perform various operations
        on_multi_click:
          # Single press for normal operation On/Off operation
          - timing:
            - ON for at most 1s
            - OFF for at least 0.1s
            then:
              - light.toggle: light_relay
          # Long press 10s start flashing red LED slow to show that it will restart device
          - timing:
            - ON for at least 10s
            then:
              - repeat:
                  count: 5
                  then:
                  - light.turn_on: led_red
                  - delay: 500ms 
                  - light.turn_off: led_red
                  - delay: 500ms
          # Long press 10 to 15s restart the device 
          - timing:
            - ON for 10s to 15s
            - OFF for at least 0.1s
            then:
              - switch.toggle: restart_normal
          # Long press 15s start flashing red LED fast to show it will restart in safe mode
          - timing:
            - ON for at least 15s
            then:
              - repeat:
                  count: 10
                  then:
                  - light.turn_on: led_red
                  - delay: 250ms 
                  - light.turn_off: led_red
                  - delay: 250ms
          # Long press 15 to 20s restart the device
          - timing:
            - ON for 15s to 20s
            - OFF for at least 0.1s
            then:
              - switch.toggle: restart_safe
    
    output:
      - platform: gpio
        id: relay
        pin:
          number: P24 # GPIO24
          inverted: True
      - platform: gpio
        id: led_white_output
        pin:
          number: P8
          inverted: True
    
    light:
      - platform: binary
        name: Light
        id: light_relay
        output: relay
        # Optionally turn the white LED on and off when the main light state changes. 
        on_turn_on:
        - light.turn_on: led_white
        on_turn_off:
        - light.turn_off: led_white
      - platform: binary
        id: led_white
        output: led_white_output
        internal: True
      - platform: status_led
        name: "Switch state"
        id: led_red
        internal: True
        pin: 
          number: P7 # GPIO6
          inverted: True
    

    If you hold the main button for 10s it will flash an LED slowly to let you know you cant restart the device in normal mode after 10s. Release the button when it flashes slowly to do a normal restart. If you hold the button longer it will cancel the normal restart. Hold it for 15s and it will start blinking quickly. Release button when its blinking quickly and it will restart in safe mode. Hold it longer, when it stops flashing and it will do nothing.

    Happy flashing to all! Let me know if I missed some valuable info.

    Cool? Ranking DIY
    About Author
    tinker_elec
    Level 1  
    Offline 
    tinker_elec wrote 1 posts with rating 2. Been with us since 2023 year.
  • ADVERTISEMENT
📢 Listen (AI voice):

FAQ

TL;DR: For TreatLife SS01S owners with a BK7231N switch rated 10A max, "interactive mode worked" when the stock SS01S CloudCutter profile failed. Use Tuya-CloudCutter interactive mode, select firmware 1.1.0 / oem_bk7231n_dctrl_switch, then install ESPHome Kickstart and finish with LibreTiny-based ESPHome for CB3S devices. [#20660676]

Why it matters: This workflow gives CB3S-based July 2023 SS01S switches a repeatable path to local firmware when the normal device profile does not flash.

Method Device selection Result
Existing TreatLife SS01S profile Prebuilt SS01S profile Exploit failed
CloudCutter interactive mode 1.1.0 - BK7231N / oem_bk7231n_dctrl_switch Flash succeeded
Standard ESPHome target Not CB3S-specific Not the recommended path
ESPHome + LibreTiny CB3S WiFi Module Required for final configuration

Key insight: The breakthrough was not the switch model name. It was matching the July 2023 hardware to BK7231N + CB3S and flashing through CloudCutter interactive mode before moving to LibreTiny ESPHome.

Quick Facts

  • Rear label specs: AC 100V-240V, 50/60Hz, 10A maximum resistive load, 5A incandescent load, and 2.4GHz 802.11 b/g/n Wi-Fi. [#20660676]
  • This SS01S version bought in July 2023 used a CB3S module with a BK7231N chip, which did not flash with the existing SS01S profile. [#20660676]
  • The successful CloudCutter target was Main v1.1.0, MCU v1.1.0, device name oem_bk7231n_dctrl_switch, followed by ESPHome-Kickstart-v23.04.28_bk7231n_app.ota.ug.bin. [#20660676]
  • Main control pins in the shared YAML were P6 for the button, P24 for the relay, P8 for the white LED, and P7 for the red status LED. [#20660676]
  • The switch wiring called out on the rear label was Load, Live, Neutral, and Ground, which matters because this is a single-pole switch with neutral. [#20660676]

How do I flash a TreatLife SS01S switch with a CB3S module and BK7231N chip using Tuya-CloudCutter interactive mode?

Use CloudCutter interactive mode, not the default SS01S profile. 1. Choose Flash 3rd Party Firmware and select 1.1.0 - BK7231N / oem_bk7231n_dctrl_switch with ESPHome-Kickstart-v23.04.28_bk7231n_app.ota.ug.bin. 2. Power the switch and enter fast-blink, then slow-blink mode with the button. 3. Let CloudCutter exploit, reboot, reconnect, configure Wi‑Fi, and wait for the ESPHome Kickstart AP. If the AP does not appear, power-cycle the switch for 1 second and wait again. [#20660676]

Why does the existing TreatLife SS01S profile fail in Tuya-CloudCutter for some July 2023 switches with BK7231N?

It fails because some July 2023 SS01S units use different hardware than the older profile expects. The shared report says that a switch bought in July 2023 had a CB3S module with a BK7231N chip, and the existing TreatLife SS01S profile returned an exploit failure. Interactive mode succeeded only after matching the device by firmware version and name instead of by the old profile. [#20660676]

What firmware version and device name should I choose in Tuya-CloudCutter for a TreatLife SS01S showing Main v1.1.0 and MCU v1.1.0?

Choose 1.1.0 - BK7231N / oem_bk7231n_dctrl_switch. The successful flash used Tuya app versions Main v1.1.0 and MCU v1.1.0, then selected ESPHome-Kickstart-v23.04.28_bk7231n_app.ota.ug.bin as the third-party image. That combination matched the reported CB3S-based SS01S and completed the exploit. [#20660676]

What button-hold timing is needed to put the TreatLife SS01S into the fast-blink and slow-blink states during CloudCutter flashing?

Hold the main button for about 7 seconds until the LED blinks quickly, release for 1 second, then hold again for about 7 seconds until the LED blinks slowly. That fast-blink to slow-blink sequence was used twice during the process: once for the exploit and once for Wi‑Fi configuration after the reboot request. [#20660676]

How long should I wait during each stage of the CloudCutter and ESPHome Kickstart process before assuming the flash failed?

Wait through the full staged timing before retrying. After Wi‑Fi configuration, the LEDs turned off and the switch rebooted after about 30 seconds. It then reconnected to the CloudCutter AP after another 30 seconds and installed firmware. After that, wait about 45 seconds for the ESPHome Kickstart AP. If it still does not appear, power-cycle for 1 second and wait another 45 seconds. After saving Wi‑Fi, allow about 60 seconds for reboot and network join. [#20660676]

What is ESPHome Kickstart, and how does it help when flashing a BK7231N-based Tuya switch?

ESPHome Kickstart is the temporary firmware image that gets the BK7231N switch onto your Wi‑Fi so you can install a full ESPHome build next. > "ESPHome Kickstart" is temporary onboarding firmware that boots after CloudCutter, exposes a local access point, and lets you save Wi‑Fi credentials so the device can receive its next firmware image over the network. In this case, CloudCutter installed ESPHome-Kickstart-v23.04.28_bk7231n_app.ota.ug.bin, then the user connected to its AP and opened 192.168.4.1. [#20660676]

What is LibreTiny in ESPHome, and why is it required for the CB3S WiFi module instead of standard ESPHome?

LibreTiny is required here because the switch uses a CB3S module, not an ESP8266 or ESP32 board. > "LibreTiny" is an ESPHome platform layer that supports non-ESP microcontroller families such as BK7231 devices, exposing board definitions like CB3S and enabling firmware builds that match that hardware. The report explicitly says you must use the LibreTiny version of ESPHome and then choose Tuya Inc. → CB3S WiFi Module. [#20660676]

How do I create a basic ESPHome LibreTiny YAML config for a TreatLife SS01S using the CB3S board?

Start with a LibreTiny device using the cb3s board and add one button sensor plus one relay-backed binary light. The shared base YAML used board: cb3s, framework: version: dev, Wi‑Fi, API, OTA, and logger. For switching, add a binary_sensor on P6 with INPUT_PULLUP and inverted: True, an output relay on P24 with inverted: True, and a light binary entity that toggles the relay. [#20660676]

Which GPIO pins on the TreatLife SS01S CB3S board control the main button, relay, white LED, and red status LED?

The shared mapping was P6 for the main button, P24 for the relay, P8 for the white LED, and P7 for the red status LED. In the posted YAML, the button used INPUT_PULLUP and inverted: True, the relay output on P24 was also inverted, and the red LED was configured as a status_led. Those exact pin assignments made the advanced configuration work. [#20660676]

Why do I need to add wifi.use_address in ESPHome when installing firmware onto a TreatLife SS01S from Kickstart?

You need wifi.use_address because ESPHome may not auto-discover the Kickstart-flashed device on the network. The report says this step was VERY IMPORTANT and that you usually need to find the device IP once, then add use_address: 192.168.1.162 as an example. Without that direct IP, the install step can fail even though the device already joined Wi‑Fi. [#20660676]

What should I check if the ESPHome Kickstart AP does not appear after CloudCutter finishes flashing the TreatLife SS01S?

First, wait the full 45 seconds, then power-cycle the switch for 1 second and wait another 45 seconds. If the AP still does not appear, the process did not finish cleanly. If the Kickstart AP appears but the device never joins your router later, check whether your Wi‑Fi login was entered correctly. The post notes that a lingering Kickstart AP usually means the login details were wrong. [#20660676]

How can I find the IP address of a newly flashed TreatLife SS01S so ESPHome can install the next firmware image?

Check your router’s client list or status page and use that address in ESPHome. The shared workflow says the device should appear on the router after the Kickstart Wi‑Fi setup, and that you should then place that IP in wifi.use_address. After the full ESPHome flash, the hostname changes and the IP may also change, so you may need to look it up again. [#20660676]

What's the difference between the minimal ESPHome YAML and the advanced YAML with restart, safe mode, and LED feedback for the SS01S?

The minimal YAML only gives you core light-switch control. It maps the button on P6, the relay on P24, and toggles the load with a single press. The advanced YAML adds a Wi‑Fi signal sensor, normal restart, safe mode restart, white LED state mirroring on P8, red status LED feedback on P7, and multi-click timing for 10-second and 15-second long-press actions. Use the minimal file for fast setup and the advanced one for recovery and feedback features. [#20660676]

How can I use long-press actions on the TreatLife SS01S button to trigger normal restart and safe mode in ESPHome?

Use on_multi_click with timed hold ranges on the button input. A hold of at least 10 seconds starts a slow red LED flash, and releasing between 10 and 15 seconds triggers a normal restart. A hold of at least 15 seconds starts a faster flash, and releasing between 15 and 20 seconds triggers safe mode. Holding longer cancels the action when the flashing stops. [#20660676]

What safety and wiring details should I verify before working with a TreatLife SS01S single-pole switch with neutral, load, live, and ground connections?

Verify that the switch matches the required wiring and electrical ratings before you touch firmware or mains power. The rear label lists Load, Live, Neutral, and Ground, so this is a neutral-required single-pole switch. It is labeled for AC 100V-240V, 50/60Hz, 10A maximum resistive load, and 5A incandescent. Confirm those conductors are present and identify them correctly before powering the device for flashing or installation. [#20660676]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT