Profile activated by cells from two separate groups?

86 views
Skip to first unread message

Daniel Cobra

unread,
May 19, 2015, 11:02:36 AM5/19/15
to tas...@googlegroups.com
Hello

As I understand it, the "Cell Near" context is activated when the phone connects to ANY of the cells previously detected by scanning the cells visible at the desired location. As a result, the area where the context is activated is the UNION of the coverage areas of all the listed cells, and, therefore, is typically very large.

I have been thinking that cell-based location could be made more accurate if, for a given profile, I could create two "Cell Near" contexts and divide the visible cells between them, so that the profile would be activated when at least one cell is visible in each context. The resulting area would be the INTERSECTION of the coverage areas of the two groups of cells, and, therefore, might be made much smaller. For example, I could put in one context all cells to the north and in the other context all cells to the south of the desired location, assuming that at least one from each group would be visible when I am near that location.

I have given that a try, but the profile was never activated, probably because the "Cell Near" context is not activated when one or more of its cells are VISIBLE, but only when the phone is CONNECTED to one of its cells, which means that the two contexts cannot be active simultaneously.

I could also try to do this "by hand" if It was possible to get a list of currently visible cells. For instance, if there was an array %VISIBLECELLIDS, I could write a context that would go active if this array contained at least one cell ID from each of the two groups. However, there does not seem to be a way of getting a list of visible cells. I could use %CELLID to build a list of the last several cells the phone connected to, but it would not be the same as a list of cells that are currently visible (even if they were not connected to).

Any ideas of how this could be done?

Regards

Daniel

Marta Hintz

unread,
May 19, 2015, 1:52:54 PM5/19/15
to tas...@googlegroups.com
Cell Near does not mean that your phone is connected, but that it sees a cell network /tower. You can scan with it to id multiple towers that your phone sees. (I reccommend re-reading the tasker help guide on cell near)

Marta Hintz

unread,
May 19, 2015, 1:59:05 PM5/19/15
to tas...@googlegroups.com
I should add that if your phone is connected it does indicate to which.

Daniel Cobra

unread,
May 19, 2015, 3:02:08 PM5/19/15
to tas...@googlegroups.com
Hi, Marta. Thanks for your reply.

Let me rephrase the problem to see if I can make myself more clear.

I create a profile with a Cell Near context, do the scan, and let's say I get cell IDs A and B simultaneously and with good signal strength.

Then I detele cell ID B from the list, leaving only A, create a second Cell Near context in the same profile, do a new scan, which again shows IDs A and B, but this time delete cell ID A, leaving only B.

I would expect the profile to be immediately active, since both contexts should be active (one contains ID A, and the other contains ID B, which are both visible), and yet, at least for me, the profile is not activated. Do you know why?

Marta Hintz

unread,
May 19, 2015, 3:08:35 PM5/19/15
to tas...@googlegroups.com
My guess from my own experience is that cell near will still scan again, and there in lies your delay.

Brad Minion

unread,
May 19, 2015, 3:15:38 PM5/19/15
to tas...@googlegroups.com
I wonder if the cell network makes a difference whether this works or not. I am in the US on Verizon and when I turn the scan on Cell Near and leave it on for a while it only ever "sees" one tower. In other words, it's like the scan wasn't scanning and I could only see the tower I was currently connected to. The only way I could get the other possible towers was to rescan occasionally (or when I notice cell near wasn't working and it should be) and hope I was connected to a different tower. So, I would agree with the OP that, in my case, cell near only sees the one I'm currently connected to.

On Tue, May 19, 2015 at 2:08 PM, Marta Hintz <lar...@gmail.com> wrote:
My guess from my own experience is that cell near will still scan again, and there in lies your delay.

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Daniel Cobra

unread,
May 19, 2015, 3:23:33 PM5/19/15
to tas...@googlegroups.com
Brad, I actually see several towers during the scan. The problem is that if I partition them into two different contexts, it seems the two contexts cannot be activated simultaneously, even though I know at least one tower should be visible in each of them.

Brad Minion

unread,
May 19, 2015, 3:28:57 PM5/19/15
to tas...@googlegroups.com
Except that you're still only connected to one of them at any given time. In other words, I don't think cell near is actively scanning unless you hit that scan button. I really like what you're trying to do because that tightens the cell near radius, so I hope you figure it out. Maybe Pent will see this and chime in.

On Tue, May 19, 2015 at 2:23 PM, Daniel Cobra <daniel...@gmail.com> wrote:
Brad, I actually see several towers during the scan. The problem is that if I partition them into two different contexts, it seems the two contexts cannot be activated simultaneously, even though I know at least one tower should be visible in each of them.

Daniel Cobra

unread,
May 19, 2015, 3:51:46 PM5/19/15
to tas...@googlegroups.com
Exactly. That's why I was assuming a Cell Near context is activated when the currently connected cell matches one of the IDs in its list. That would explain why two contexts with disjoint sets of IDs are not activated simultaneously, even if there are visible cells in both of them.

If this assumption is correct, then the Cell Near context actually amounts to a "Cell Connected" (to any of the IDs in the list) context, while what I'm trying to do would require a "Cell Visible" context.

Rich D

unread,
May 19, 2015, 4:32:52 PM5/19/15
to Tasker Google Groups Post

>
> If this assumption is correct, then the Cell Near context actually amounts to a "Cell Connected" (to any of the IDs in the list) context, while what I'm trying to do would require a "Cell Visible" context.

Well that's interesting..

Have you tried making a separate profile  with  the separate cell near context?  

If that works you can just use the profiles active context to "and" the 2 cell near contexts.. 

Daniel Cobra

unread,
May 19, 2015, 4:44:35 PM5/19/15
to tas...@googlegroups.com
Yes, I tried that and it didn't work, either. Granted, I may be doing something wrong, since I'm totally new to tasker. It would be great if any of the more experienced users could try to replicate this, and comment on the feasibility of using the intersection of two Cell Near contexts with different ID lists to narrow down the activation area.

Rich D

unread,
May 19, 2015, 4:52:28 PM5/19/15
to Tasker Google Groups Post


> Yes, I tried that and it didn't work, either. Granted, I may be doing something wrong, since I'm totally new to tasker. It would be great if any of the more experienced users could try to replicate this, and comment on the feasibility of using the intersection of two Cell Near contexts with different ID lists to narrow down the activation area.

If I have time I will give it a try,  unfortunately I only have one tower by my house. 

Are you sure you are saving all the way out of tasker with the back button  before testing?

easiuser

unread,
May 19, 2015, 5:48:56 PM5/19/15
to tas...@googlegroups.com
You can definetly have two cell near profiles active at the same time if they happen to share the same %CELLID in their list.  However I don't think you will get the results you want. 
 
I will try to explain with words but might need a diagram.
 
When at the target location you scan and pick up all the towers within a certian radius. (ie A, B, C and D)
 
When at the North location you scan and pick up all the towers within a certian radius (ie A, B, F and G)
 
When at the South location you scan and pick up all the towers within a certian radius (ie A, B, H and I)
 
Now the intersection of North and South is towers A and B which you use for your context.
 
You head back to your target location and you pick up a signal from tower C.  You now have a false negative reading.
 
If you are in a decently populated area, there are usually a lot of wifi networks in range.  I would suggest using cell near to turn on your wifi, or activate a wifi near profile to establish a tighter location. 

Daniel Cobra

unread,
May 19, 2015, 7:56:22 PM5/19/15
to tas...@googlegroups.com
You can definetly have two cell near profiles active at the same time if they happen to share the same %CELLID in their list.  However I don't think you will get the results you want. 

Yes, you can have two Cell Near contexts active at the same time if they have one or more common cell IDs, but you're right, that's not what I want. I am proposing to use two (or more) contexts with disjoint sets of cell IDs (no common IDs).

Please see my comments below, after your example.
 
 I will try to explain with words but might need a diagram.
 
When at the target location you scan and pick up all the towers within a certian radius. (ie A, B, C and D)
 
When at the North location you scan and pick up all the towers within a certian radius (ie A, B, F and G)
 
When at the South location you scan and pick up all the towers within a certian radius (ie A, B, H and I)
 
Now the intersection of North and South is towers A and B which you use for your context.
 
You head back to your target location and you pick up a signal from tower C.  You now have a false negative reading.

That's not quite what I have in mind. Using your example, after scanning at the desired location and seeing cells A, B, C, and D, I'd look up their tower locations using OpenCellID, Signal Finder or other tower location database. Then let's say I find out cells A and B are to the North, and cells C and D are to the South.

If I use the standard Cell Near context with cells A, B, C, and D, the profile will be active at the desired location, as well as somewhat North of it (where A and/or B are visible), and somewhat South of it (where C and/or D are visible).

What I am proposing is to create two Cell Near contexts, say Context 1, with A and B on its list, and Context 2, with C and D on its list, and use them both for the desired Profile. Now the profile will no longer be active North of the location (where Context 1 is active but Context 2 isn't) or South of the location (where Context 2 is active, but Context 1 isn't). The Profile will be active at the intersection of the coverage areas of Contexts 1 and 2, a smaller area than that of the original context with all four IDs on the list, thus making it more accurate.

Of course the partition could also be East/West or whatever works best for a particular distribution of towers. Also, in principle you could narrow down the activation area even more by using three or more disjoint contexts, assuming you can see a large enough number of cells.

If you are in a decently populated area, there are usually a lot of wifi networks in range.  I would suggest using cell near to turn on your wifi, or activate a wifi near profile to establish a tighter location.

Yes, I know Wi-Fi scanning is much more accurate, but I'm using Cell Near exactly because I'd like to disable Wi-Fi scanning to save a little juice!

Sean Williams

unread,
May 19, 2015, 8:42:49 PM5/19/15
to tas...@googlegroups.com
What I am proposing is to create two Cell Near contexts, say Context 1, with A and B on its list, and Context 2, with C and D on its list, and use them both for the desired Profile. Now the profile will no longer be active North of the location (where Context 1 is active but Context 2 isn't) or South of the location (where Context 2 is active, but Context 1 isn't). The Profile will be active at the intersection of the coverage areas of Contexts 1 and 2, a smaller area than that of the original context with all four IDs on the list, thus making it more accurate.


I'm starting to understand where you're going with this although without building it I'm wondering if there would actually be any real benefit. If I'm wrong here let me know...

I propose we will use the North - South devide as the example, also have just the one cell near profile.

Create a manually preformed task to collect cells in any location, it could run a for loop and have a timeout of 10 mins for example.

Run this scanning task in the North and then in the South.

N = %CELL_GROUP1
S = %CELL_GROUP2

Once both groups are populated you would need to process both lists to work out which cell ids overlap.

Duplicated cells can be moved to %CELL_GROUP giving you your overlapping list and the variable to use within your Cell Near context.

Obviously you can extend this model to E & W,, maybe this approach could be really useful in within certain geographical locations.

Richard Finegold

unread,
May 19, 2015, 9:35:11 PM5/19/15
to tas...@googlegroups.com
On Tuesday, May 19, 2015 at 4:56:22 PM UTC-7, Daniel Cobra wrote:
If I use the standard Cell Near context with cells A, B, C, and D, the profile will be active at the desired location, as well as somewhat North of it (where A and/or B are visible), and somewhat South of it (where C and/or D are visible).

What I am proposing is to create two Cell Near contexts, say Context 1, with A and B on its list, and Context 2, with C and D on its list, and use them both for the desired Profile. Now the profile will no longer be active North of the location (where Context 1 is active but Context 2 isn't) or South of the location (where Context 2 is active, but Context 1 isn't). The Profile will be active at the intersection of the coverage areas of Contexts 1 and 2, a smaller area than that of the original context with all four IDs on the list, thus making it more accurate.

I suggest a simpler evidence gathering to confirm what you want is possible.
  1. Create a new profile, only with a Cell Near context. Scan.
  2. Add a task with action Flash %CELLID (or something else short).
  3. Clone the profile, to have as many copies as cells seen (e.g. 4 for A,B,C,D)
  4. For each profile, delete the other cells seen so that each one has a unique cell.
  5. Tap the Tasker icon to save, then long-tap to disable Tasker and long-tap again to enable Tasker.
  6. See if any created profiles are simultaneously active. The Run Log might or might not have overlaps. The preferences "Cell Workaround" and "Use New Cell API" might influence this, and of course your ROM and radio modes; .
On the other hand, the very first line of the Cell Near is "One of the specified cell towers is visible to the phone."

I'd try it myself, but I'm one of those with only one tower nearby. BTW, if you do get simultaneous profile activations (and you've double-checked that they are unique) then you might be able to further pinpoint your location by Cell Near with Inverted checked (if near the A,B,C,D area there's an A,B,C,D,E area).

Also, there have been forum posts about getAllCellInfo; something there might be helpful.

Daniel Cobra

unread,
May 20, 2015, 7:29:27 AM5/20/15
to tas...@googlegroups.com

Thanks for your suggestion, Richard. That's essentially what I had done before, except with more than one cell per profile. Repeating the experiment with only one cell per profile, as you suggested, I get the log that's shown below.

So, one can see only one profile is active at a time. There was also a Cell Near D profile that was never active. That's why I believe that a Cell Near profile is activated when one of the cells on its list is currently connected to, rather than merely visible. Which means that my idea of using Cell Near profiles with disjoint sets of IDs to narrow down the activation area won't work.

It would be great if a Tasker dev could comment on the feasibility of implementing a true "Cell Visible" context, that would be activated when any of the cells on its list is VISIBLE, rather than CONNECTED to.


Daniel Cobra

unread,
May 21, 2015, 8:45:59 AM5/21/15
to tas...@googlegroups.com
Is Pent the main (or only) Tasker dev? It would be great to hear his opinion about this idea of having a "Cell Visible" state/context that would be activated when any of the cells on its list is visible (rather than connected to, as seems to be the case with Cell Near). Is there a way to bring this thread to his attention?

Brad Minion

unread,
May 21, 2015, 9:02:56 AM5/21/15
to tas...@googlegroups.com
Is Pent the main (or only) Tasker dev? 

Yes. I don't know what catches his eye, but he's probably concentrating on things affecting the beta. 

Paul Vanderperren

unread,
May 22, 2015, 12:49:27 PM5/22/15
to tas...@googlegroups.com
I have been following this discussion, because I find Daniel's brilliant idea fascinating and utterly useful. And if his findings are correct, and I have no reason to doubt them, then it looks like 'Cells Near' is not only a blatant misnomer (and should be called 'Cell Connected', as in 'Wifi Connected'), but also that a REAL'Cells Near' (meaning visible, no more no less) would be a MUCH more useful concept and implementation or addition.
It would in most cases allow much more precise location determination, at zero expense (apart from a little more work in setting up the profile), and thus enable significant battery savings with regard to our location profiles.
Daniel, you got my vote!

easiuser

unread,
May 22, 2015, 2:39:04 PM5/22/15
to tas...@googlegroups.com
While I do think a "Cells Visible" state would be desirable, there is apparently a problem with the android API onCellInfoChanged function in that it always returns NULL.  https://code.google.com/p/android/issues/detail?id=170816&thanks=170816&ts=1430416733
 
Based on past comments, I doubt Tasker will add this feature until the API supports it.
 
Cell Connected may be better a better title but I will take exception to the comment " it looks like 'Cells Near' is a blatant misnomer ".  It is actually Cell Near (singular) , meaning that a cell in the list of known cells is near.  Little confusing, maybe, but blatant misnomer, I don't think so.

Paul Vanderperren

unread,
May 22, 2015, 5:57:42 PM5/22/15
to tas...@googlegroups.com
On Friday, May 22, 2015 at 8:39:04 PM UTC+2, easiuser wrote:
> While I do think a "Cells Visible" state would be desirable, there is apparently a problem with the android API onCellInfoChanged function in that it always returns NULL.  https://code.google.com/p/android/issues/detail?id=170816&thanks=170816&ts=1430416733
>  
> Based on past comments, I doubt Tasker will add this feature until the API supports it.

Maybe I'm plain stupid, but I cannot see the problem, taking into account that Tasker can whip up a list of VISIBLE towers in seconds, when you let it scan for cells. API or no API...

> Cell Connected may be better a better title but I will take exception to the comment " it looks like 'Cells Near' is a blatant misnomer ".  It is actually Cell Near (singular) , meaning that a cell in the list of known cells is near.  Little confusing, maybe, but blatant misnomer, I don't think so.

Well, I do. Daniel seems to have established that it fires not on a 'near' but on a 'connected' state. Furthermore, the help text says 'One of the specified cell towers is VISIBLE to the phone.' Only one can be correct, right? And even you do not seem to doubt it's Daniel. And thus it is not a 'Near' but a 'Connected' state, analogous to the wifi ones. Confusing and a misnomer.
And with regard to the Cell/Cells part of the name: it is clear that a new and improved REAL near state should mean that one OR MORE of the cells in the list is/are near, meaning visible.

Anyway, can't we all at least agree that a real cell(s) near state is far more useful as compared to the current implementation?

nanobrain

unread,
May 23, 2015, 3:00:26 PM5/23/15
to tas...@googlegroups.com
Tasker can not "whip up" near cells in seconds, the scan function will add connected cells to the list while it is active.

Paul Vanderperren

unread,
May 23, 2015, 5:16:53 PM5/23/15
to tas...@googlegroups.com
Then maybe you should tell Pent he's all wrong when he literally says 'The magnifying glass shows towers the monitor service has seen since it started (likely over several hours), Scan looks
at what's visible at that moment.' somewhere in the 'Tasker Beta: Cell Near' topic.
Notice the use of 'seen' and 'visible' ...
Reply all
Reply to author
Forward
0 new messages