BAT0 udev rule not triggering

I’m in the process of adding udev rules on my Thinkpad T430s for notifying me of low and critical battery power and have observed via udevadm monitor --property that BAT0 (the main one, not in the ultrabay) sends POWER_SUPPLY_STATUS=Discharging with POWER_SUPPLY_CAPACITY_LEVEL=Low or POWER_SUPPLY_CAPACITY_LEVEL=Critical on which I want to execute a notify-send script and hibernate, respectively. Additionally, I get an udev event with POWER_SUPPLY_STATUS=Unknown when I plug the AC in/out.

For testing purposes, I have then added the following to my system configuration:

services.udev.extraRules = ''
  SUBSYSTEM=="power_supply", ATTR{name}=="BAT0", ATTR{status}=="Unknown", RUN+="${pkgs.coreutils}/bin/coreutils --coreutils-prog=touch /tmp/battery-alert-works"
'';

When I remove the AC plug, I get the following udev event (among other):

UDEV  [4993.129174] change   /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
ACTION=change
DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0
SUBSYSTEM=power_supply
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Unknown
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11100000
POWER_SUPPLY_VOLTAGE_NOW=12170000
POWER_SUPPLY_POWER_NOW=0
POWER_SUPPLY_ENERGY_FULL_DESIGN=39000000
POWER_SUPPLY_ENERGY_FULL=27060000
POWER_SUPPLY_ENERGY_NOW=21660000
POWER_SUPPLY_CAPACITY=80
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=45N1037
POWER_SUPPLY_MANUFACTURER=SANYO
POWER_SUPPLY_SERIAL_NUMBER=  531
SEQNUM=3228
USEC_INITIALIZED=13775261
PATH=/nix/store/ak393pq7cjs60pdbbqa10ncknkyzf4nr-udev-path/bin:/nix/store/ak393pq7cjs60pdbbqa10ncknkyzf4nr-udev-path/sbin

but the /tmp/battery-alert-works is not created as I expect. Am I missing something in my udev rule? Is it incorrectly formatted?

Cheers.

Turns out there is no ATTR{name}, and KERNEL=="BAT0" should be used instead after looking at the output of udevadm info -ap /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0. Applying that change to the rule touches the file in /tmp as expected.