Q: Is there a way to stop the blinking white LED?

Q: Is there a way to stop the blinking white LED, that flashes if the battery is full charged?
Phones are Xperia 10, one single SIM/SFOS 3.4.0.24 and one double SIM/SFOS 3.3.0.16.

If I connect the phone to the charger in the evening, after battery is full charged (or already while loading) it begins to blink and this is disturbing in the sleeping room!

Is there a way to stop this by some modification of a config or system file?

1 Like

You can disable led indication for battery full via executing (root not required):

mcetool --disable-led-pattern=PatternBatteryFull

To undo, execute:

mcetool --enable-led-pattern=PatternBatteryFull

The tool can be installed via (root required):

devel-su
pkcon refresh
pkcon install mce-tools

Another alternative is to override default led patterns via installing custom mce config files. The default values and short explanation about format can be found from /etc/mce/20hybris-led.ini.

Note: There is no need to edit existing files. Creating a new file - with higher two digit number in front - can be used to override values defined in already existing files. That is both easier to undo and your modifications will not be lost on the next upgrade.

For example: (without affecting other uses for led) when battery gets full, led blinks red for one minute (root required)

printf "[LEDPatternHybris]\nPatternBatteryFull=40;4;60;500;2500;ff0000\n" > /etc/mce/90-battery-full-hack.ini
systemctl restart mce

And to undo:

rm /etc/mce/90-battery-full-hack.ini
systemctl restart mce
12 Likes

Perfectly explained above.

Here is my config, imitating N900 behaviour (amber blinking while charging, green steady when 100%):

#PatternBatteryCharging=50;1;0;0;0;7f7f00
PatternBatteryCharging=50;1;0;500;2500;7f7f00

7f7f00 = Amber

PatternBatteryFull=40;1;0;0;0;007f00

007f00 = DarkGreen

Best to be done via ssh so mistakes could be easily redone as wrongly editing mce.ini had (still has on SFOS?) possibility to cause some problems.

3 Likes

AFAIK the led patterns for old Nokia devices such as N900 (which would be in [LEDPatternLystiRX51] section) contain binary data that is fed as-is to led controller…

The “hybris” led patterns in [LEDPatternHybris] section (originally Jolla1 led was controlled via libhybris and android led hal, and the name got locked in) are more abstract and thus safer to edit / preferably override. At least I’m not aware of any problems of “device got bricked” level - or how such thing could even be possible.

But do note that this might not apply to all settings, for example lower level led back-end configuration in [LEDConfigHybris] section - if present - is a different ball game → at minimum: after modifying mce configuration, be prepared to restore original state and do not reboot the device until you have checked that the service restart succeeds (e.g. if display blank/unblank with power key works, mce is up and running).

2 Likes

I did the first option with mce-tools, refresh, install and then run the command you described at first. Result is, after reaching 100% the LED does not blink any more but still lights constant white.

edit: therefore I did the 2nd step (printf…, systemctl…). Result is: after reaching 100%, LED blinks red for a minute, then stops blinking and changes to constant white.

That is PatternBatteryCharging which is active whenever device is charging. Differentiating between battery full is done via battery full pattern having higher priority than charging pattern. Which basically means that when battery full pattern is disabled / timeout expires → charging pattern resurfaces. (not sure if it makes sense, just the way it has always been…)

If you disable blinking, then it is possible to define RGB intensity values too, so something like this should make battery full = lowest possible intensity red:

printf "[LEDPatternHybris]\nPatternBatteryFull=40;4;0;0;0;010000\n" > /etc/mce/90-battery-full-hack.ini
systemctl restart mce
5 Likes

Aha, duration infinite and brightness r=1 of 255 , g + b = 0…

It works!!! only a very little red glowing is visible in the dark, this is OK.

Thank you so much!

2 Likes

Toying around with this, on Xperia10 the blinking OnPeriod and OnPeriod settings do not seem to change anything except turning blinking on or off. The frequency of blinking does not really change.

Anyone else seeing this as well?

Example, the following two both do turn on yellow blinking, but look the same:

PatternBatteryCharging=50;4;0;500;2500;ffff00

PatternBatteryCharging=50;4;0;50;3000;ffff00

These “hybris led patterns” can be used to define behaviour that is roughly compatible with android lights hal (ref: Android Hardware Abstraction Layer: light_state_t Struct Reference  |  Android Open Source Project). How that then behaves in practice varies from one device to another. For example RGB colour definition is usable as-is only in devices which actually have a RGB led and some sort of mapping needs to be performed in devices with red-green, amber-green, white, etc leds. In case of Xperia 10: it has rgb led, with hw assited soft blink, which has fixed period → on/off timings in pattern configuration are used only for enabling the soft blinking - what the values are does not matter as long as both of them are non-zero.

1 Like

Perfect answer, thank you.

It there a way to adjust control the blinking frequency globally in some way?
I tried poking around in /sys/class/led/foo but didn’t find anything useful.

Why is this not available from the system settings and atmosphere? It’s more than logical to have it there.

2 Likes

Manny Thanks for thise solutions!!
I think also that the status LED features in a next SFOS versions needs a settings page.

I changed my system so:

darkes yellow, no flash for charging:
printf "[LEDPatternHybris]\nPatternBatteryCharging=50;1;0;0;0;202000\n" > /etc/mce/90-battery-charging-hack.ini

darkes green, no flash for Battery full:
printf "[LEDPatternHybris]\nPatternBatteryFull=40;4;0;0;0;002000\n" > /etc/mce/90-battery-full-hack.ini

to activate:
systemctl restart mce

3 Likes

I changed it to 002000 = green and 202000 = yellow because I am affraid that without flashing the LED lifespan will decrease too much like my first Xperia 10 (no blue any more)

1 Like

Hello - after chrashing my X10II :sob: I have now the X10III but this had a driver proble between SFOS and the RGB LED. The green is to intensive because and Sony had made in the driver for Android a current limiter as a quickfix. This quickfix not exist in SFOS and so we had to reduse the green in all roules with mix colours. I found it here.
In the file /etc/mce/20hybris-led.ini you can see all official colours.

PatternDeviceOn=254;0;0;0;0;0000ff     				        # 0000ff = blue			OK for X10III no green
PatternDisplayDimmed=252;7;0;0;0;001f1f				        # 001f1f = low intensity cyan	not OK for X10III to green
PatternPowerOn=10;3;0;0;0;bfbfbf				            # bfbfbf = grey75		not OK for X10III to green
PatternPowerOff=8;3;0;0;0;ff0000				            # ff0000 = red			OK for X10III no green
PatternCommunication=30;6;0;500;1500;ff00ff		            # ff00ff = magenta		OK for X10III no green
PatternCommunicationCall=25;6;0;500;1500;00ff00		        # 00ff00 = green		OK for X10III only green
PatternCommunicationIM=30;6;0;500;1500;0000ff		        # 0000ff = blue			OK for X10III no green
PatternCommunicationSMS=26;6;0;500;1500;0000ff		        # 0000ff = blue			OK for X10III no green
PatternCommunicationEmail=27;6;0;500;1500;ffff00	        # ffff00 = yellow		not OK for X10III to green
PatternCommonNotification=30;1;0;500;1500;00ffff	        # 00ffff = cyan			not OK for X10III to green
PatternWebcamActive=20;1;0;0;0;7f0000			        	# 8b0000 ~ DarkRed		OK for X10III no green
PatternBatteryCharging=50;4;0;0;0;7f7f7f		            # 7f7f7f = gray50		not OK for X10III to green
PatternBatteryFull=40;4;0;500;2500;ffffff		        	# ffffff = white		not OK for X10III to green
PatternCommunicationAndBatteryFull=29;1;0;500;2500;ffffff	# ffffff = white		not OK for X10III to green
PatternBatteryChargingFlat=50;4;0;0;0;7fbfff			    # 87ceff ~ SkyBlue1		not OK for X10III to green
PatternUserFeedback=9;3;0;0;0;00ff00			   	        # 00ff00 = green		OK for X10III only green

Unfortnatally all mix colours are green on X10III because the LED bug. Also it is not possible to use flashing mode on X10III.
To achieve the correct color for the X10III, you have to halve the middle values ​​for green in the 6-digit hex code (RGB = RRGGBB = ffffff for solid white).
So instead of ff = 255 : 2 = 125 = 7D.
White is also ff7Dff.

Attention, its better to make a backUp from this file and be careful in the /etc/mce folder! Maybe a specialist can make a patch for LED Xperia 10III.

update: 04.06.2025:
Hello, I have create a new mce file for the too bright green LED in Xperia 10III and had copy it in /etc/mce. This correct all colors with green.
Its a normal txt file called “21hybris-led-modX10III.ini”:
The file had follow lines:

PatternDisplayDimmed=252;7;0;0;0;000f1f
# 001f1f=low intensity cyan original
# 000f1f=low intensity cyan adapted on X10III

PatternPowerOn=10;3;0;0;0;bf5fbf
#bfbfbf = grey75
#bf5fbf = grey75 adapted on X10III

PatternCommunicationCall=25;6;0;500;1500;007f00
# 00ff00 = green original
# 007f00 = green adapted on X10III

PatternCommunicationEmail=27;6;0;500;1500;ff7f00
# ffff00 = yellow original
# ff7f00 = yellow adapted on X10III

PatternCommonNotification=30;1;0;500;1500;007fff
# 00ffff = cyan original
# 007fff = cyan original

PatternBatteryCharging=50;4;0;0;0;7f3f7f
# 7f7f7f = gray50 original
# 7f3f7f = gray50 adapted on X10IIIl

PatternBatteryFull=40;4;0;500;2500;ff7fff
# ffffff = white original
# ff7fff = white adapted on X10III

PatternCommunicationAndBatteryFull=29;1;0;500;2500;ff7fff
# ffffff = white original
# ff7fff = white adapted on X10III

PatternBatteryChargingFlat=50;4;0;0;0;8767ff
# 87ceff ~ SkyBlue1 original
# 8767ff ~ SkyBlue1 adapted on X10III

PatternUserFeedback=9;3;0;0;0;007f00
# 00ff00 = green original
# 007f00 = green adapted on X10III
3 Likes

Unfortunately this did not work.

I will test it tomorrow. Did you restart mcetools with systemctl restart mce
Maybe 50% is to less…

1 Like

its work only if I change the real file 20hybris-led.ini. Now I try to rename the additional file 90-hypris-led-mod.ini. I will share the results.

2 Likes

The file name is not the reason. The trick is to add in first line in the additional file this:
[LEDPatternHybris]
But yellow is not easy because the red LED is very dark also with ff.
They start short with full brightness but the they will go to low and soo the yellow is more green. Blue and green make this not. I will test why its so on a X10III maybe a drivers problem.

Here are more details for X10III LED: https://github.com/sonyxperiadev/bug_tracker/issues/772