Hi
I want to create a flow to know how long the power source AC adapter is Connected after power source is disconnected. How can I?
Example
Battery charged for 40 minutes.
Thanks in advance.
Battery counter
Moderator: Martin
Battery counter
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: Battery counter
You need 2 triggers here and a glovar
1)
Trigger=>Power source connected
Action=> Script: glovar = triggertime
2)
Trigger=>Power source Disconnected
Action=> Script: duration = getDurationString(triggertime - glovar)
Action=> Notification
This can be set in one flow with expression: contains(trigger, "triggername")
1)
Trigger=>Power source connected
Action=> Script: glovar = triggertime
2)
Trigger=>Power source Disconnected
Action=> Script: duration = getDurationString(triggertime - glovar)
Action=> Notification
This can be set in one flow with expression: contains(trigger, "triggername")
Re: Battery counter
Hi anuraag
Thanks a lot.
Thanks a lot.
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: Battery counter
hi
how can I remove seconds and milliseconds from "Script: duration = getDurationString(triggertime - glovar)". example = 4m 44s 444ms in this example I want to get 4 minutes only.is this possible? if yes, how can i?thanks in advance.
thanks from record4
how can I remove seconds and milliseconds from "Script: duration = getDurationString(triggertime - glovar)". example = 4m 44s 444ms in this example I want to get 4 minutes only.is this possible? if yes, how can i?thanks in advance.
thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: Battery counter
change getDurationString to getDurationMillis
And add following line
Code: Select all
duration = getDurationString(triggertime - glovar)
Code: Select all
duration = "{duration,dateformat,timezone,UTC,m}"