HowTo: Tasmota - Configure automatic switch-off of the output

Automatically dropping relays are known, for example, from the stairwell. The light is switched on by pressing a button. Without having to press the button again, the light is automatically switched off again after a certain time.

How to enable and use this feature on a Tasmota device is explained in the following article.

Hints for our lovely english readers: Basically, many of the articles on are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂

Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance.

Affiliate links / advertising links

The links to online stores listed here are so-called affiliate links. If you click on such an affiliate link and store via this link, receives a commission from the online store or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support in being able to offer further useful projects in the future. 🙂


Helpful Articles:
Before you can use this feature, you should have your Tasmota device installed and configured so that you have access to it via your Wifi. How to do this is described in the following articles.
Tasmota - firmware flashing

Required tools:

Required material:

In the following list you will find all the parts you need to implement this article.

Activate SetOption26 (display of relay indices)

In the Tasmota firmware, some functions are somewhat cryptically hidden. Likewise the function that the relay indices are displayed.

If you use several relays in your Tasmota device (such as the Sonoff 4CH), each relay gets its own consecutive number (index).
If you want to switch a relay then you can specify these relays unambiguously.

"POWER1 ON" then switches, for example, the relay with the index "1",
"POWER2 ON" the relay with index "2", etc.

By default, the Tasmota firmware assumes that only one relay is connected. As a result, the display of the relay indices is deactivated. This can be confusing when you switch between different Tasmota devices. Therefore, it is recommended to enable this feature by default.
This is done with the following command:

SetOption26 1

Set PulseTime

Now we come to the actual setting of the delay function. For this there is the command "PulseTime" in the Tasmota firmware. This can be used to set the delay time of the connected relay.

The length of the time the relay remains switched on can be set in two different "resolutions".

Setting PulseTime in the range of 0.1 to 11.1 seconds (resolution 0.1s):

In the range of 0.1 to 11.1 seconds, the PulseTime can be set with a resolution of 0.1 seconds.
For this, the values from 0.1 to 11.1 are represented by the values from 1 to 111.
So if you want to set a PulseTime of 5.6 seconds you have to send the command "PulseTime 56" to the Tasmota firmware.
In order to get the right value for the command you have to take the desired time mulitplied by ten and pass it with the command.

Further examples for the range 0.1 to 11.1:

Delay time of 3.7 seconds:

PulseTime 37

Delay time of 4.2 seconds:

PulseTime 42

Delay time of 9.6 seconds:

PulseTime 96

Setting PulseTime in the range 12 to 64788 seconds (resolution 1s):

In the range of 12 to 64788 seconds, the PulseTime of the Tasmota firmware can be set with a resolution of one second.
For this purpose, only 100 must be added to the desired time. So if you want to set a PulseTime of 100 seconds you have to send the command "PulseTime 200" to the Tasmota firmware.

Further examples for the range 12 to 64788 seconds:

Delay time of 37 seconds:

PulseTime 137

Delay time of 42 seconds:

PulseTime 142

Delay time of one hour = 60x60s = 3600seconds:

PulseTime 3700

Query the current setting:


Disable PulseTime:

PulseTime 0

Additional information

Have fun with the project

I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate that I share this information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at   


  1. Hi Fab,
    as I understand the PulseTime it starts running when a switch/relay is turned on. In your example it would be best practice when the fan is running a certain time after the light is switched off. Meaning the command starting the PulseTime should be the OFF command. And the actual switching OFF should be delayed to keep the fan running some let's say 3 minutes. And that's actually what I need. When I send the OFF command it should stay on for a given time and then switch off after timer automatically. Is there a way or do I not get the Point ? Greetings Matthias

  2. Hello Fab,

    Newbie question: For an inching relay, what is the module and template used for esp-01 + 1 channel relay?
    And what are the GPIO pins assigned to (button/ switch/ relay?)

    Thank you

    1. Hi Ross,
      can you give me some more details about your hardware? It sounds like you build a something custom made, is that correct? 🙂
      Best regards

  3. Hello,
    I would like to use my Sonoff Mini (flashed with tasmota) as a timer for the circulation pump. By schedule the pump should run from 6 to 9 from 12 to 14 and from 18 to 23 clock. With PulseTime I want to run the pump for 5min via the app when I have need outside the time control. The timer works. But if I activate PulseTime, the pump is also switched off during the time control after the set time. How can I implement the circuit?

    Thank you very much.

    LG Nico

    1. Hi Nico,
      so adhoc I can only think of the option about the "rules" of Tasmota. With this you can also define "more complex" actions. That means you would have to build a few rules. Did you have a look at that before?
      Best regards

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert