Context: "or" condition / new built-in variable %CONNECTIVITY

654 views
Skip to first unread message

TS

unread,
Mar 21, 2011, 10:05:40 AM3/21/11
to Tasker
Hi,

I have been looking around for quite some time now, but couldn't find
any solution.

Is there a possibility to have a context with two conditions linked
with "OR" ?

The reason is that I want a variable %INTERNET to be 1 if there's any
internet connection (eg either Wifi Connection or Mobile Data), and
based on this I trigger a sync of NewsRob.
However, as I am using JuiceDefender to enable connectivity once in an
hour, there's always a short period during which Mobile Data gets
enabled, but is then instantly disabled as Wifi gets connected. This
leads to %INTERNET being set to 1 and 0 and 1 again and therefore
triggers the exit task of the NR sync profile (which is a cancel of
the sync).

I have elaborated a quite complicated solution in order to avoid this,
but the task would be much easier if two things were possible with
Tasker:

- have a built-in variable called %CONNECTIVITY which is set to 1 if
there's any internet connection available (no matter if Wifi or mobile
data)

- be able to link conditions for the context with "OR" instead of
"AND"

Either of them would work, but best case would be to have both
possibilities.

Pent, any ideas? ;-)

Pent

unread,
Mar 21, 2011, 3:03:46 PM3/21/11
to Tasker

> - be able to link conditions for the context with "OR" instead of
> "AND"

-------------------
Profile: x
Enter: Perform Task XORY

Profile y
Enter: Perform Task XORY
-------------------

But that way doesn't restore settings. Or:

----------------------------
Profile: x
Enter: Stop

Profile: y
Enter: Stop

Profile: x OR y
Variable Value: %PSTATE Matches ,x,/,y,
Enter: DO SOMETHING
-----------------------------

You can do it other ways.

Pent

TS

unread,
Mar 22, 2011, 3:05:14 PM3/22/11
to Tasker
Hi Pent,

Thanks for your quick answer.

I have found a solution which works for me, that's not the problem...

But let me ask you anyway:

Would it be possible to add the %INTERNET variable? Or are there any
limitations which I cannot see as a non-programmer?

Regards,
T.

Pent

unread,
Mar 23, 2011, 5:03:53 AM3/23/11
to Tasker
> Would it be possible to add the %INTERNET variable? Or are there any
> limitations which I cannot see as a non-programmer?

Yes, sure it's possible.

However, states Wifi Connected and Mobile Data cover most people's
needs in
that area.

Pent

Pent

unread,
Mar 23, 2011, 5:05:26 AM3/23/11
to Tasker
> Would it be possible to add the %INTERNET variable? Or are there any
> limitations which I cannot see as a non-programmer?

Actually, %CONNECTED is trivial, but %INTERNET is harder. For
%INTERNET you can do an HTTP Get and check the response code though.

Pent
Reply all
Reply to author
Forward
0 new messages