Cell collection (again, but different request)
Posted: 11 Sep 2015 05:35
Hi Martin,
I'm just working on a flow that collects cell IDs and puts them into a global variable directly.
I'm trying to mimic the “recent cells“ list feature from Llama, where I get a chronologically ordered (!) persistent (!) list with checkboxes, so that I can decide later if I find an area worth capturing AFTER already having spent some given time there.
Also is it very inconvenient to copy/paste explicit ID lists from one trigger to the other condition when working with the same area in different flows, hence the global variable.
My flow basically works, but it is (and has to be) sort of a dirty hack:
1. I use a time trigger that fires every few seconds (see below)
2. After that I have a “Phone Cell GSM“ condition in order to have access to the “Collect cells“ process (which I start manually inside there, also far from elegant) and to the two variables cid and last_cid.
3. On false (as there is no CID list in the condition I want to handle, I just want the next step to be executed every time) I hand over control to a script action, which adds the CID (plus timestamp) to a global variable, provided that it is not already present.
There are (apart from this not very elegant structure, but I did not find a better way so far) some issues I ran into (and you will see that catering to those will also make possible a much more elegant structure ):
1. The time trigger is unsatisfactory for this application - cells sometimes change very quickly (and sometimes hardly at all...), but on my device I can't use an interval shorter than five secs, because otherwise the flow is “emergency stopped“.
OTOH, if the cell doesn't change for a long time, the trigger still fires needlessly every few seconds (BTW, to minimize impact I check for inequality of cid and last_cid first thing in the script, but still...)
So, first feature request: Create a trigger that just fires on any CID change, without filtering or treating this as entry/exit of an area.
That way I could put the first two steps of my flow into one simple trigger that just fires as needed, moreover do NOT have to start the “cell collecting“ process by hand, AND will get all cells, even if they change to and fro in less than 5 secs!
Solves basically all problems mentioned above
2. I wrote a second flow to reset the global variable in order to not having to go into “manage“ and do this by hand. Moreover I'll need and will write another flow that separates/parses the CIDs and timestamps and filters for a certain time range - I want to be able to keep all CIDs from the last xy minutes and copy them over from the generic global collection variable to a dedicated one used later in the flows related to this area.
I did not, however, find a possibility to start scripts directly - therefore I now use a dummy trigger which never fires, and execute the flow by hand. Works, but is far from elegant.
So, second feature request: Make a “user starts script by hand“ trigger (if you can call it a trigger at all ), and perhaps even some interaction elements like yes/no-questions, string input and perhaps lists with radio buttons for selection of elements.
Better still, have a look at Llama's “recent cells“ list and implement something to this effect with a “store resulting list in *this* global variable“-option, or create something like built-in named areas.
But please, even if you do the latter, I'd still like to have the aforementioned “On any GSM cell change“ trigger
That's all for now I think (and it's really quite a mouthful ) but I hope I got across my motivation for these requests!
Thanks & keep up the great work!
Wolfgang
I'm just working on a flow that collects cell IDs and puts them into a global variable directly.
I'm trying to mimic the “recent cells“ list feature from Llama, where I get a chronologically ordered (!) persistent (!) list with checkboxes, so that I can decide later if I find an area worth capturing AFTER already having spent some given time there.
Also is it very inconvenient to copy/paste explicit ID lists from one trigger to the other condition when working with the same area in different flows, hence the global variable.
My flow basically works, but it is (and has to be) sort of a dirty hack:
1. I use a time trigger that fires every few seconds (see below)
2. After that I have a “Phone Cell GSM“ condition in order to have access to the “Collect cells“ process (which I start manually inside there, also far from elegant) and to the two variables cid and last_cid.
3. On false (as there is no CID list in the condition I want to handle, I just want the next step to be executed every time) I hand over control to a script action, which adds the CID (plus timestamp) to a global variable, provided that it is not already present.
There are (apart from this not very elegant structure, but I did not find a better way so far) some issues I ran into (and you will see that catering to those will also make possible a much more elegant structure ):
1. The time trigger is unsatisfactory for this application - cells sometimes change very quickly (and sometimes hardly at all...), but on my device I can't use an interval shorter than five secs, because otherwise the flow is “emergency stopped“.
OTOH, if the cell doesn't change for a long time, the trigger still fires needlessly every few seconds (BTW, to minimize impact I check for inequality of cid and last_cid first thing in the script, but still...)
So, first feature request: Create a trigger that just fires on any CID change, without filtering or treating this as entry/exit of an area.
That way I could put the first two steps of my flow into one simple trigger that just fires as needed, moreover do NOT have to start the “cell collecting“ process by hand, AND will get all cells, even if they change to and fro in less than 5 secs!
Solves basically all problems mentioned above
2. I wrote a second flow to reset the global variable in order to not having to go into “manage“ and do this by hand. Moreover I'll need and will write another flow that separates/parses the CIDs and timestamps and filters for a certain time range - I want to be able to keep all CIDs from the last xy minutes and copy them over from the generic global collection variable to a dedicated one used later in the flows related to this area.
I did not, however, find a possibility to start scripts directly - therefore I now use a dummy trigger which never fires, and execute the flow by hand. Works, but is far from elegant.
So, second feature request: Make a “user starts script by hand“ trigger (if you can call it a trigger at all ), and perhaps even some interaction elements like yes/no-questions, string input and perhaps lists with radio buttons for selection of elements.
Better still, have a look at Llama's “recent cells“ list and implement something to this effect with a “store resulting list in *this* global variable“-option, or create something like built-in named areas.
But please, even if you do the latter, I'd still like to have the aforementioned “On any GSM cell change“ trigger
That's all for now I think (and it's really quite a mouthful ) but I hope I got across my motivation for these requests!
Thanks & keep up the great work!
Wolfgang