Preface
This is an extension to http://tasker.wikidot.com/bluedock So I assume that this is set up and working. You need actions for Connect AND Disconnect.
Goal
I don't wear my bluetooth headset in front of my face - so I regularly miss it's led telling me that the headset's battery is running low.
Since battery usage is fairly linear for a headset I use Tasker to count the minutes it's been in use. This will be handled by the two tasks that start and stop playback anyway.
A new profile based on a Variable Context will alert you once it's time to charge the headset. Another profile will reset the variable once you've loaded the battery.
Todo
Connect task:
- Variable Set, %BT_HEADSET_START, %TIME
That was easy, wasn't it? The next one will be more complicated.
Disconnect task:
- Variable Split, %BT_HEADSET_START, Splitter: ., If %BT_HEADSET_START > 0
- Variable Split, %TIME, Splitter: ., If %BT_HEADSET_START > 0
- Variable Set, %TIME1, %TIME1 * 60, If %BT_HEADSET_START > 0
- Variable Set, %TIME1, %TIME1 + %TIME2, If %BT_HEADSET_START > 0
- Variable Set, %BT_HEADSET_START1, %BT_HEADSET_START1 * 60, If %BT_HEADSET_START > 0
- Variable Set, %BT_HEADSET_START1, %BT_HEADSET_START1 + %BT_HEADSET_START2, If %BT_HEADSET_START > 0
- Variable Set, %BT_HEADSET_UPTIME, %BT_HEADSET_UPTIME + %TIME1 - %BT_HEADSET_START1, If %BT_HEADSET_START > 0
- Variable Clear, %BT_HEADSET_START
The frist profile will be easy again.
Context: Variable Value, %BT_HEADSET_UPTIME, Marths: Greater Than, Value <minutes-your-headset-battery-will-last>
Task: Alert -> Notifiy, Title: Headset, Text "Please load the battery!"…choose a nice icon, like the orange triangle
The second profile is easy, too.
Context: Event -> Misc -> Notification Click
Task: Variable Clear, %BT_HEADSET_UPTIME