logo elektroda
logo elektroda
X
logo elektroda

How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration

p.kaczmarek2 7455 12
ADVERTISEMENT
Listen:
  • How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    Every OpenBeken/Tasmota/etc device requires a brief configuration after the initial flashing of the firmware. This configuration requires setting a proper roles for GPIOs, which are different for each device. Here I will show you an automatic way to configure GPIOs in OpenBeken. In OpenBeken, you can import GPIO directly from Tuya settings. This method is quick and efficient and works for most of the devices, only the TuyaMCU ones might require fully manual work.

    Topic assumption
    This topic assumes you have already flashed OpenBeken to your BK7231/BK7231T/BK7231N/XR809/W600/W800/BL602/other WiFi devices. You can find flashing guides on our youtube channel:
    https://www.youtube.com/watch?v=L6d42IMGhHw&list=PLzbXEc2ebpH0CZDbczAXT94BuSGrd_GoM
    and on our devices list:
    https://openbekeniot.github.io/webapp/devicesList.html

    Where to get templates?
    There are multiple places where you can get device templates.
    First, you can search our detailed teardowns list, here:
    https://openbekeniot.github.io/webapp/devicesList.html
    Here you can use various filters to browse devices list effectively, you can also click device name to get more or less detailed guide and discussion topic open:
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    You can also use cloudcutter profiles from here:
    https://github.com/tuya-cloudcutter/tuya-cloudcutter.github.io/tree/master/devices
    We are also working on frontend for cuttable devices here (coming soon):
    https://openbekeniot.github.io/webapp/cutterList.html
    It is also important to mention how are tuya-cloudcutter profiles created. This is for advanced users, but you can create them from 2MB device binary dump taken by our flash tool:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Just use the cloudcutter profile-building tool:
    https://github.com/tuya-cloudcutter/tuya-cloudcutter/tree/main/profile-building
    See readme for more info:
    https://github.com/tuya-cloudcutter/tuya-cloudcutter/blob/main/profile-building/README.md
    That way you can generate user_param_key.json with Tuya json config.
    Special thanks to tuya-cloudcutter contributors for making such useful tool!

    What is inside template?
    This is a technical only section, skip it if you're not interested.
    Here is a sample OpenBeken template:
    Code: JSON
    Log in, to see the code

    OpenBeken template consists some basic information about the device, device image, device page (discussion) topic, some keywords and a GPIO array. Each GPIO has a role and a channel. Channels are used to group together relays with buttons and to set PWM order for RGB, etc, devices.
    
        "26": "Rel;2"
    

    this means P26 has a Relay on channel (group) 2.
    Here is a tuya-cloudcutter template:
    Code: JSON
    Log in, to see the code

    There is also some information about the device, a device name, manufacturer, but there are no pins array. Instead, we have a Tuya json called device_configuration, also called user_param_key.
    Let's consider this fragment:
    Code: JSON
    Log in, to see the code

    The keys with "pin" suffix are pin indexes. For example, you can see that Relay 4 (group 4, in obk called "channel") is on P26 and a button (pairing/toggle all) is on P24.

    ADVERTISEMENT


    Template import page
    Now we assume that you have copied your device JSON profile, either from OpenBeken list (use Copy button) or from Cloudcutter.
    Those profiles are in different format, but can be very easily imported to OpenBeken.
    On OBK device, open Web Application and then Import tab:
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    Here you can paste the JSON config. Multiple JSON formats are supported. Please paste to first field (step 1). JSON will be converted to OBK commands in the second column (step 2).
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    You can modify resulting script if you want. For example, you can change commands. Once you are happy, press the big apply script button. Here is a correct import:
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    The import field features error detection. It will show an error if pasted JSON is invalid:
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    OpenBeken JSON template format also works:
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    Both text fields have error checking implemented.
    If you edit command manually and do a typo, you will get a failure during execution:
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration

    Even easier template import method
    Don't forget that you can just select device from drop down list on OBK Web Application. There you can also automatically import template, even without doing copy+paste:

    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration

    Template converter public frontend
    We have also released a little frontend for the template importer. It's not recommended to use it, but it's publicly available here:
    https://openbekeniot.github.io/webapp/templateImporter.html

    What if there is no template?
    It is also possible that you get a device that has no template yet, neither in OpenBeken list and not in Tuya-cloudcutter. In this case, you can take multiple approaches:
    - search for similiar devices on our lists and try their configs
    - open device and check with multimeter where traces are going (WiFi module pinouts are here)
    - just use a brute force approach - for example, set first 5 pins to Relay on channel 1, then save config, then try toggling them - do anything happen? If one of your relay toggles, then you know your relay is among those 5 pins. So try to narrow down selection. If not, your relay is on other pin. This also works for PWMs.
    - for LEDs, you can just use approach with relays (relay will just set PWM to 0 or 100%), or you can also enable "show raw LED controls" in OBK flags
    - for LEDs, remember that BK7231 supports PWM only of 6 pins, so for RGBCW (5 PWMs) there is not much choice.
    PWM IO
    PWM0P6
    PWM1P7
    PWM2P8
    PWM3P9
    PWM4P26
    PWM5P24
    - you can always ask for help here, I am here every day to help you!

    What about TuyaMCU devices?
    TuyaMCU devices are using WiFi module for communication with outside world and MCU for processing. The MCU communicates with WiFi module via TuyaMCU protocol. We have a TuyaMCU analyzer tool for this purpose, please refer to topic below:
    https://www.elektroda.com/rtvforum/topic3970199.html


    Summary
    There are multiple ways to import device into OpenBeken.
    You can get a template manually, either from tuya-cloudcutter/device binary, or from OpenBeken templates. OpenBeken templates are better, because they are user-created and usually more complete, but a template from tuya json can be a good quickstart for basic devices. As you can see, there are many ways to get OBK running, but remember, no matter which approach you choose, you can always ask for help on our forum. Have fun!

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14771 posts with rating 12914, helped 659 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 20552290
    DeDaMrAz
    Level 23  
    Posts: 621
    Help: 34
    Rate: 130
    Just to mention that you need latest OBK build (1.17.29 at the time of writing) for this to work.

    One thing to note if you are importing JSON files, it will purge the autoexec.bat so make sure to back it up if you have it on your device!!

    To do that go to filesystem tab on web app, click List Filesystem and if present click on Download Tar of FS and save it to a known location.
  • ADVERTISEMENT
  • #3 20552305
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    Very good point. It is, however, also useful to notice that the autogenerated script in second column includes lfs_format command:
    How to import OpenBeken/Cloudcutter templates - automatic GPIO/device configuration
    so, if desired,this command can be just removed before execution.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21297793
    mvz0209
    Level 8  
    Posts: 20
    Please tell me, the compiler does not want to process simple commands: delay_s 1, waitFor MQTTState 1, waitFor NTPState 1
    User interface with a script editor showing a command error.
  • #5 21297848
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    This is a template importer, not the autoexec.bat runner. You should create autoexec.bat in LittleFS:



    You can write it like:
    
    delay_s 1
    waitFor MQTTState 1
    
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #6 21297855
    mvz0209
    Level 8  
    Posts: 20
    Thank you very much. I'm still studying, it's very interesting
  • #7 21818496
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    Web App can now import tuya config from 2MB dump directly, can anyone help testing? @divadiow @insmod @max4elektroda @DeDaMrAz
    OpenBeken configuration generator with JSON input and text interpretation
    https://openbekeniot.github.io/webapp/templateImporter.html
    Tuya configuration interface with generated script and decoding log
    Helpful post? Buy me a coffee.
  • #9 21818512
    divadiow
    Level 38  
    Posts: 5220
    Help: 449
    Rate: 918
    Good work. But damn. I have a load of revisions in web app in a pr coming soon ;)
  • #10 21818540
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    @divadiow please open pr and test it and merge asap so we don't get merge conflicts
    Helpful post? Buy me a coffee.
  • #12 21818560
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14771
    Help: 659
    Rate: 12914
    Can you show screenshots and brief summary, if possible?
    Helpful post? Buy me a coffee.
Listen:

Topic summary

LABEL_AI_GENERATED
The discussion explains how to import OpenBeken and Cloudcutter/Tuya templates to automatically configure GPIO roles after flashing firmware on supported Wi‑Fi devices. It describes importing GPIO settings directly from Tuya configuration, notes that this works for most devices except TuyaMCU-based ones that may still need manual setup, and mentions that the latest OpenBeken build is required. It also warns that importing JSON templates can purge autoexec.bat from LittleFS, so the filesystem should be backed up first. Later replies clarify that command scripts such as delay_s and waitFor must be placed in autoexec.bat in LittleFS rather than in the template importer, and a newer web app feature is introduced for importing Tuya configuration directly from a 2 MB dump via the template importer page.
AI summary based on the discussion. May contain errors.

FAQ LABEL_AI_GENERATED

TL;DR: 2 MB firmware dumps and “latest OBK build” support automatic OpenBeken GPIO import for flashed BK7231-class devices. This FAQ helps OpenBeken users import templates, Cloudcutter profiles, or Tuya configs, while avoiding LittleFS and autoexec.bat mistakes. [#21818496]

Why it matters: Correct template import turns a flashed but unconfigured smart plug, power strip, or LED device into a usable OpenBeken device without manual GPIO mapping.

Method Input Best use Main caution
OpenBeken template pins JSON array Most complete device setup Match the exact device model
Tuya Cloudcutter profile device_configuration / user_param_key Fast GPIO quickstart TuyaMCU devices may need manual work
2 MB dump import Firmware binary dump Extract Tuya config directly Feature was still being tested in 2026
Manual discovery Multimeter or brute force No template exists Save and test pins carefully

Key insight: The importer is for GPIO/device templates, not general OpenBeken command execution. Use LittleFS autoexec.bat for commands such as delay_s and waitFor.

Quick Facts

  • OpenBeken template import was noted to require a recent OBK build; version 1.17.29 was current on 2023-04-23. [#20552290]
  • JSON import can purge autoexec.bat; back up LittleFS first using List Filesystem and Download Tar of FS. [#20552290]
  • A generated import script may include lfs_format; remove that command before execution if you want to keep existing LittleFS files. [#20552305]
  • BK7231 PWM-capable pins listed in the thread are P6, P7, P8, P9, P26, and P24, giving 6 PWM choices. [#20551972]
  • The public template importer gained direct Tuya-config import from a 2 MB firmware dump on 2026-01-24 and was reported to work at first glance. [#21818501]

How do I import an OpenBeken device template to automatically configure GPIO pins after flashing?

Open the OpenBeken Web Application, choose Import, paste the device JSON into field 1, review the generated commands in field 2, then press apply script.
  1. Copy a JSON template from the OpenBeken list or Cloudcutter.
  2. Paste it into the Import tab.
  3. Apply the generated script after checking it.
This configures GPIO roles and channels after firmware flashing. [#20551972]

Where can I find OpenBeken and Tuya Cloudcutter templates for BK7231, BK7231T, BK7231N, XR809, W600, W800, and BL602 devices?

Find templates in the OpenBeken device list or the Tuya Cloudcutter devices repository. The thread lists BK7231, BK7231T, BK7231N, XR809, W600, W800, BL602, and other WiFi devices. OpenBeken pages can include teardown guides, images, keywords, and discussion links. Cloudcutter profiles can also provide Tuya configuration data for import. [#20551972]

What is a Tuya Cloudcutter profile and how is it used with OpenBeken?

A Tuya Cloudcutter profile is a JSON device profile that stores Tuya metadata, schemas, and device_configuration values for a supported device. OpenBeken can convert that Tuya JSON into OBK GPIO configuration commands. It works as a quick start for basic devices, especially relays and buttons. TuyaMCU devices still need a different workflow. [#20551972]

What is the difference between an OpenBeken template and a Tuya Cloudcutter device_configuration JSON?

An OpenBeken template has a direct pins array, while Cloudcutter stores GPIO data inside Tuya device_configuration. The OpenBeken example maps P26 as Rel;2. The Cloudcutter example maps relay pins through keys like rl4_pin: 26 and button pins through total_bt_pin: 24. OpenBeken templates are usually more complete because users create them for OBK. [#20551972]

How do GPIO roles and channels work in an OpenBeken template, such as Rel;2 or WiFi_LED_n;1?

GPIO roles define the pin function, and channels group related functions. Rel;2 means a relay on channel 2, such as P26 in the sample template. Channels pair relays with buttons and order PWM outputs for RGB devices. WiFi_LED_n;1 assigns an inverted WiFi LED role to channel 1. [#20551972]

How can I create a Tuya user_param_key.json or Cloudcutter profile from a 2MB device binary dump?

Use the BK7231 GUI Flash Tool to take a 2 MB device binary dump, then process it with the Cloudcutter profile-building tool. The thread says this advanced workflow can generate user_param_key.json containing the Tuya JSON configuration. That file can then help create a Cloudcutter profile or seed OpenBeken GPIO import. [#20551972]

What does the OpenBeken Web Application Import tab do with pasted JSON templates?

The Import tab converts pasted JSON into OpenBeken commands and checks both fields for errors. It accepts multiple JSON formats, including OpenBeken templates and Cloudcutter-style Tuya configs. Invalid JSON shows an import error. Manual command typos can still fail during script execution after conversion. [#20551972]

Why does importing a JSON template in OpenBeken erase autoexec.bat, and how should I back it up first?

JSON import can erase autoexec.bat because the generated process may format LittleFS. Before importing, open the web app filesystem tab, click List Filesystem, then use Download Tar of FS if files exist. The warning applied to OBK build 1.17.29 on 2023-04-23. [#20552290]

How can I prevent OpenBeken template import from formatting LittleFS or deleting existing files?

Remove lfs_format from the generated script before applying it. The second import column may include that command automatically. Editing it out keeps the template commands while avoiding filesystem formatting. Check the script before pressing the large apply script button. [#20552305]

Why do commands like delay_s, waitFor MQTTState 1, or waitFor NTPState 1 fail in the OpenBeken template importer?

They fail because the template importer is not the autoexec.bat runner. The importer expects template JSON or generated template commands, not startup automation commands. Put delay_s 1, waitFor MQTTState 1, or waitFor NTPState 1 in autoexec.bat inside LittleFS instead. [#21297848]

How do I create and run an autoexec.bat file in OpenBeken LittleFS?

Create autoexec.bat in LittleFS and place OpenBeken startup commands inside it. For example, write delay_s 1 on one line and waitFor MQTTState 1 on the next line. The thread specifically separates this from the template importer. Use the filesystem area of the web app for LittleFS file handling. [#21297848]

What should I do when there is no OpenBeken or Tuya Cloudcutter template for my smart plug, power strip, or LED device?

Search similar devices first, then identify pins manually if no template exists. The thread suggests comparing OpenBeken and Cloudcutter lists, opening the device, and tracing pins with a multimeter. You can also brute-force candidate GPIOs by assigning relay or PWM roles and testing behavior. Ask on the forum when the device still resists mapping. [#20551972]

How can I manually find relay, button, LED, and PWM pins on a BK7231 device using brute force or a multimeter?

Assign the first 5 candidate pins as Relay on channel 1, save, then toggle them. If a relay moves, narrow that group. If none moves, test another set of pins. For LEDs, relay mode can force PWM to 0% or 100%. BK7231 PWM choices listed are P6, P7, P8, P9, P26, and P24. [#20551972]

What are TuyaMCU devices, and why do they need a different OpenBeken configuration approach?

TuyaMCU devices are smart devices where the WiFi module communicates with a separate MCU using the TuyaMCU protocol. The MCU handles processing, so GPIO import alone may not expose every function. The thread points users to a TuyaMCU analyzer tool for this protocol-based configuration path. [#20551972]

How does the OpenBeken web app import Tuya configuration directly from a 2MB firmware dump?

The web app can extract Tuya configuration from a 2 MB firmware dump and feed it into the template importer. This feature appeared in the thread on 2026-01-24, with a request for testing. A tester reported that it worked at first glance, with more testing planned. [#21818501]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT