ESPHome effect controllable by automation

Hi All,

Is there a way to have a effect on ESPHome for neopixel:
green, 1sec, then 1sec nothing then green again 1 sec etc… in a loop

But I want this effect controlling in HA with brightness.
Wanna use this effect when its evening and motion is detected then my wall switch will do the effect. But when it’s night then the brightness must be much lower.

Greets,
Peter