yashsingh1/xdaforums huggingface dataset:
[Magisk] Uluru25:
sAFE - A MacroDroid based front-end for ACC

edit: new build here

New build 202405121!

(in case you observe issues to change e. g. mcc in the ACC build 202405111)

This is an update to this post. Start reading there to get an idea of the front-end.

SAFE is a MacroDroid based front-end for ACC and provides an alternate way to control almost all functionalities of ACC without the need to use a terminal app.

Be warned: if you expect a stylish app with nice visual gimmicks, stop reading here. This is not what sAFE will provide you!

sAFE is rather like a "swiss knife" - not necessarily nice but full of features: you can control and configure more or less all settings of ACC (and even do some things more)...

Still interested?

Then download the attached macro, delete the trailing ".txt" to have the correct file extension ".macro", import it into MacroDroid and create a widget on your home screen to open it (read the attached file "Steps_to_install_the_front-end.txt" in case you don't know how to do so).

In case you already use a previous build of sAFE, delete or disable the previous build and its widget, import the updated build, create the widget for the new build, and don't forget to define again your preferred path/to/folders if you had modified the defaults.

Changes in the current build:

- implemented new ACC feature to show available features (idle mode, mcc, mcv, tl) of the switches (acc -ss:: see screenshot)

- fixed wrong accd running status shown

- adapted displaying of voltage according to revised acc -i result format

- condense (dis-)charging info if system font size is > 1

- truncated some menu titles

- introduced cluster of "obsolete acc-settings" (for users running legacy ACC builds)

- moved some variables to obsolete settings according to latest ACC build

- some text correction / harmonization

(based on ACC-build 202405111 and

MacroDroid 5.43)

Let me know if something doesn't work or something is missing.

🤠
[Magisk] Uluru25:
Edit: updated here

== New build (202405210) ==

CharLog - a MacroDroid based macro to write some values like batt. temperature, charging current, charging voltage, batt. percentage, selected acc-config parameters, etc. to a. txt file during charging

This post is an update to a previous post here, providing a MacroDroid macro to monitor during charging some related parameters over the time depending on the respective acc settings.

If you want to use the macro, download it, rename it to .macro and import it. Enable the macro in MacroDroid. Then, CharLog will start automatically logging when the charger is plugged.

You need nothing to modify (it should work "out of the box" but in case you want to tweak it a little, there is now a menu available. This menu can be accessed by a widget (this is the only purpose of the widget) or by using the "undefined trigger". If interested more deeply, read the explanations already given in the linked posts and/or see the long comment at the very end of the macro, trying to explain the used variables.

Summary of changes made since the last build:

- widget supported menu implemented for customization

- backup / (automatic) restore of customization settings for easier upgrade process

- option to report also discharging process [always | never | case by case]

- report shows also [Idle] status

- suppress too frequent report lines

- reading of charging current values by acc -i instead using MacroDroid function

- suppress automatic ACC restart if running processes to (background) test charging switches are recognized

Let me know in case of questions, issues, or ideas!

🤠
[Magisk] Uluru25:
== New build 202405230! ==

sAFE - A MacroDroid based front-end for ACC

This is an update to this post. Start reading there to get an idea of the front-end.

SAFE is a MacroDroid based front-end for ACC and provides an alternate way to control almost all functionalities of ACC without the need to use a terminal app.

Be warned: if you expect a stylish app with nice visual gimmicks, stop reading here. This is not what sAFE will provide you!

sAFE is rather like a "swiss knife" - not necessarily nice but full of features: you can control and configure more or less all settings of ACC (and even do some things more)...

Still interested?

Then download the attached macro, delete the trailing ".txt" to have the correct file extension ".macro", import it into MacroDroid and create a widget on your home screen to open it (read the attached file "Steps_to_install_the_front-end" in case you don't know how to do so).

In case you already use a previous build of sAFE, delete or disable the previous build and its widget, import the updated build, create the widget for the new build, and don't forget to define again your preferred path/to/folders if you had modified the defaults (for later updates, you can then use the newly implemented backup / restore function for your settings) .

Changes in the current build:

- revised syntax for applying changes to mcc, mcv, and cdc to fix issues with ACC build 202405111

- revised syntax of profile script lines to work with ACC build 202405111

- implemented check on 1st start of sAFE and option to auto-fix syntax of existing profile script lines to work with ACC build 202405111

- implemented warning for config backups / restorations with ACC builds > 202404260

- fixed idle_threshold not shown in "obsolete acc-settings" cluster

- fixed continued wait time countdown after "direct terminal command" execution

- backup / (automatical) restore sAFE prefs for ease of upgrading

(based on ACC-build 202405111 and

MacroDroid 5.43)

Let me know if something doesn't work or something is missing.

🤠
[Magisk] passionicon:
Folks can you explain or point me to any post where I can see how to power my device directly with charger, bypassing battery, if that makes sense. I already use the module, just trying to see if i can run phone directly on charge power.
[Magisk] Uluru25:
Install acc (latest build), reboot your phone once (maybe not necessary), open a terminal and enter su -c acc -u -f dev (if you are not sure that you already run the latest build).

Plug the charger and run su -c acc -t. Wait for several minutes until testing is completed. Then check the file /data/adb/vr25/acc-data/logs/working-switches.log if there are switches shown starting with an "i" in square brackets (for idle mode). If so, CONGRATS!, your phone supports idle mode. Now, as soon as your phone reaches the pause_capacity (set by su -c acc -s pc=xx where xx is the desired percentage, e. g. 60 for 60 %) , the device will be powered by the charger and no more charged. You can also define apps which if running in the foreground should enforce idle mode. Enter su -c acc -c h ia to learn more.

If you want to manually activate idle mode, enter su -c acc -d and then to leave idle mode, enter su -c accd

Read also here or directly in your config file /data/adb/vr25/acc-data/config.txt or join the dev's TG-group to learn more.

🤠
[Magisk] passionicon:
I'm grateful
[Magisk] Pootis-Man:
Hi, I have a OnePlus 12 since February and it seems idle mode doesn't really work on it. With idle mode enabled, I can see the battery slowly discharge in the AIDA64 app. The amount of mAh slowly decreases over time and after a few hours the battery percentage decreases by one.

The phone I was using before is a OnePlus 8T and whenever I used idle mode all day to game on it, it just stayed at the exact same battery percentage, that's why I find that situation weird with my new phone...

OnePlus 12: You can see the phone has a discharge rate of 0,01 mA; it lost 80 mAh and 1% within 6 hours or so

OnePlus 8T: You can see it didn't lose a single mAh within 2 hours and it has a discharge rate of 0.00 mAh

I've also used BatteryGuru to check the charging rate and for some reason it's always some random low numbers on my OnePlus 12 while my OnePlus 8T has constantly and exactly 0 mA...

OnePlus 12:‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ Oneplus 8T:

I've tried to fix the issue with both force_off=true and thermal_suspend=full as I was advised by the ACC dev, but it didn't change anything unfortunately...
[Magisk] Gapkobob:
Is it possible to edit zip and have it PREconfigured to what i want? Without Termux and etc...
[Magisk] Schmye Bubbula:
I looked around in the zip and didn't see the config file, so maybe it only gets created when acc is run the first time after installation. So I'd say the closest to what you want would be to install it and then directly edit:

/data/adb/vr25/acc-data/config.txt
[Magisk] Gapkobob:
That might be interesting, i will look into it. Thanks!
[Magisk] Schmye Bubbula:
I had been running on the last Nov 2023 acc, and I recently began noticing (although it may have been going on longer) that I would occasionally begin to charge even though I hadn't reached my set lower limit (33%). In other words, I had a working idle charging switch, and I would be idled, running off my charger at or around my set upper limit (40%), and occasionally my charging would start-up out of the blue. (It would still duly stop at or around my set upper 40%.) This recently started happening more frequently, several times a day (or maybe I only just started noticing it), and moreover, these short bursts of out-of-bounds charging would eventually ratchet me up to way beyond my 40% upper limit, so that motivated me to try updating acc (together with motivation from my discovery of sAFE). I uninstalled acc, rebooted, fresh-installed the current acc_v2024.6.2-rc_202406020_1300, rebooted, but, alas, I'm still getting the same out-of-bounds charging several times a day. I'm thinking that it either must have something to do with my charging switch (I *think* acc fresh-install default chose the same one I had before: sm7250_bms/charge_disable 0 1), or else something is wrong with my phone having nothing to do with acc proper. I ran the charging switch tests (deep) and have one more switch that supports idle (sm7250_bms/constan t_charge_current_max 3700000 0), and I changed to that (with not strictly enforced), and now it keeps doing the same out-of-bounds short bursts of charging, but now it often also switches between the two idle-supporting charging switches. What's going on?, and how can I get back to stable idle charge life again?

(Also, are these charging switches supposed to be able to change their names spontaneously? My aforementioned sm7250_bms/constan t_charge_current_max 3700000 0 changed overnight from sm7250_bms/constant_charge_current_max 950000 0.)
[Magisk] sic0048:
Why would a charging switch just stop working all of a sudden????

I am running a older version of ACC (2024.2.25) because it has just worked for me. It has worked since Feb when I first installed it and I haven't upgraded because I don't see a need. (During this process I confirmed that I am still running that version of ACC). I also have not upgraded the OS recently (ie I am not running the June feature release yet).

This morning I woke up to a phone at 100% battery. I also could not get the phone to enter "idle mode" while in the car on the way to work. Now at work, it still won't go into idle mode, so I decided to test my charging switches. The one that has worked all of these months now shows up as "Switch does work, and idlemode=false".

What the heck? This charging switch clearly does not work on any of the three normal chargers that I always use (bedside, car, and work). Again, this particular charging switch as worked for 4 months without any issues on all 3 of those chargers. Now today out of the blue, it doesn't work on any of them.

Any suggestions or ideas why it would just quit working one day out of the blue?
[Magisk] Uluru25:
When you woke up with 100 % charged battery, have, you - by chance - checked if the acc daemon was still running either in sAFE or by starting the wizard with "su -c acc" or by entering "su -c accd,")?

And have you checked if acc created a log file in your download directory? Furthermore, it could be helpful to check the error log (either with sAFE or by entering "su -c acc -l tail".

🤠
[Magisk] Schmye Bubbula:
Very interesting, and troubling, that your long-working charging switch suddenly started testing as no longer working!... I just wanted to add that it is a separate symptom from my problem, because my two switches continue to pass deep tests as working, and also positive for their idle support.... But I think we both share the fragility in general & vagaries of these charging switches. I hope somebody with the know-how will step in here with troubleshooting suggestions. I fear that it will be more than deleting some possibly corrupted prefs file, because, as I said, I had performed a full uninstall & fresh install, so I would think that rules that out.
[Magisk] Schmye Bubbula:
Yes, of course my acc is still running. (My problem has persisted across many phone reboots & checks of whether acc is running.)... I have not been getting any logs in my download directory, but here is my log from sAFE that had the word "tail" in the command.
[Magisk] sic0048:
I do use sAFE and everything seemed to be working as normal. IE ACC was definitely running. I have some shortcuts that send commands to ACC (like ACC -d to start idle mode) and while the system took those commands without errors, they did not work as normal and the phone would not go into idle mode. Even at 100% battery, it was still "charging" at between 500-1000mA instead of "idling" between -20 and +20mA.

Now I don't ever charge my phone to 100% normally, so perhaps it doesn't "idle" at that level, but that doesn't seem right to me.
[Magisk] Uluru25:
... sorry, can't see the cause for your issues.

If you have already tried and excluded hardware related problems (charger, cable) I would recommend you to join the dev's tg-group to seek for more help there.

🤠
[Magisk] Uluru25:
... sorry, seems that I can't help you here. See my recommendation here
[Magisk] iPAQ 6515a User:
Great work. Just a question how do I switch off the auto long-log dumping? My SD card gets a written log every day, and I really don't need it.

Any help here?
[Magisk] Uluru25:
Thx!

Which macro and which "auto long-log dumping" are you referring to?

If you mean the acc-logs-xxx.tgz: these logs are created by the back-end (ACC) and not the front-end (sAFE) and indicate a persisting problem of ACC.

🤠
[Magisk] iPAQ 6515a User:
yeah, those...

does it mean there is some kind of error in my setup? any way to switch those off?

thx
[Magisk] Uluru25:
... unfortunately I can't interpret these error logs. Hopefully the dev can help you...

Maybe he is better available in his tg-group.

🤠
[Magisk] Uluru25:
Edit: updated here!

== New build (202406160) ==

CharLog - a MacroDroid based macro to write some values like batt. temperature, charging current, charging voltage, batt. percentage, selected acc-config parameters, etc. to a. txt file during charging and providing some more functions like "charge complete" or "high temperarure" notifications.

This post is an update to a previous post here, providing a MacroDroid macro to monitor during charging some related parameters over the time depending on the respective acc settings.

If you want to use the macro, download it, rename it to .macro and import it. Enable the macro in MacroDroid. Then, CharLog will start automatically logging when the charger is plugged.

You need nothing to modify (it should work "out of the box") but in case you want to tweak it a little, there is a menu available. This menu can be accessed by a widget (this is the only purpose of the widget) or by using the "undefined trigger". If interested more deeply, read the explanations already given in the linked posts.

Summary of changes made since the last build:

- configurable no. of decimals for volt & amp

- enforce fixed format for volt & amp

- reminder to back-up settings after changes

- configurable notification for charging complete (dynamical based on ACC pause_capacity and/or forced charging (acc -f xx) target setting or at a fixed value)

- configurable temperature warning (dynamical xx ºC before ACC shutdown_temp is reached or at a fixed temperature)

- configurable auto-delete of old log files

- use of ACC lock-file to check if (background) charging switch testing has stopped ACC daemon

- deleted comment describing the variables used in CharLog

Let me know in case of questions, issues, or ideas!

🤠
[Magisk] Uluru25:
== New build (202406260) ==

CharLog - a MacroDroid based macro to write some values like batt. temperature, charging current, charging voltage, batt. percentage, selected acc-config parameters, etc. to a .txt file during charging and providing some more functions like "charge complete", "low charging level", or "high temperarure" notifications.

This post is an update to a previous post here.

If you want to use the macro, download it, rename it to .macro and import it. Enable the macro in MacroDroid. Then, CharLog will start automatically logging when the charger is plugged.

You don't need to modify anything (it should work "out of the box") but in case you want to tweak it a little, there is a menu available. This menu can be accessed by a widget (this is the only purpose of the widget) or by using the "undefined trigger".

Summary of changes made since the last build:

- configurable "low charging value" warning

- fixed "charging complete" notification not working for acc -f (forced) chargings

- fixed showing strange fragments in reportings

Let me know in case of questions, issues, or ideas!

🤠
[Magisk] andyxo:
Hi Uluru25, am looking at your most recent sAFE post which says you based it on ACC-build 202405111. Okay, so I realize I am dumb but I can't seem to find ACC v202405111 which is the version I need to install to work with your sAFE? I think that I am supposed to be looking for a zip file (Magisk Module) on the VR-25 github page but under releases I only see 2023. So I am searching for something that may look like this :

acc_v2023.10.16_202310160.zip but instead acc_v2024.05.111

Please help this dummy out :) BTW, I already have your sAFE downloaded and MacroDroid downloaded so just need the actual ACC module (?) and then all I would want to do is set my Pixel 5 up to stop charging at 80 but not to charge until phone drops below 60 or 70. Am assuming that all the other ACC defaults would be fine? Would this be possible with sAFE or do I need CharLOG too? CHeers :)
[Magisk] Uluru25:
You are

Surely, you are not dumb!

First of all, for this very simple request you don't need sAFE (but you can use it). You can also use the terminal and enter there

su -c acc-s pc=80 rc=70

Regarding your other questions, let me help you this way:

If you run a different ACC version than referenced in sAFE this is not necessarily an issue. I have tried to let sAFE check (and let you know) what will work with an older version and what not.

Secondly, indeed newer versions are available in dev25's telegram group (which is linked in this thread) and not in the github page where you looked. If you hit on "tags" there, you will see more builds but have to manually install them.

In the next sAFE build I will also implement a feature to install "from the scratch" the latest ACC build by using this command I have received from vr25:

curl -sSL https://raw.githubusercontent.com/VR-25/acc/dev/install-online.sh | /system/bin/sh -s dev

If you "dare", you can use this also in a terminal.

And last, you don't need CharLog, but can use it to check if ACC does what you expect it to do.
[Magisk] Zaboon26:
Hello ! First of all thanks for the work. I use acc for a long time now, with ACCA app.

Today I got a new phone (x6 5g aka Garnet)

And I discover that ACCA is outdated.

So I might need some extra help beside all the documentations that I have read.

So today, the situation is;

Costum os blazeproject with Kernel SU for root.

Acc module 2024.6.2-rc

Latest sAFE

I can't set anything up except charge limite and resume.

What I'm trying to get is like I use to have with my pocof3 is the current and voltage limitation, since I'm all day long in my car with Android auto I appreciate keeping my battery around 70 without any "charge and discharge" cycles.

Never get to use idle mode yet but if it's possible I would like to !

If I may, I'll attach some logs I got when I test the switches.

I'm a little confused since it's was so "user friendly" with the front end ACCA.

I'm looking forward to learn how to use acc with terminal or sAFE.

Best regards.
[Magisk] Uluru25:
... let's try to help you!

1. wait until your battery is at or below ~80%

2. then either test unknown switches with sAFE

(PROFILES-&-SWITCHES//test all charging switches option <u>) or in the terminal with su -c acc -t p

3. have patience and don't get frightened if your phone starts beeping etc. during the test - wait until it is finished

4. then either use sAFE (PROFILES-&-SWITCHES//known working switches / features) and upload the result or upload this file: /data/adb/vr25/acc-data/logs/working-switches.log

🤠
[Magisk] Zaboon26:
Hello !

Thank you for your precious insights, I will try this asap !

Edit: here we are ! This seems like none of the switches working. Is that even possible ?

Here are the logs + a screenshot of the sAFE "known working switches" who seems to have different statements..

@Uluru25

Thanks !
[Magisk] Zaboon26:
Hey ! Any clue on what the could be the problem?

I'm considering try another kernel some time tho.
[Magisk] smurfmeat:
In the macro, there is an alarm trigger set for 0300 every day and the "use alarm" setting is active, meaning there is a permanent alarm icon in the status bar and OSD. It goes away if that setting in unchecked. Will it break the macro if I leave it unchecked, since I don't want to have a permanent alarm running?
[Magisk] Uluru25:
... just disable the daily update check in "FRONT-END-SETTINGS//options for daily upgrade checking", this will disable the trigger
[Magisk] smurfmeat:
I'm editing the macro for myself, I still want the update, but I don't need MacroDroid to set a system-wide alarm for it so I unchecked this option. I just want to be sure this won't interfere with any ACC settings, when it's on, it makes the alarm icon stay permanently on the status bar.

Otherwise, this is a beautifully written macro!
[Magisk] Uluru25:
Good idea, I will consider it for the next release! Indeed a check for updates is not needed at a very accurate time... 🤠
[Magisk] Uluru25:
Indeed this doesn't look very promising! If you assume the kernel could be the reason, checking it with a different kernel could help.

I am concerned why the results of "PROFILES-&-SWITCHES//known working switches / features" don't match what is shown in working-switches.log because it interprets this log. Maybe, you didn't repeat the sAFE command after the latest testing of the charging switches?

🤠
[Magisk] Zaboon26:
I'm not sure. If the results are inconsistent, that's not good sign anyway..

Beside, does it matter if kernel su is in "GKI" mode ? I heard that this is some kind of "standard" kernel or whatever, over the device one. Maybe it has something to do ? Did you know anything about the GKI and LKM modes ?
[Magisk] Uluru25:
... unfortunately not, I am using magisk only and the standard kernels provided with the custom roms. Sorry...