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 Nerdiy.de 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. 🙂
- 1 Safety instructions
- 2 Affiliate links / advertising links
- 3 Requirements
- 4 Activate SetOption26 (display of relay indices)
- 5 Set PulseTime
- 6 Additional information
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. https://www.nerdiy.de/en/sicherheitshinweise/
The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and shop via this link, Nerdiy.de receives a commission from the online shop or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂
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
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:
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:
Delay time of 4.2 seconds:
Delay time of 9,6 seconds:
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:
Delay time of 42 seconds:
Delay time of one hour = 60x60s = 3600seconds:
Query the current setting:
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 it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂