Dashboard - Countdown Timer

Hi. I want to add a countdown timer to my dashboard UI. I am going to use it as an alarm, using a buzzer connected to a GPIO pin on the Pi. The user must have fixed, different times. Imagine a dropdown with options of 15, 30, 45, and 60 minutes. Then, the user will click on the Alarm switch.

The problem is, I put the dropdown first, then the switch, and a text output to the end, but I am not able to carry the value from the dropdown to the text output. If I could do that, I could use a switch (not the button one, the one which can be used as if-else) to get the value and make it countdown according to the value. I don't know how to get that value from the dropdown, and how to make it count in seconds. Never written a js code before, and timers I found were complex. So, I decided to do it this way. Lastly, the 2nd press on the alarm switch will set it back to the default value.

I am open to any advice or help. Specially, if you think there is a better option than dropdown in terms of cool looks, while still being easy to use.

take a look at node-red-contrib-mytimeout

Do you mean a dropdown:
Screen Shot 2020-07-13 at 7.12.35 AM

Yes, I meant dropdown. Edited it. Thanks.

I'll take a look at that. Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.