[TRACKING] Battery flipping between charging and discharging / Draws from battery even on AC

Look at the nonsense that I have had to implement on my AMD F-13 in order to workaround this bug.

I have a Bash script that at boot sets brightness according to power status. The script now contains this:

 local stateToSet='battery'
 [. . .]
 case ${pwr_pc} in
    "${pwr_pc_name[F13]}")
        case ${F13_workaroundPowerBug} in
        true)
            local -i count=0
            local -ir limit=3
            while [[ $(/usr/bin/acpi) == *'Discharging'* ]]; do
                ${pwr_dbg} && dbg_log "F13 detected as discharging: #${count}."
                sleep 5
                ((count++))
                [[ ${count} -ge ${limit} ]] && break
            done
            [[ ${count} -lt ${limit} ]] && stateToSet='ac'
            ;;
        *)
            [[ $(/usr/bin/acpi) == *'Battery 1: Discharging'* ]] || stateToSet='ac'
            ;;
        esac
        ;;
    *)
        [[ $(/usr/bin/acpi -a) == *'on-line' ]] && stateToSet='ac'
        ;;
    esac

It is a blessing and something of a surprise that the program tlp is not affected: at boot it seems to detect the power status correctly somehow (though the bug makes it somewhat unclear even what it is for the status to be correct here!)

EDIT: unlike some others who have commented within this thread, I have not tried the ostensible fix that is the ‘Smokeless_UMAF’ thingy.

EDIT: I fixed an errors within the script. One of those errors was not coping with the fact that my Framework laptop gives data for two batteries, even though only one is installed and, to my knowledge, installable. What is going on there?

I changed it to ENABLE, and nothing happened. Charging wattage(using a USB meter) with 60W, 100W or 20W look almost exactly(at least I can’t tell the difference) the same.
Setting the battery charge limit lower when the battery level is higher still discharges the battery while the USB current 0.01A(no power directly from USB). i.e this so-called BYPASS setting does nothing

Really can you charge at 100W although you say with. I suppose you don’t therefore use the 60W Framework PSU

Just reading back a bit

“it seems to switch to discharging when put under stress then after a few seconds goes back to fully-charged.”

That seems ‘normal’ if the use temporarily requires more than the PSU can provide some will be taken from the battery and so ‘charging’ will begin.

My laptop is set to 78% charge limit and of course

when the limit is set at 80% it flips between charging and discharging it never says charged.

Mine is set to 78% Charge limit and never says ‘charged’ and even when plugging in to power it can take all the 60W for a while and use some battery too. But on Win 11 the icon doesn’t change with it’s 1 sig fig monitor 0.1% but with Ubuntu which I think has more ‘accurate’ reading then even a 0.01% will show such small changes that are not noticable in Win