LED on when ethernet connection to LAN port (LuCI)

I've been setting up my router LED's and got stuck when trying to make my LAN LED's work as intended. LAN 1 seemed to work fine when I set the trigger to switch0 with switch port mask as 2
(I guessed that this meant it was triggering when it it detected something connected to LAN 1, counting the WAN connection as No.1), but I haven't been able to recreate that for 2,3 or 4 which leads me to doubt I understand what I'm doing.

Anyone know how to do this?

Hardware is Archer C7 v5.

It is possible that the port mask is working fine, you just need to identify the correct ports and follow their port numbers. You may want to look up the Switch config in LuCI/SSH and see how ports are configured.

Would this info be of any help?
Sorry, I'm not sure exactly how to go about that.

I can see you only have Wan port plugged in right now. Does any light turn on/blink with Wan plugged in?

I think if you have an option to use switch0 in Led config section then use that.

Just for reference, I have a Tplink Td-W8980 and its LEDs work without any config, I think they are attached directly to the switch. I also have a MR3420 v2 and in that my LED config section adds four config sections for all the LAN LEDs where each section contains just one entry pointed to switch0.

Only is physically connected to its function AFAIK. Nothing lights up when I plug something in WAN, but I configured its light to flash when I receive data in the WAN interface with the netdev trigger.

As I have mentioned above, use the switch0 trigger for your LAN lights, if it is available. If you dont have the switch0 trigger available then you can use the Vlan id e.g. eth0.1 and use it in netdev trigger.

At least on an Archer C7 v2, the "LAN" lights aren't easily controlled by the firmware. They seem to "have a mind of their own" with something, perhaps the switch, "overwriting" changes to the LED state made through the firmware. I've had reasonable luck with the wlan2g, wlan5g, and qss LEDs, and terrible luck with the LAN-port specific LEDs. One symptom I have seen is that even if I try to control the LAN-specific LEDs, there is some kind of "slow-flash" behavior overlaid on them that seems out of control of the firmware.

Maybe something like TD-W8980, the LEDs are attached by the switches so they just turn on automatically as you plug in LAN. There is no config to turn them on or off in firmware itself. I am not sure if this applies to Archer C7 v2 because I have no first hand experience with the device.

if you looks 02_network file, you can see switch port 1 not response for lan1

	ucidef_add_switch "switch0" \
		"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"

2 port is set as lan 1, third as lan 2, etc
maybe you need to set right port mask?