Automate connectivity permissions - High background battery usage

80 views
Skip to first unread message

mike.g...@gmail.com

unread,
May 3, 2021, 7:23:21 AM5/3/21
to Automate
I have been using Automate for some time and find it great fun and useful. I use it on several Android devices including phones and a tablet. Recently, to my surprise I have noted alerts about - "Automate connectivity permissions" having "High background battery usage" on my Samsung Galaxy S21 running Android 11. These have been going on at apparently random intervals for weeks.  No such alerts seem to have appeared on my Samsung tablet or my Sony phone.

Has anyone any suggestions as to what may be going on, and if there is a simple solution to this issue?

I reboot the phone on a regular basis but the alerts continue.

The S21 has two flows running permanently, one to receive and respond to SMS messages, the other to listen out for alerts using "Cloud receive", so it would appear that I definitely need "connectivity permissions".

Though to be honest I am not exactly sure what "Automate connectivity permissions" is doing and how I can simply check which flows/blocks need it.   I am wondering about uninstalling and then reinstalling the "connectivity permissions" but thought I would ask here to get some better informed opinions.

Thanks for your time.

Henrik "The Developer" Lindqvist

unread,
May 3, 2021, 3:27:25 PM5/3/21
to Automate
The "Automate connectivity permissions" app does nothing by itself, it doesn't include any code. Due to Android bugs, the battery usage reported is the same as for the main Automate app.
Awaiting an incoming SMS or Could message should use very little battery, please read:

gangstor188

unread,
May 4, 2021, 8:20:19 AM5/4/21
to Automate
Can a code like this work?


"com.google.android.youtube:id/new_content_count, com.google.android.youtube:id/youtube_logo, com.google.android.youtube:id/menu_item_view,



ส่งจากสมาร์ทโฟน vivo

--
You received this message because you are subscribed to the Google Groups "Automate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automate-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/27a2bd77-82de-4cee-9f41-3e395c2e2fedn%40googlegroups.com.

mike.g...@gmail.com

unread,
May 4, 2021, 12:05:25 PM5/4/21
to Automate
Thanks Henrik.

 The issues mentioned in the link don't seem to apply to the regular flows but I have found another which I run occasionally that had what appears to be an unnecessary "Keep device awake" so I have removed that and will see what happens. 

While reviewing this issue I note that I have several "Delay" blocks which seem to have a default "awake".  As these are generally short delays (say 15 seconds) the awakening does not seem necessary.  However I note that the default seem to have it active.  Would it make sense for me to normally NOT use "Delay" to awaken the device?

Hopefully your advice has helped me track down the issue, it will just take a while to prove it.

Mike

Henrik "The Developer" Lindqvist

unread,
May 4, 2021, 4:05:10 PM5/4/21
to Automate
A Delay should seldom be needed, and never to "poll" some state change repeatedly and indefinitely, except when there's no other way, and then without "awaken device".
Few blocks keep the device awake explicitly, it's up to the flow author to use the Device keep awake block and/or "awaken device" option to do so.

Henrik "The Developer" Lindqvist

unread,
May 4, 2021, 4:07:57 PM5/4/21
to Automate
If you're mean in the UI element id, then no, it's not possible in Automate v1.28 and lower, you'll have to use multiple Interact blocks.
In Automate v1.29 and higher it will be possible using the appropriate XPath expression.

mike.g...@gmail.com

unread,
May 7, 2021, 11:41:25 AM5/7/21
to Automate
Thanks Henrik.

The issue of high battery usage appears to have been fixed by my removing what was an unnecessary Device keep awake block.

I have however now noted some odd timings on Delay blocks but will post a separate thread on that for clarity.

All the best.

Mike

Reply all
Reply to author
Forward
0 new messages