Need help for autosync (SOLVED)

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Mistral150
Posts: 9
Joined: 20 Oct 2013 13:17

Need help for autosync (SOLVED)

Post by Mistral150 » 20 Oct 2013 23:57

Hi.
I need help to get the phone to autosync every hour and stay on for 2 minutes then shutdown all connections.
Thanks.
Last edited by Mistral150 on 23 Oct 2013 22:40, edited 1 time in total.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Need help for autosync

Post by Martin » 21 Oct 2013 14:46

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

User avatar
Mistral150
Posts: 9
Joined: 20 Oct 2013 13:17

Re: Need help for autosync

Post by Mistral150 » 22 Oct 2013 21:06

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....

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Need help for autosync

Post by Martin » 23 Oct 2013 16:17

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.

User avatar
Mistral150
Posts: 9
Joined: 20 Oct 2013 13:17

Re: Need help for autosync

Post by Mistral150 » 23 Oct 2013 22:40

Thank you, it's working great. ;)

User avatar
Mistral150
Posts: 9
Joined: 20 Oct 2013 13:17

Re: Need help for autosync (SOLVED)

Post by Mistral150 » 18 May 2014 01:35

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.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Need help for autosync (SOLVED)

Post by Martin » 18 May 2014 12:01

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

User avatar
Mistral150
Posts: 9
Joined: 20 Oct 2013 13:17

Re: Need help for autosync (SOLVED)

Post by Mistral150 » 19 May 2014 12:20

Thank you. This made me think of another way to do it and it's running fine.

skiptannen
Posts: 82
Joined: 13 Jan 2014 21:39

Re: Need help for autosync (SOLVED)

Post by skiptannen » 19 May 2014 17:10

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

Post Reply