Page 1 of 1
Need help for autosync (SOLVED)
Posted: 20 Oct 2013 23:57
by Mistral150
Hi.
I need help to get the phone to autosync every hour and stay on for 2 minutes then shutdown all connections.
Thanks.
Re: Need help for autosync
Posted: 21 Oct 2013 14:46
by Martin
Hi,
Following flow can be used to turn auto sync on once an hour for two minutes:
-trigger Periodic Timer: every 1h
-action Set Auto Sync State: On
-action Sleep: 2m
-action Set Auto Sync State: Off
Regards,
Martin
Re: Need help for autosync
Posted: 22 Oct 2013 21:06
by Mistral150
Thank you very much.
I added this to the flow to save battery...
-trigger Periodic Timer: every 1h
-action Set Mobile Datanetwork State on
-action Set WiFi State on
-action Set Auto Sync State: On
-action Sleep: 2m
-action Set Auto Sync State: Off
-action Set Mobile Datanetwork State off
-action Set WiFi State off
But at periodic timer, how do I set (dont wake device )
and for sleep keep awake or no.
Sorry for my bad english, hope you understand....
Re: Need help for autosync
Posted: 23 Oct 2013 16:17
by Martin
Enable 'Wake device when in sleep mode' in the trigger when you want to ensure that the flow is executed every hour, otherwise the flow might be called later when you wake your device with the power button (or your device is woken up by some other means like an incoming call etc.).
Enabling the option 'Keep device awake' in the sleep action will ensure that your device stays active for two minutes while the flow executes. Please enable this option in your flow.
Re: Need help for autosync
Posted: 23 Oct 2013 22:40
by Mistral150
Thank you, it's working great.
Re: Need help for autosync (SOLVED)
Posted: 18 May 2014 01:35
by Mistral150
Anyway to prevent the flow to execute when screen ON so it only sync while I don't use the phone. Some sort of condition like... Run only when screen off.
Thanks.
Re: Need help for autosync (SOLVED)
Posted: 18 May 2014 12:01
by Martin
Hi,
The simple solution would be to add a condition Screen On and only execute the rest of the flow on the false-branch:
-trigger Periodic Timer: every 1h
-condition Screen On
--> false: -actions to sync
Another approach is to disable your sync-flow when the screen is on. This solution is slightly more complex but has the added benefit that the sync-flow will wait one hour after the device has been in use.
Flow: Disable SyncFlow Flow:
-trigger Display State: On
-action Set Flow State: Disable SyncFlow
Flow: Enable SyncFlow Flow:
-trigger Display State: Off
-action Set Flow State: Enable SyncFlow
The actions assume that your flow is called SyncFlow. You can group the three flows into its own flow group which helps to keep the flow list clear. To do this, go to the flow list, select the menu on each flow and select Move to Group, New... and select a name for the group. You can also select the flows by long-clicking one flow to start the multi selection mode, then select the two other flows and then using the folder icon in the action bar to move all three flows into a new group at once.
Regards,
Martin
Re: Need help for autosync (SOLVED)
Posted: 19 May 2014 12:20
by Mistral150
Thank you. This made me think of another way to do it and it's running fine.
Re: Need help for autosync (SOLVED)
Posted: 19 May 2014 17:10
by skiptannen
This routine looks like a promising way to eke out a little more battery life. I would be very interested in finding out how much of a difference it makes for you.
Thanks.
skip