HowTo: Tasmota - Configure automatic output shutdown

Automatically deactivating relays are familiar from stairwells, for example. 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 you can activate and use this function on a Tasmota device is explained in the following article.

Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.

Affiliate links/advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support in being able to offer other useful projects in the future. 🙂 


Helpful articles:

Before you can use this function, you should have installed your Tasmota device and configured it so that you can access it via your wifi. How to do this is described in the following articles.

Required tool:
- none

Required material:

Activate SetOption26 (display of relay indices).

Some functions are somewhat cryptically hidden in the Tasmota firmware. This also includes the function that the relay indices are displayed.

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

“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 get confusing especially when you switch between different Tasmota devices. It is therefore recommended to activate this function by default.
This can be done with the following command:

SetOption26 1

Set PulseTime

Now we come to the actual setting of the overrun function. There is the “PulseTime” command in the Tasmota firmware for this purpose. This can be used to set the follow-up time of the connected relay.

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

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

In the range 0.1 to 11.1 seconds, the PulseTime can be set with a resolution of 0.1 seconds.
For this purpose, 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 multiply the desired time by ten and pass it on with the command.

Further examples for the range 0.1 to 11.1:

Hold time of 3.7 seconds:

PulseTime 37

Hold time of 4.2 seconds:

PulseTime 42

Hold time of 9.6 seconds:

PulseTime 96

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

The PulseTime of the Tasmota firmware can be set in the range from 12 to 64788 seconds with a resolution of one second.
All you have to do is add 100 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:

Hold time of 37 seconds:

PulseTime 137

Hold time of 42 seconds:

PulseTime 142

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

PulseTime 3700

Query the current setting:


Deactivate PulseTime:

PulseTime 0

Further information

Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS 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 think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

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,
      The only option that comes to mind is the Tasmota “rules” option. This can also be used to define “more complex” actions. That means you would have to put together a few rules. Have you ever looked at this?
      Best regards

Kommentar hinterlassen

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.