Adjust TP-Link dimmer switch brightness independently of on/off state?

My TP-Link HS220 is in my bathroom off of my bedroom. I want to schedule it so between the hours of 10 PM and 6 AM, if I turn the light on, it will be at a specific brightness (but only if the light is on). Essentially, I want to preset the brightness, similar to using the physical dimmer buttons on the switch itself. I know it’s technically possible with the switch somehow, as I’m currently using Yonomi to do just that (but I’d like to have everything under Home Assistant). The Amazon Alexa app also has the option to set the brightness while ensuring the power stays off.

I’ve been using Node Red, and I tried setting it to detect when the light state changes to “on” and if it’s after 10 PM, then automatically adjust the brightness to something like 20%. This doesn’t work, though, as there’s a 40 second delay from the time when the light actually turns on until the time HA receives the state changed event (I’ve got another open topic about this same thing).

Then, I tried setting it so at 10 PM, the brightness is set to 20% and then the light is turned off right after. Except that causes the light to flash off and on which is annoying.

Is there anything I can do?

I have the same dilemma with my home office lights. If I start my workday early, I’d like the brightness to be low when I first turn on the light in the morning. In other words, a brightness preset like you mentioned would be awesome without having to change light state to on.