I am trying to control 3 different fans and their speeds (fans are a 4 wire PWM computer fan, 12DCV) using brightness_pct and a data template based on certain temperatures. This is to regulate temperature inside of an indoor greenhouse. I am trying to create a data template that will turn a fan onto 20% power when the temperature is between 23-24C and so on for further temperature ranges. Here is what I have but not able to get it to work.
You could also make the speed/dutycycle continuous? I put this together for a bathroom fan. Not exactly the same as your setup, but the principles for mapping a brightness to/from a dutycycle or RPM based on some sensor value should be transferable.
Edit: Just realised my example doesn’t have the temperature mapping. Just the RPM/brightness mapping. But still think a similar approach could be used for that.