Bluetooth Countdown Alarm Widget with Tasker


  1. james899

    james899 Member

    I'm trying to do this:

    When a bluetooth device connects I need a countdown timer to start for a preset time (e.g. 20 mins). The remaining time should be shown decreasing on a 1x1 widget (showing the seconds, as well as minutes remaining is preferable). When the countdown finishes I need an audible alarm with popup button to snooze or dismiss it.

    If the bluetooth connection is dropped before the countdown ends, the countdown should be dismissed (until a bt connection is made again at which point it should begin a new countdown).

    It would be even better if the preset time could be a random figure within a set range e.g. between 30 mins to 70 mins.

    UPDATE: Here's a basic summary of how I did most of this:

    Create a profile with state bluetooth connected. Then create a task (e.g. Let's call it "Bt Alarm")

    For

    Variable %mins Items 20:1

    Set Widget Label
    Name Alarm Widget Label %mins

    Wait
    Minutes 1

    End For

    Perform Task
    Bt Alarm 2

    You need to create a task widget on your homescreen with the name "Alarm Widget" which points to this task called "Bt Alarm". This sets up a loop which will run for 20 times, each time, reducing the variable %mins by 1, and by re-setting the label of the widget each loop, the widget label effectively becomes a countdown widget. When the countdown is up, it performs the task "Bt Alarm 2" which is:

    Music Play
    File:
    Popup Task Buttons:
    Bluetooth Snooze
    Bluetooth Cancel


    Bluetooth Snooze:
    Music Stop
    Set Widget Label Alarm Widget Label: Snooze
    Wait Minutes 5
    Perform Task: Bt Alarm 2

    Bluetooth Cancel:
    Music Stop
    Stop Task: Bluetooth Snooze
    Set Widget Label: Alarm Widget Label: Off.

    To cancel when bluetooth disconnects before the alarm goes off:
    Create a profile for bluetooth Not connected (i.e. Inverted Bluetooth connected). Then:
    Stop Task: Bt Alarm 2
    Stop Task: Bluetooth Snooze
    Stop Task: Bt Alarm
    Set Widget Label: Alarm Widget Label Off.

    It might not be beautifully written but it works for me. Reply, if I haven't explained well enough.

    Advertisement
    :
  2. bberryhill0

    bberryhill0 Well-Known Member

    Would this project be useful to any one else? A description of why you would use this would be helpful.
  3. Bearcats

    Bearcats Well-Known Member

    It is to me. As I want to disable WiFi enable mobile data when BT connects because that means I am in my car.

    I just found Tasker and its forums today and I think this functionality might just make me jump now to get my new phone versus waiting until after thanksgiving! LOL! :D
  4. SUroot

    SUroot Well-Known Member Developer

    Wouldn't setting wifi off when not connected yo your home ssid do that?
Loading...

Share This Page