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.
https://www.nerdiy.de/sicherheitshinweise/

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, Nerdiy.de 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 Nerdiy.de in being able to offer other useful projects in the future. 🙂 


Requirements

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“ schaltet dann zum Beispiel das Relais mit dem Index „1“,
„POWER2 ON“ das Relais mit dem Index „2“, usw.

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

Nun kommen Wir zu der eigentlichen Einstellung der Nachlauf-Funktion. Dazu gibt es in der Tasmota-Firmware den Befehl „PulseTime“. Mit diesem lässt sich die Nachlaufzeit des angeschlossenen Relais einstellen.

Die Zeitdauer die das Relais eingeschaltet bleibt lässt sich dazu in zwei Verschiedenen „Auflösungen“ einstellen.

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.
Will man also eine PulseTime von 5,6 Sekunden Einstellen so muss man den Befehl „PulseTime 56“ an die Tasmota-Firmware senden.
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.
Dazu muss zu der gewünschten Zeit lediglich 100 hinzuaddiert werden. Will man also eine PulseTime von 100 Sekunden Einstellen so muss man den Befehl „PulseTime 200“ an die Tasmota-Firmware senden.

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:

PulseTime

Deactivate PulseTime:

PulseTime 0

Further information

https://github.com/arendst/Sonoff-Tasmota/wiki/Commands

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 ko-fi.com       

9 comments

  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
      Fabian

  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
      Fabian

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.