Configuration Procedure for New Devices - FengtianGu/Sonoff-Tasmota GitHub Wiki

If your device is not a built-in module listed in the module configuration menu, a user contributed device template (explanation) may be available. Otherwise, follow this procedure for configuring the ESP chip pins used by your device.

Some smart devices have additional functionality which may be handled by codes sent to a separate MCU in the device. Devices with functions offloaded to a separate MCU require additional coding in the software or via rules. Certain supported Tasmota BASE devices have built-in code to handle MCU controlled devices. Using a template with an appropriate BASE device may have the programming logic required to manage the MCU commands for your device. If an existing BASE device with the logic for your device is not available, a modified device driver will be required. This case is outside of the scope of this article.

If your device is similar to the existing built-in module (e.g., a particular MCU or power monitoring algorithm) it is best to use that as a starting point. When you are not sure which module is suitable for your device, use Generic module (18). Once you have selected the module type and saved the configuration, return to the module type configuration dialog.

  1. Assign every available GPIO (excluding, at first, "dedicated" GPIO such as Tx/Rx & GPIO0/GPIO2, etc.) to one of the Relay<x> relays.

    a. Save the configuration. Once the device reboots, use the web GUI virtual buttons to find which of the buttons assigned to GPIO actually control relays and LEDs on the device.

    • If you are unable to control some of the relays or LEDs on the device, they may be attached to the "dedicated" GPIO. Assign those GPIO to an unused Relay<x> and repeat step 1a.

    b. Once you have found which GPIO control which relays and LEDs, set these "active" GPIO to associate them with the corresponding Relay<x> or LED<x>. Proper operation may dictate the use regular or inverted (Relay<x>i/LED<x>i) settings.

    c. Currently, Tasmota only supports up two GPIO configured as LEDs to indicate relay state and connectivity status. If only one LED is configured it will act as both the Wi-Fi/MQTT status LED (see SetOption31) and/or the LED that indicates relay power (see LedState/LedMask). If two LEDs are defined, LED1 will act as the Wi-Fi/MQTT status LED and LED2 will act as the LED that indicates relay power.

  2. Now, assign every remaining GPIO (excluding, once again, remaining "dedicated" like Tx/Rx & GPIO0/GPIO2, etc.) to Switches.

    a. Save the configuration. Once the device reboots, use the web GUI Console to run the Status 8 (sensors) command. This will display the current state of each GPIO.

    b. Then, while pressing each button, display Status 8 again. Whichever GPIO changes state from what was shown in step 2a is the GPIO connected to the button.

    • If none of the GPIO change state, then assign the "dedicated" GPIO and retry step 2a.

    c. Once you have found which GPIO are connected to each button, change the GPIO setting in the configuration to a Button<x>. You may need to determine whether the internal pull-up is used or not. If so, select Button<x>_n_. n indicates no pull-up or normally-closed.

  3. Once you have determined which pins your device uses, set any remaining pins to None.

    • Save the configuration.
  4. Once the device reboots, your device hardware is configured for use.

  5. Since you have now configured a device not previously known to the TASMOTA user base, you may want to export the template and contribute it to the templates database.

View this Digiblur DIY video for a tutorial on this procedure.