Secondary status light on laptop

I have Dell Latitude 5480 that happens to have a secondary status light on the front (see image) and it sometimes will come on while the laptop is charging, I want to implement a script to control this led (which can in 1 of 3 states white, orange, or black) to blink in a certain fashion to indicate the battery level, does anyone know where the code for this would be and whether it is in the KDE repos or openSUSE repos?
image

It’s going to be part of the system firmware. You’ll have to ask Dell if it’s even possible to access it through software, but it’s unlikely that you’ll be able to. It’s very likely wired only to the electronics.

It’s extremely unlikely that there’s a program in the repos that can do that. If anything, it would be through the i2c interfaces, I’m guessing. But it really comes down to if Dell have implemented a hardware-level interface for software to even access it.

1 Like

if it was in the openSUSE repos then where should i look?

As Jim already mentioned, you’d need access to the bus it is connected to, then assuming that such access exists, you would proceed with creating a custom script.

@40476 It’s a system wide diagnostics LED by the looks https://www.dell.com/support/manuals/en-us/latitude-14-5480-laptop/lat5480_om/device-status-lights?guid=guid-2bd338a4-db1f-492f-a464-d6d4c8643e7a&lang=en-us so I doubt you can control it…

What do you think would be a good place to start?

your most likely right, i did some digging with the links you provided and I dont seem to find any references to software, but i did notice the the light turns orange (amber according to Dell) when it reaches the KDE’s default critical low battery threshhold (has to be the default), that is I asked since it appeared to software controlled (or maybe it was just luck?)

It might just be luck, or it might be reporting a status that KDE can read - but writing to the LED is a different matter. Sometimes access to indicators like that is read-only and hardwired in the system hardware.

@40476 check the output from the upower -d command…

Device: /org/freedesktop/UPower/devices/battery_BAT0
  native-path:          BAT0
  vendor:               BYD
  model:                DELL KCM8279
  serial:               1028
  power supply:         yes
  updated:              Fri 01 Mar 2024 07:09:15 PM EST (23 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    warning-level:       none
    energy:              43.2896 Wh
    energy-empty:        0 Wh
    energy-full:         43.2896 Wh
    energy-full-design:  67.9972 Wh
    energy-rate:         0.0076 W
    voltage:             8.387 V
    charge-cycles:       N/A
    percentage:          100%
    capacity:            63.6638%
    technology:          lithium-polymer
    icon-name:          'battery-full-charged-symbolic'

Device: /org/freedesktop/UPower/devices/line_power_AC
  native-path:          AC
  power supply:         yes
  updated:              Fri 01 Mar 2024 05:32:05 PM EST (5853 seconds ago)
  has history:          no
  has statistics:       no
  line-power
    warning-level:       none
    online:              yes
    icon-name:          'ac-adapter-symbolic'

Device: /org/freedesktop/UPower/devices/DisplayDevice
  power supply:         yes
  updated:              Fri 01 Mar 2024 07:06:15 PM EST (203 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               fully-charged
    warning-level:       none
    energy:              43.2896 Wh
    energy-full:         43.2896 Wh
    energy-rate:         0.0076 W
    charge-cycles:       N/A
    percentage:          100%
    icon-name:          'battery-full-charged-symbolic'

Daemon:
  daemon-version:  1.90.2
  on-battery:      no
  lid-is-closed:   yes
  lid-is-present:  yes
  critical-action: PowerOff
usr_40476@localhost:~> 

@40476 So as you can see upower monitors, if you use upower -m to monitor and unplug from the power there will be output. You hardware is doing the same to trigger the led state.

it keeps quitting immediately after i run the command

@40476 it’s just upower -m

woops, i copied some of the words,

usr_40476@localhost:~> upower -m
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[11:03:08.670]  daemon changed:
[11:03:13.008]  device changed:     /org/freedesktop/UPower/devices/line_power_AC
[11:03:13.009]  device changed:     /org/freedesktop/UPower/devices/line_power_AC
[11:03:13.038]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:13.038]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:13.039]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:13.042]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:13.042]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:13.042]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:13.042]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:13.042]  daemon changed:
[11:03:14.256]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:14.256]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:15.273]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:15.273]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:15.273]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:16.287]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:16.287]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:17.307]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:17.308]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:18.316]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:18.317]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:18.317]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:23.334]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:23.334]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:23.334]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:23.334]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:23.334]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.170]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.171]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.171]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.171]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.172]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.174]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.176]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:32.178]  daemon changed:
[11:03:35.380]  device changed:     /org/freedesktop/UPower/devices/line_power_AC
[11:03:35.380]  device changed:     /org/freedesktop/UPower/devices/line_power_AC
[11:03:35.412]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:35.413]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:35.413]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:35.413]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:36.395]  daemon changed:
[11:03:36.491]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:36.491]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:37.493]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:37.493]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:37.493]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:37.493]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:38.504]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:38.504]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:39.515]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:39.515]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:40.525]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0
[11:03:40.525]  device changed:     /org/freedesktop/UPower/devices/battery_BAT0

@40476 so all you can do is monitor (which upowerd does in the background) to send messages. I doubt there is any control available as it’s all tied into the power circuit.

But with upower -d you can monitor the level and pop something on the screen etc you could even use say python for a tray icon to change color…

darn, well I have a support ticket on the dell website so i guess I will let you know what happens there.

@40476 So some further investigation led (no pun intended :wink:) me to brightnessctl so I can see all the devices and can control whether off/on.

 brightnessctl --list
Available devices:
Device 'amdgpu_bl1' of class 'backlight':
	Current brightness: 78 (31%)
	Max brightness: 255

Device 'hp::hddprotect' of class 'leds':
	Current brightness: 0 (0%)
	Max brightness: 255

Device 'phy0-led' of class 'leds':
	Current brightness: 1 (100%)
	Max brightness: 1

Device 'input0::scrolllock' of class 'leds':
	Current brightness: 0 (0%)
	Max brightness: 1

Device 'input0::capslock' of class 'leds':
	Current brightness: 0 (0%)
	Max brightness: 1

Device 'input0::numlock' of class 'leds':
	Current brightness: 0 (0%)
	Max brightness: 1

@40476 so it looks like you would need to do some coding… This is for a framework laptop https://github.com/DHowett/framework-laptop-kmod

usr_40476@localhost:~> brightnessctl
Device 'intel_backlight' of class 'backlight':
        Current brightness: 3750 (50%)
        Max brightness: 7500

usr_40476@localhost:~> 

…