Llama - Who's Using It and Any Good Examples?

calisro

Member
Apr 7, 2011
6
0
0
Visit site
Figured i'd share my discoveries. There is a locale plugin called SL4A that works great with llama. I use it to execute shell scripts in the background. Anything from perl to shell scripts and beyond. All I see is a notification pop up quickly and it executes anything I want based on any criteria in llama. There was a little trial and error involved to get it working but now I am happy.

https://code.google.com/p/android-scripting/

If needed, I can elaborate if anyone has any issues using it. I use it with and without root su to do things.
 

MathP

New member
Jul 16, 2013
0
0
0
Visit site
Hello all

@kurokimasama:
after studying with care your events (I didn't finish yet), I have several questions:
- Why did you create some "Error correction" events (for example, "Correcci?n de error de sincronizacion wifi" or "Correcci?n syncro en noche")? Does it mean Llama is messing things up?
- I found your wifizone variable very interessting but I wonder if this trick doesn't imply side effects (because of the delay to play the event & set the variable with the right value)? it might be insignificant but I was not sure

@calisro:
very interresting & extending concept: do you have some shell scripting examples?

Regards, Math
 

nickmax1

New member
Mar 19, 2013
0
0
0
Visit site
i am getting a bit frustrated with my wifi events,
I have an event that says if I am in my home, then enable wifi, disable data.

but when i am in my garden i do not connect to wifi so i have an OR coindition in my above event that if my wifi disconnects from my known wifi another event should trigger.

but it doesnt

how do people handle this problem (if its wifi polling then please go through that step by step as i still just cant get my head round it!)
 

calisro

Member
Apr 7, 2011
6
0
0
Visit site
Hello all

@kurokimasama:
after studying with care your events (I didn't finish yet), I have several questions:
- Why did you create some "Error correction" events (for example, "Correcci?n de error de sincronizacion wifi" or "Correcci?n syncro en noche")? Does it mean Llama is messing things up?
- I found your wifizone variable very interessting but I wonder if this trick doesn't imply side effects (because of the delay to play the event & set the variable with the right value)? it might be insignificant but I was not sure

@calisro:
very interresting & extending concept: do you have some shell scripting examples?

I have a bunch of things but here are some that may of interest. The other ones I use are probably not for others....
1) I have a app notification trigger in llama that when I have am in my car (variable set to know I am in my car from other events) my text messages are read to me when I recieve them so that I do not need to use my phone. I am also further customizing that code (work in progress) so that it will ask me if I'd like to respond and wait for me to speak to it and send the text. It is written in python. It is so simple to do these type of things with SL4A. I took 6 lines of code. :)
2) I find that FB eats my battery alive. So I always keep it frozen and unfreeze it when I use it. Now I have two events:
a) llama does a foreground application trigger so that when I unfreeze and launch FB, It sets a queued trigger than when my screen goes off, it refreezes it automatically (with a 10 minute delay)
b) I created another event that does the unfreezing of FB for me via a shell scripts through SL4A and launches it. It unfreezes FB and then sets a variable so my trigger above also knows it was unfrozen. I created a shortcut on my desktop to use to open FB through this event.
3) I installed rsync on my phone and nightly I sync my phone with my network NAS while I sleep (@home wifi, @in night mode, @while charging). No more risk of lost data/pictures/or this work. I love this. I have had SD cards go bad. Llama calls SL4A and runs a shell script I created. Obviously there are a few pre-cursors one needs to do to actually get this to work. you obviously need a network nas and install rsync and do a ssh key exchange between android and the linux based NAS.

These are just some of hte things. There are SO many things SL4A brings to the table. If someone wants more info about any of these, I can post some basics or contents of my shell scripts/python scripts.
 

calisro

Member
Apr 7, 2011
6
0
0
Visit site
i am getting a bit frustrated with my wifi events,
I have an event that says if I am in my home, then enable wifi, disable data.

but when i am in my garden i do not connect to wifi so i have an OR coindition in my above event that if my wifi disconnects from my known wifi another event should trigger.

but it doesnt

how do people handle this problem (if its wifi polling then please go through that step by step as i still just cant get my head round it!)

Why dont you 'share' your events and let us take a look. Its easier to look than try to understand whats gonig on. If you share them, we can load them into our llama and see them.
 

MathP

New member
Jul 16, 2013
0
0
0
Visit site
Hello all,

@calisro: your different examples are quite interesting indeed! Could you share the scripts?
I'm particularly interested in your rsync stuff: I allready have a NAS & rsync script between PCs & my NAS but I didn't investigate this track with my Android phone (I was backuping all the folders I wanted on Google Drive with FolderSync Lite with the privacy issues it might imply): How did you manage to install rsync on your phone: with rsync backup for Android or by installing openssh & rsync in busybox?

@nickmax1: yes it's exactly what WiFi polling is for: I will try to detail the way to setup the polling (if I understood everything) in an another post

Regards, Math
 

Olivier D

New member
Mar 29, 2013
3
0
0
Visit site
i am getting a bit frustrated with my wifi events,
I have an event that says if I am in my home, then enable wifi, disable data.

but when i am in my garden i do not connect to wifi so i have an OR coindition in my above event that if my wifi disconnects from my known wifi another event should trigger.

but it doesnt

how do people handle this problem (if its wifi polling then please go through that step by step as i still just cant get my head round it!)

Hey nickmax1

Your actual conditions just tell Llama, either when wifi connects or when wifi disconnects to trigger its actions. Within the OR conditions, if you have checked the box "Allow retrigger" and it still won't work, you should create a seperate event for it to trigger that should look like : When your phone disconnects from "your known wifi" when at home - actions you desire

Now as for the wifi polling feature, I have stopped using it because it became too complicated for what I wanted my events to do.

here are my wifi events :

Wi-Fi disconnected
When Airplane mode is disabled when your phone disconnects from Livebox-848C, NEUF_3070, NUMERICABLE-8D96 or lasstikonnection when 'night' has a value of 'no' - enable mobile data, queue an event named 'Lock & loud' after 2 minutes (Conditions : WiFi Network Disconnected: <Any WiFi network>, Livebox-848C, NEUF_3070, NUMERICABLE-8D96 , lasstikonnection. Actions : Locale plugin >ProfileTasker Default ; Profile: Loud. Toggle WiFi: WiFi Off(if not connected). Llama variable > Variable name: Wi-Fi connected Variable value : no), disable WiFi if not connected and set Llama variable 'Wi-Fi connected' to 'no'

Near Wi-Fi
At Near ChantinorNear Clemenceau|Near Grenouill?re when Airplane mode is disabled when 'night' has a value of 'no' when your phone disconnects from Livebox-848C, NEUF_3070, NUMERICABLE-8D96 or lasstikonnection - enable WiFi and queue an event named 'Wi-Fi off' after 10 seconds (Actions : Toggle WiFi: WiFi Off(if not connected)) every 5 minutes

Wi-Fi connected
When your phone connects to Livebox-848C, NEUF_3070, NUMERICABLE-8D96 or lasstikonnection when 'night' has a value of 'no' - change profile to Normal, set Llama variable 'Wi-Fi connected' to 'yes', set Llama variable 'Wi-Fi on' to 'yes', run a Locale plugin 'ProfileTasker: Home', queue an event named 'Media stop' after 5 seconds (Conditions : Music Playback: Music Playing. Actions : Media player: Stop) and disable mobile data
 

nickmax1

New member
Mar 19, 2013
0
0
0
Visit site
Why dont you 'share' your events and let us take a look. Its easier to look than try to understand whats gonig on. If you share them, we can load them into our llama and see them.

Wifion:
When at home or work between 7am and 23:00 - disable mobile data, enable wifi , change profile to normal

wifioff:
when NOT at home or work between 7am and 23:00 (when your phone disconnects from "KNOWN WIFI SOURCES")- delay 1 minute then disable wifi, enable mobile data, change profile to normal

I deleted my OR conditions they were doing nothing.

The problem with my setup in the wifioff is that my cell coverage is quite large (my ten minute walk to the train station results in me still being in my "HOME" cell - and therefore wifi is on even though not connected to my home (obviously) and thats when i want data to be on.

Also when i am in my garden i am at home (but my wifi isnt powerful enough to reach me) i want data to be on then as well.

irritating.
 

Olivier D

New member
Mar 29, 2013
3
0
0
Visit site
Wifion:
When at home or work between 7am and 23:00 - disable mobile data, enable wifi , change profile to normal

wifioff:
when NOT at home or work between 7am and 23:00 (when your phone disconnects from "KNOWN WIFI SOURCES")- delay 1 minute then disable wifi, enable mobile data, change profile to normal

I deleted my OR conditions they were doing nothing.

The problem with my setup in the wifioff is that my cell coverage is quite large (my ten minute walk to the train station results in me still being in my "HOME" cell - and therefore wifi is on even though not connected to my home (obviously) and thats when i want data to be on.

Also when i am in my garden i am at home (but my wifi isnt powerful enough to reach me) i want data to be on then as well.

irritating.

Check my post
 

nickmax1

New member
Mar 19, 2013
0
0
0
Visit site
olivier I am copying your events and seeing if that will work for me.

Question: You have variables for wifi on/off and wifi connected yes/no but i see no reason for having these variables in your events as they dont seem to trigger anything?
 

Olivier D

New member
Mar 29, 2013
3
0
0
Visit site
olivier I am copying your events and seeing if that will work for me.

Question: You have variables for wifi on/off and wifi connected yes/no but i see no reason for having these variables in your events as they dont seem to trigger anything?

these variables were for other events like when my battery is low, when my calendar has an entry or other network related events that I used to have (i.e. to prevent Llama to trigger conflicting events). Don't mind them, I left these variables there in case I need them again
 

nickmax1

New member
Mar 19, 2013
0
0
0
Visit site
I thought as much.

Interestingly, your two events for wifi connected and wifi disconnected show up as GREEN in my "Events" page., suggesting that my phone has connected to as well as disconnected from my known wifi sources......how is that possible.?

The correct event is firing though (as my wifi is on and I am at my workplace) - but I am keen to understand why it believes it is in two states of connection/disconnection at the same time.

Are your two events highlighted as green?
 

Olivier D

New member
Mar 29, 2013
3
0
0
Visit site
I thought as much.

Interestingly, your two events for wifi connected and wifi disconnected show up as GREEN in my "Events" page., suggesting that my phone has connected to as well as disconnected from my known wifi sources......how is that possible.?

The correct event is firing though (as my wifi is on and I am at my workplace) - but I am keen to understand why it believes it is in two states of connection/disconnection at the same time.

Are your two events highlighted as green?

Check your conditions again, my wifi connected is green and my wifi disconnected is red.
 

nickmax1

New member
Mar 19, 2013
0
0
0
Visit site
Olivier

I notice that the two events Near Wifi and Wifi Disconnected to clash when you reboot the phone. Now my two events are green (as when i rebooted the phone the phone disconnected from the wifi, and my Near wifi is green as well but isnt firing.
 

Olivier D

New member
Mar 29, 2013
3
0
0
Visit site
Olivier

I notice that the two events Near Wifi and Wifi Disconnected to clash when you reboot the phone. Now my two events are green (as when i rebooted the phone the phone disconnected from the wifi, and my Near wifi is green as well but isnt firing.

Maybe because you're still using wifi polling. I don't use it anymore, but I still keep the technic, as of cells that are near my home, I call them Near home. My Near wifi event has two distinct conditions, one when I'm in the range of my home cells (near home) and the other when i'm not connected to wifi. For me it works just like wifi polling!
 

nickmax1

New member
Mar 19, 2013
0
0
0
Visit site
No i dont use wifi polling at all (never have)

My wifi events now look like this:

Wifi connected:
When connected to KNOWN WIFIS - set variable wifi connected to yes, variable wifi on to yes, disable mobile data

Wifi disconnected:
When disconnected from KNOWN WIFIS - delay 1 minute, thn disable wifi if not connected, variable wifi connected = no and enable mobile data

Near Wifi
At Home or Work when disconnected from KNOWN WIFIS - delay 2 minutes then enable wifi, queue an event Wifi Disable (this is a delayed event for 10 seconds, when variable wifi connected = no, then disable wifi if not connected and enable mobile data) - then mobile data off

I have just noticed that my queued event above in my Near Wifi ignores the condition of the wifi connected variable being no. It enables my mobile data regardless!

Not sure why i have those delays yet but i noticed that without them and rebooting there was a clash.
 

Olivier D

New member
Mar 29, 2013
3
0
0
Visit site
No i dont use wifi polling at all (never have)

My wifi events now look like this:

Wifi connected:
When connected to KNOWN WIFIS - set variable wifi connected to yes, variable wifi on to yes, disable mobile data

Wifi disconnected:
When disconnected from KNOWN WIFIS - delay 1 minute, thn disable wifi if not connected, variable wifi connected = no and enable mobile data

Near Wifi
At Home or Work when disconnected from KNOWN WIFIS - delay 2 minutes then enable wifi, queue an event Wifi Disable (this is a delayed event for 10 seconds, when variable wifi connected = no, then disable wifi if not connected and enable mobile data) - then mobile data off

I have just noticed that my queued event above in my Near Wifi ignores the condition of the wifi connected variable being no. It enables my mobile data regardless!

Not sure why i have those delays yet but i noticed that without them and rebooting there was a clash.

Your Near wifi event is delayed, note that because of that delay, its queued event will fire either 10 seconds after the actual event's conditions are met, or 2 minutes and 10 seconds after.

I've noticed that variables don't play well with queued events, I guess they only work when in conditions or actions of an event.

I would suggest for your Near Wifi event (as sometimes you might not be near your known wifis in 2 minutes when entering home or work areas) :
to make it a repeating event and make it turn "wifi off (if not connected)" in a queued event which is already implemented in Llama, no conditions nor variables needed.
 

Attachments

  • media-20130722.png
    media-20130722.png
    57.5 KB · Views: 18

nickmax1

New member
Mar 19, 2013
0
0
0
Visit site
cool - i have deleted all variables -
My queued event in my near wifi does trigger no matter what condition i put in there, so if I put in as a condition "wifi disconnected from KNOWN WIFI" , disable wifi and enable mobile data and then test that queued event it will enable my mobile data even if my wifi is connected.......weird.

more testing needed!