[Android Apps and Games] trukero:
Hi everybody,

I am using Llama for several things on my i9100g. The first one is to control sound profile at work and at home, this is straightforward. The second thing is to control when the Wifi or the 3G signal should be on. I would like to have some input in order to optimize the process, since I believe is kind of messy.

Basically there are three principles that I want to use.

a.	When I am physically at home I want to use only my Wifi, I have no flat 3G plan plus I believe the Wifi consumes lets battery that the 3G connection.

b.	When I am out, of course I want to turn off Wifi and turn on the 3G.

c.	Always optimize my battery consumption. So far with low use, I have two full days without charging the battery again.

For these reasons, I have created the following events, variable and zones.

Zones

Home: This zone covers my house and roughly 4 blocks around, including restaurants and a friend place.

Llama Variables

Wifi: when ‘Wifi’ is Disabled the Wifi signal is off and vice versa.

Mobile data: when ‘Mobile data’ is Disabled the 3G is off and vice versa.

Force: It a kind of flag variable that I have created to “force” Llama to check for a Wifi signal after some period of time.

Events

•	Wifi On - Home:

Between 06:30 and 22:59 at Home when 'Wifi' has a value of 'Disable' when 'Force has a value of 'Disable' - disable mobile data, set Llama variable 'Mobile Data' to 'Disable' and enable Wifi

Note on this event. I like to turn off all signals (3G and Wifi) after 11 pm at home, since I am probably sleeping.

•	Force On: When ‘Force’ has a value of ‘Enable’ – delay for 30 min and then set Llama variable ‘Force’ to ‘Disable’

•	No Wifi Available: When your phone disconnects from <Any Wifi network> - delay for 1 minute and then disable Wifi and set Llama variable ‘Wifi’ to ‘Disable’. And set Llama variable ‘Force’ to ‘Disable’

Note on this event. It will fire the event after one minute if all conditions are still valid. I use this extra setting to avoid turning off the Wifi, when the signal just goes away for few seconds.

•	Force Mobile Data – On: At home between 06:30 and 22:59 when your phone disconnects from <Any Wifi network> when ‘Force has a value of ‘Disable’ – delay for 5 minutes and then enable mobile data, set Llama variable ‘Mobile Data’ to Enable’, disable Wifi and set Llama variable ‘Force’ to ‘Enable’ every 1 minute.

Note on this event. I will repeat this event as long as all the conditions hold. Please see note 1 at the end of the thread for an extra explanation why I need the repetition.

•	Mobile Data Away – On: Upon leaving home enable mobile data, set Llama variable ‘Mobile Data’ to ‘Enable’ disable Wifi and set Llama variable ‘Wifi’ to ‘Disable’

•	Evening: Between 23:00 and 6:29 at Home disable all signals.

A general explanation of the events.

I am sometimes in a restaurant in my Home zone, but not physically at home. Therefore, the “Wifi Home – On” will try to connect to the wireless network at home, but of course is not available. Therefore, the “No Wifi Available” will fire after one minute, disabling Wifi. At this stage my phone has neither Wifi nor 3G connected.

For roughly 5 minutes after the firing “No Wifi Available”, the “Force Mobile Data” event turn on the 3G if all conditions are met. At this moment, the ‘Force’ Llama variable will be ‘Enable’.

After 30 min, the ‘Force’ variable is ‘Disable’ again, this is my way to tell Llama, please check again if my home Wifi network is available, if not fire again “No Wifi Available” and later “Force Mobile Data” and one more time the cycle of 30 min is on.

The “Mobile Data away-on” is an evet that kind of overright all the other process. When I am not at Home, is pointless to check for my home Wifi conection,so I tell Llama to turn on the Mobile data regardless of time (maybe I am in a party).

I hope I have explained more of less the process.

Note 1. The repetition of 1 minute is because on my way home, I have to walk few blacks on my Home zone, and I want Llama to always check (every 1 minute) if I have arrived at home or not. If all the conditions in ”Force Mobile Data” are true, means I have not arrived yet in my house, if not, Llama will fire “Wifi On”.

Cheers