I got brownie points from my wife as I set up an automation to auto-magically turn the fan speed down an hour before sunrise. I am finding it is the little thing in HA which are making it worth the time investment.
Can you provide any more details about how you did it? Sounds like I need to do this.
Not OP, but we just installed Caseta/Lutron switches (https://www.lowes.com/pd/Lutron-Caseta-Wireless-4-Speed-1-5-Amp-White-Smart-Touch-Fan-Control/1000790772) and they work like a charm. They do require a bridge, but it integrates pretty easily into Home Assistant.
This obviously wouldn’t work if your fan is hooked up to the overhead light switch. You’d need a box to put in the fan itself.
We have a bedside button (Shelly, I think?) that when we press it for bedtime, it turns off all lights in the house (Hue bulbs and Kasa wall switches), turns off the TV (Kasa outlet), turns up the fan speed (Caseta wall switch), and plays rain noises (Google Home speaker).