A way to get a start timer using stop timers

I am new to HA and Node-Red and was trying to come up with a way to have a “start timer” using a button to start something for 5 seconds AND also has a switch to turn something on or off without any timing function. This is what I came up with in case someone wants to incorporate such function without getting into these yaml files, my yaml skills is non existent ATM.

The “start” timer has a timer of 1MS and the 2nd payload is “ON”. It has a link to mqtt to send the “ON” message on to ESP32.

The “Stop” timer has a timer of 5.1 seconds and the 2nd payload is “OFF”. It has a link to the switch and to mqtt to send the “OFF” payload to the ESP32. Without the link to the switch, the switch will remain “ON” while the ESP32 is actually “OFF”

The ramifications of a 1ms delay to me is nil but may be significant for your project.

I hope the snip comes through for visual reference.

Eric
.
Capturetime