Profile based on WiFi signal strength

2,399 views
Skip to first unread message

yoniy0

unread,
Mar 2, 2012, 6:43:59 PM3/2/12
to tas...@googlegroups.com
My phone usually takes some time to realize it when I leave an area with WiFi coverage. Between buildings in my university or at some corners of some friends' apartment, it will remain 'connected' (with signal strength 1-2), but actual internet connection is very unreliable at those levels. Hence, I'm considering ways in which I could use Tasker to force WiFi disconnection in these situations.

Now, extracting WiFi signal strength from %WIFII is a simple matter of variable splitting. Still, I can't think of any way to use that value as a context, i.e., to monitor it and launch a profile based on changes in it. The best I can come up with is to periodically measure it when I'm connected to WiFi, but I suspect such a profile might have a negative effect on my battery life.

Any advice?

Pent

unread,
Mar 3, 2012, 3:50:15 AM3/3/12
to Tasker

> The best I can come up with is to periodically measure it when I'm
> connected to WiFi, but I suspect such a profile might have a negative
> effect on my battery life.

If you limit it also to when the screen is on, the power usage for a
check every
15 seconds won't be noticeable.

Pent

yoniy0

unread,
Mar 3, 2012, 7:35:46 AM3/3/12
to tas...@googlegroups.com
Cool, thanks. Didn't think of that :-)

Rob

unread,
Mar 3, 2012, 4:28:38 PM3/3/12
to Tasker
Post your profile if you get it working!

yoniy0

unread,
Mar 10, 2012, 12:29:32 AM3/10/12
to tas...@googlegroups.com
Okay, this seems to work to my liking, and while I think it did affect my battery life, it didn't do so in a meaningful way:
Profile: Low WiFi (1)
    Event: Display Unlocked
Enter: WiFi (2)

Task: WiFi Sig (1)
    A1: Variable Set [ Name:%wfs To:%WIFII Do Maths:Off Append:Off ]
    A2: Variable Split [ Name:%wfs Splitter:Sig: Delete Base:Off ]
    A3: Variable Clear [ Name:%wfs1 Pattern Matching:Off ]
    A4: Variable Split [ Name:%wfs2 Splitter: Delete Base:On ]
    A5: Variable Set [ Name:%WIFISG To:%wfs22 Do Maths:Off Append:Off ]
    A6: Array Clear [ Name:%wfs2 ]

Task: WiFi (2)
    A1: Write File [ File:wifitest.txt Text:Task start: %DATE %TIME Append:On ]
    <Signal check>
    A2: Wait [ MS:0 Seconds:15 Minutes:0 Hours:0 Days:0 ]
    A3: Goto [ Type:Action Label Number:1 Label:End ] If [ %SCREEN ~ off ]
    A4: Goto [ Type:Action Label Number:1 Label:End ] If [ %WIFII !~ *CONNECTION* ]
    A5: Perform Task [ Name:WiFi Sig Stop:Off Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]
    A6: If [ %WIFISG < 3 ]
    A7: WiFi [ Set:Off ]
    A8: Wait [ MS:0 Seconds:0 Minutes:5 Hours:0 Days:0 ]
    A9: WiFi [ Set:On ]
    A10: End If
    A11: Goto [ Type:Action Label Number:1 Label:Signal check ]
    <End>
    A12: Write File [ File:wifitest.txt Text:Task end: %DATE %TIME Append:On ]
Reply all
Reply to author
Forward
0 new messages