Welcome!
Could you use the Home Assistant WLED Integration? Then you can use Automations to do what you want.