diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 3fc2c72..5a59473 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -12863,7 +12863,7 @@
 </phrase>
 <phrase>
   id: LANG_SLEEP_TIMER_DURATION
-  desc: default sleep timer duration in minutes
+  desc: default sleep timer duration in minutes (unused in UI)
   user: core
   <source>
     *: "Default Sleep Timer Duration"
@@ -12889,3 +12889,17 @@
     *: "Start Sleep Timer On Boot"
   </voice>
 </phrase>
+<phrase>
+  id: LANG_SLEEP_TIMER_CANCEL_CURRENT
+  desc: shown instead of sleep timer when it's running
+  user: core
+  <source>
+    *: "Cancel Sleep Timer"
+  </source>
+  <dest>
+    *: "Cancel Sleep Timer"
+  </dest>
+  <voice>
+    *: "Cancel Sleep Timer"
+  </voice>
+</phrase>
diff --git a/apps/menu.h b/apps/menu.h
index b5bab90..2251de2 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -198,7 +198,7 @@
     static const struct menu_get_name_and_icon name##_                      \
         = {callback,text_callback,voice_callback,text_cb_data,icon};        \
     static const struct menu_func name##__ = {{(void*)func}, param};           \
-    static const struct menu_item_ex name   =                                  \
+    const struct menu_item_ex name   =                                  \
         { MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags,                            \
          { .function = & name##__}, {.menu_get_name_and_icon = & name##_}};
 
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 66d49a9..602becd 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -419,21 +419,71 @@
 
 static int sleep_timer(void)
 {
-    int minutes = get_sleep_timer() ? 0 : global_settings.sleeptimer_duration;
-    return (int)set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes,
-                   &sleep_timer_set, 5, 0, 300, sleep_timer_formatter);
+    int minutes = global_settings.sleeptimer_duration;
+    if (get_sleep_timer())
+        sleep_timer_set(0);
+    else
+        set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes,
+                   &sleep_timer_set, 5, 0, 300, sleep_timer_formatter); 
+    return 0;
 }
 
+static int seconds_to_min(int secs)
+{
+    int min = secs / 60;
+    if ((secs % 60) > 50) /* round up for 50+ seconds */
+        min++;
+
+    return min;
+}
+
+static char* sleep_timer_getname(int selected_item, void * data, char *buffer)
+{
+    (void)selected_item;
+    (void)data;
+    (void)buffer;
+    int sec = get_sleep_timer();
+    char timer_buf[10];
+    /* we have no sprintf, so MAX_PATH is a guess */
+    if (sec > 0)
+    {   /* show cancel and countdown if running */
+        snprintf(buffer, MAX_PATH, "%s (%s)", str(LANG_SLEEP_TIMER_CANCEL_CURRENT),
+                sleep_timer_formatter(timer_buf, sizeof(timer_buf), seconds_to_min(sec), NULL));
+    }
+    else
+        snprintf(buffer, MAX_PATH, "%s", str(LANG_SLEEP_TIMER));
+
+    return buffer;
+}
+
+static int sleep_timer_voice(int selected_item, void*data)
+{
+    (void)selected_item;
+    (void)data;
+    int seconds = get_sleep_timer();
+    if (seconds > 0)
+    {
+        long talk_ids[] = {
+            LANG_SLEEP_TIMER_CANCEL_CURRENT,
+            VOICE_PAUSE,
+            seconds_to_min(seconds) | UNIT_MIN << UNIT_SHIFT,
+            TALK_FINAL_ID
+        };
+        talk_idarray(talk_ids, true);
+    }
+    else
+        talk_id(LANG_SLEEP_TIMER, true);
+    return 0;
+}
 
 #if CONFIG_RTC
 int time_screen(void* ignored);
 MENUITEM_FUNCTION(timedate_item, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_TIME_MENU),
                     time_screen, NULL,  NULL, Icon_Menu_setting );
 #endif
-/* Sleep timer items are in the time/date screen if there is a RTC */
-MENUITEM_FUNCTION(sleep_timer_call, 0, ID2P(LANG_SLEEP_TIMER), sleep_timer,
-                    NULL, NULL, Icon_Menu_setting); /* make it look like a 
-                                                       setting to the user */
+MENUITEM_FUNCTION_DYNTEXT(sleep_timer_call, 0, sleep_timer, NULL, sleep_timer_getname,
+                          sleep_timer_voice, NULL, NULL, Icon_Menu_setting);
+                           /* make it look like a setting to the user */
 #if CONFIG_RTC == 0
 MENUITEM_SETTING(sleeptimer_on_startup,
                  &global_settings.sleeptimer_on_startup, NULL);
