Assistance with Template Sensor

Hi All, just after some assistance with creating a template sensor. I have a ceiling fan integrated via LocalTuya however the fan only reports as on or off - and I would like a sensor to monitor on/off/high/medium/low. The fan speed is controlled via set percentages (100%, 66% and 33%) so I was trying to use this data to create the sensor. Any help would be greatly appreciated, I get my head around most aspects of HA however this has got me stumped!