/etc/systemd/system/keyboard-resume.service:
[Unit]
Description=Powercycle the keyboard on system resume
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStop=-/bin/bash -c "/usr/bin/echo '1-1' > /sys/bus/usb/drivers/usb/unbind"
ExecStop=-/bin/bash -c "/usr/bin/echo '1-1' > /sys/bus/usb/drivers/usb/bind"
[Install]
WantedBy=sleep.target
The '1-1' is the address of the keyboard - you have to find your own (note: unplugging/replugging the keyboard will almost certainly change that address),
have a look at the 'lsusb' output and how linux handles usb bus addresses for more info about that.
I plan on testing the keyboard itself on other hardware and OS'es, but for now I'll mark this issue as solved.
]]>Edit:
The keyboard still shows on 'lsusb' after resume even though it is powered off.
dmesg shows no errors when plugging/unplugging the keyboard during normal operation, or during the suspend/resume phase.