Template Fan that supports remote with three buttons for speeds, power button, and light button (Broadlink)

I have a Broadlink RM4 Pro. I went through the process of learning the RF commands for low speed, med speed, hi speed, power, and light toggle on the remote for a ceiling fan. I’ve set each one of these up as a separate script in HA.

I cannot figure out how to configure a Template Fan to support these functions. There are various guides and so on that I’ve found, but nothing that seems to address this situation with the current Template Fan implementation (with speeds up to 100).

In particular, I’m not sure how to connect the Scripts I’ve created for each function to something on the Template Fan.

Since the fan remote has a light toggle to turn the fan’s light on/off, I’d probably also like to set up some sort of Light. I don’t know if that can in any way be combined into the Fan in HA — or whether that would even be a good idea. The light is secondary and much less important to me at the moment.

Any pointers on setting up this Fan would be appreciated. Thanks!

Here’s a good starting point Can iFan02 be 'translated' for another fan speed controller? - #4 by finity