Creating a Countdown-Clock in HabPanel

Hello,
im am searching and searching, but can’t find.
I want to realize a Countdown-Clock in the Habpanel, where i can set a number of minutes, press start and the countdown beginns to run down to 00:00 (an give an alarm then). Exists there anything like that ?

Thanks for help.

Google

Hello,

ok that’s clear. But is it possible to set the value (how much seconds) somehow in the gui? An edit field or a combobox with selectable values would also be ok.
An example:
I open at night the window to refresh the air and go to bed. To not forget to close the window, I would like to set a timer to 5min or 10min. After that a rule should be started to close the window.
What would be the best way to do that?

Thanks a lot.

Yes, it works. I use this to open my shutters at different times!

Here is my example:

Selection item=RL_Time_Set label="Rolladen öffnen um:" icon="rolladen_szene" mappings=[
          0.0="  Aus  ",
          1.0="  06:00 Uhr  ",
          2.0="  06:15 Uhr  ",
          4.0="  06:30 Uhr  ",
          5.0="  06:45 Uhr  ",
          6.0="  07:00 Uhr  ",
          7.0="  07:15 Uhr  ",
          8.0="  07:30 Uhr  ",
          9.0="  07:45 Uhr  ",
          10.0="  08:00 Uhr  ",
          11.0="  08:15 Uhr  ",
          12.0="  08:30 Uhr  ",
          13.0="  08:45 Uhr  ",
          14.0="  09:00 Uhr  ",
          15.0="  09:15 Uhr  ",
          16.0="  09:30 Uhr  ",
          17.0="  09:45 Uhr  ",
          18.0="  10:00 Uhr  ",
          19.0="  10:15 Uhr  ",
          20.0="  10:30 Uhr  ",
          21.0="  10:45 Uhr  ",
          22.0="  11:00 Uhr  ",
          23.0="  11:15 Uhr  ",
          24.0="  11:30 Uhr  ",
          25.0="  11:45 Uhr  ",
          26.0="  12:00 Uhr  ",
          27.0="  12:15 Uhr  ",
          28.0="  12:30 Uhr  ",
          29.0="  12:45 Uhr  ",
          30.0="  13:00 Uhr  ",
          31.0="  13:15 Uhr  ",
          32.0="  13:30 Uhr  ",
          33.0="  13:45 Uhr  ",
          34.0="  14:00 Uhr  ",
          35.0="  14:15 Uhr  ",
          36.0="  14:30 Uhr  ",
          37.0="  14:45 Uhr  ",
          38.0="  15:00 Uhr  ",
          39.0="  15:15 Uhr  ",
          40.0="  15:30 Uhr  ",
          41.0="  15:45 Uhr  ",
          42.0="  16:00 Uhr  ",
          43.0="  16:15 Uhr  ",
          44.0="  16:30 Uhr  ",
          45.0="  16:45 Uhr  ",
          46.0="  17:00 Uhr  ",
          47.0="  17:15 Uhr  ",
          48.0="  17:30 Uhr  ",
          49.0="  17:45 Uhr  ",
          50.0="  18:00 Uhr  "]
      }

RL_Time_Set is a Number Item.

and here the rule:

rule "Rolladen Zeit in Stunden und Minuten an Items übergeben"
when
    Item RL_Time_Set changed
then
    switch (RL_Time_Set.state){
        case 0.0:{RL_Time_Set_Stunde.postUpdate(90.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 1.0:{RL_Time_Set_Stunde.postUpdate(6.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 2.0:{RL_Time_Set_Stunde.postUpdate(6.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 3.0:{RL_Time_Set_Stunde.postUpdate(6.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 4.0:{RL_Time_Set_Stunde.postUpdate(6.0) RL_Time_Set_Minute.postUpdate(6.0)}
        case 5.0:{RL_Time_Set_Stunde.postUpdate(45.0) RL_Time_Set_Minute.postUpdate(6.0)}
        case 6.0:{RL_Time_Set_Stunde.postUpdate(7.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 7.0:{RL_Time_Set_Stunde.postUpdate(7.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 8.0:{RL_Time_Set_Stunde.postUpdate(7.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 9.0:{RL_Time_Set_Stunde.postUpdate(7.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 10.0:{RL_Time_Set_Stunde.postUpdate(8.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 11.0:{RL_Time_Set_Stunde.postUpdate(8.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 12.0:{RL_Time_Set_Stunde.postUpdate(8.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 13.0:{RL_Time_Set_Stunde.postUpdate(8.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 14.0:{RL_Time_Set_Stunde.postUpdate(9.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 15.0:{RL_Time_Set_Stunde.postUpdate(9.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 16.0:{RL_Time_Set_Stunde.postUpdate(9.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 17.0:{RL_Time_Set_Stunde.postUpdate(9.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 18.0:{RL_Time_Set_Stunde.postUpdate(10.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 19.0:{RL_Time_Set_Stunde.postUpdate(10.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 20.0:{RL_Time_Set_Stunde.postUpdate(10.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 21.0:{RL_Time_Set_Stunde.postUpdate(10.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 22.0:{RL_Time_Set_Stunde.postUpdate(11.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 23.0:{RL_Time_Set_Stunde.postUpdate(11.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 24.0:{RL_Time_Set_Stunde.postUpdate(11.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 25.0:{RL_Time_Set_Stunde.postUpdate(11.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 26.0:{RL_Time_Set_Stunde.postUpdate(12.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 27.0:{RL_Time_Set_Stunde.postUpdate(12.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 28.0:{RL_Time_Set_Stunde.postUpdate(12.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 29.0:{RL_Time_Set_Stunde.postUpdate(12.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 30.0:{RL_Time_Set_Stunde.postUpdate(13.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 31.0:{RL_Time_Set_Stunde.postUpdate(13.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 32.0:{RL_Time_Set_Stunde.postUpdate(13.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 33.0:{RL_Time_Set_Stunde.postUpdate(13.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 34.0:{RL_Time_Set_Stunde.postUpdate(14.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 35.0:{RL_Time_Set_Stunde.postUpdate(14.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 36.0:{RL_Time_Set_Stunde.postUpdate(14.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 37.0:{RL_Time_Set_Stunde.postUpdate(14.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 38.0:{RL_Time_Set_Stunde.postUpdate(15.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 39.0:{RL_Time_Set_Stunde.postUpdate(15.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 40.0:{RL_Time_Set_Stunde.postUpdate(15.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 41.0:{RL_Time_Set_Stunde.postUpdate(15.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 42.0:{RL_Time_Set_Stunde.postUpdate(16.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 43.0:{RL_Time_Set_Stunde.postUpdate(16.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 44.0:{RL_Time_Set_Stunde.postUpdate(16.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 45.0:{RL_Time_Set_Stunde.postUpdate(16.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 46.0:{RL_Time_Set_Stunde.postUpdate(17.0) RL_Time_Set_Minute.postUpdate(0.0)}
        case 47.0:{RL_Time_Set_Stunde.postUpdate(17.0) RL_Time_Set_Minute.postUpdate(15.0)}
        case 48.0:{RL_Time_Set_Stunde.postUpdate(17.0) RL_Time_Set_Minute.postUpdate(30.0)}
        case 49.0:{RL_Time_Set_Stunde.postUpdate(17.0) RL_Time_Set_Minute.postUpdate(45.0)}
        case 50.0:{RL_Time_Set_Stunde.postUpdate(18.0) RL_Time_Set_Minute.postUpdate(0.0)}
    }
end

1 Like

I am asking again (cause i did not find any solution).
I want to show a countdown clock on the habpanel (display from alexa timer, i get the end time, so i can calculate the countdown). but how?? Thanks!

Did you found any solution for your countdown clock? I would like to have that function in my kitchen habpanel.

1 Like