@pianopaul I did what you have quoted but illumination changes only when the physical button is pressed.
@Flodder have you tried changing the LED mode as indicated in the Nanokontrol2 settings guide?
I have the Nanokontrol1 and this function is not available so I can not test it.
Below is a translation of the French version explaining how to trigger the illumination from a computer:
This mode allows you to determine when the LEDs of the transport buttons and the SOLO, MUTE and REC buttons turn on and off. The following setting allows you to specify what the button LEDs indicate.
LED Mode [Internal/External]
This setting determines the role of the button indicators.
Internal The button’s LED is on/off to indicate its on/off status.
External The button LED responds (turns on/off) when the control command or note message assigned to that button is transmitted from the computer. The light turns on when an “On Value” or “Note On” message is received and turns off when an “Off Value” or “Note Off” message is received.