Recording Area CIDs (flows in German)

Share and discuss your flows and ideas with other users.

Moderator: Martin

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Recording Area CIDs (flows in German)

Post by TheBrain1984 » 24 May 2015 16:19

UPDATE 29.05.2015
Hello everybody,

for those of you who came from Llama you know a function to record CID and connect them to profiles. Martin built something similar but I needed it mor powerful, so I created a group of flows that record CIDs and write them in global_vars so that you can use them later as trigger, or conditions or whatever you want without maintain them in every trigger or condition you are using this list.
The Widget is connected to the flow "Areazelle aufnehmen". The flow will ask you first to which subarea CIDs should be recorded, you also can say that you want to record a new subarea (Every subarea must have a diffrent name, no matter to which mainarea it belongs). Each subarea belongs to one mainarea (the profile you want to select); if you want to add a mainarea you have to edit the global var "global_subarea2area" and add a entry with the new mainarea as key.
How to use the result in triggers an conditions: You have a few global_vars that you can use. For example you want to use the trigger for a the mainarea "work" you use the "GSM-Trigger" (I don't know the wording for it in the english version) and put the following expression into the Cell ID list field

Code: Select all

{getMapValue(global_arr_cid_main, "work"), listformat, comma}
or fot the subarea "branch":

Code: Select all

{getMapValue(global_arr_cid, "branch"), listformat, comma}
Installation:
- Just import the flows an run the "Init RecAreaCIDs" after you did you can deactivate (and/or delete) the flow "Init RecAreaCIDs".
- Put the widget wherever you want

http://automagic4android.com/flow.php?i ... 1f2f84ebc1

UPDATE:
In the main flow there is an action in the end that calls the flow "Area prüfen". I added it in my flow because when you record new CIDs in Cell ID lists it can be that the GSM-trigger wouldn't be triggered as long as you are in the newly recorded CID. It can be that it starts the next time you enter (or leave) the recorded CID, so I added an action in the end that starts my area checking flow manually. You can delete this action or replace it with an action that will call your area checking flow.
Last edited by TheBrain1984 on 29 May 2015 21:16, edited 1 time in total.

eTaurus
Posts: 7
Joined: 29 May 2015 19:46

Re: Recording Area CIDs (flows in German)

Post by eTaurus » 29 May 2015 19:54

Thank you for sharing! It seems to me that your flow is incomplete. It refers to a flow called "Area prüfen" that does not exist. Any ideas?
After finding your flow and Audio Profiles Manager Automagic is going to replace Llama. The latter has quite a lot of problems with Lollipop.

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Recording Area CIDs (flows in German)

Post by TheBrain1984 » 29 May 2015 21:11

You're right, I forgot to delete the last action before publishing. For me ir is there because after adding new CIDs to a list it can be that the GSM-trigger doesn't start when you're already in the new registered CID, just when you enter it the next time, so at the end of recording (and in the original flow also when new CID is registered) I trigger the flow the checks the Area manually. So just delete the last action or replace it with the flow that will check your area.

eTaurus
Posts: 7
Joined: 29 May 2015 19:46

Re: Recording Area CIDs (flows in German)

Post by eTaurus » 29 May 2015 21:23

I read about entering and leaving an area. Why would it be necessary to have a flow that checks the area? May I ask you to post this flow also? I am new to Automagic and was never good in such things. I need examples to learn how it works.

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Recording Area CIDs (flows in German)

Post by TheBrain1984 » 30 May 2015 00:53

Let's say you have a flow for each area (for example home, work and friends). Each of them get a GSM-Trigger. Now you go to work and the flow for the area "work" get triggered and everything is fine. Now your battery gets low and your phone is dead and your charger is at home. So when you come home you charge it and turn it back on, what happens now is simply nothing, because at the time you left the area "work" and afterwards entered the area "home" automagic wasn't active and it didn't get the trigger of leaving or entering an area. So you need something additional to the GSM-Trigger, that will be activated when the automagic service get started. That could be an additional Trigger in each of your "area"-flows that get triggered when automagic starts, and after the trigger you set a condition that checks if it's a CID of this area or like I did I made a flow that simply calls every "area"-flow, but I although need that condition in every flow after the trigger (yes, I know I just could have placed the condition in the area checking flow). With new recorded CIDs it is almost the same like the phone is off, because for automagic you didn't really entered or left the area so if you want the effect directly after recording, you have to do the same thing as restarting the phone, that's why I made that additional "area checking"-flow, because it's more handy then the restart trigger.

eTaurus
Posts: 7
Joined: 29 May 2015 19:46

Re: Recording Area CIDs (flows in German)

Post by eTaurus » 30 May 2015 11:54

Ok, I understand, thank you for your long answer. I hope you are willing to help some more.

Where are the CellID-lists stored? Is there a way to check if the flow has recorded successfully? I searched the storage of my phone and didn't find something. Are they stored in the flows.xml? I need Automagic give me some kind of feedback on how the flow is working.

I'm really a newbie if it comes to Automagic.

Same thing goes for the main and subareas. Is there a file I can edit if I'm not satisfied with my choice of name or grouping?
In which flow at what point do I have to add a new mainarea and how's the syntax? When I understand better I may be able to create some kind of UI for area handling (groups etc).

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Recording Area CIDs (flows in German)

Post by TheBrain1984 » 30 May 2015 17:28

There is a place you can see all global_vars. In the settings of automagic, then preferences and then global variables. The thing is that you can't change variable names and keys of maps there and the flow uses the areas and subareas as keys. I'll write a flow that can rewrite these names. But there you can check the result of recording.

eTaurus
Posts: 7
Joined: 29 May 2015 19:46

Re: Recording Area CIDs (flows in German)

Post by eTaurus » 30 May 2015 21:41

Great, thank you! I was able to change the values of global_subarea2area at the place you directed me to. A subarea got placed into the wrong main area.
My goal is to replace the functionality of Llama relating to audio profiles and recording of areas, preferably with an easy to use UI.
Have you looked into audio profiles manager? viewtopic.php?f=3&t=3314 It replaces the audio profiles functionality in a nice way.
Do you know a good place to start learning Automagics syntax? I really would like to learn creating flows with about the same complexity as yours. Is it like some kind of programming language?

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Recording Area CIDs (flows in German)

Post by TheBrain1984 » 31 May 2015 16:13

I didn't download the audio profile manager yet. If you you change the main area of a sub area you need to run this flow once everytime you do this, it reorganizes the global variable "global_arr_cid_main".

http://automagic4android.com/flow.php?i ... 47565abd8c

User avatar
TheBrain1984
Posts: 137
Joined: 07 Aug 2013 08:17
Location: Germany

Re: Recording Area CIDs (flows in German)

Post by TheBrain1984 » 31 May 2015 16:55

Now the promised flows that allow to rename main areas and subareas

http://automagic4android.com/flow.php?i ... 8c31689167

Post Reply