MQTT Fan, allow speed range

My fans are hooked up to SmartThings and they use a range, low = 1-33, med=34-67, high=68-99. The app then asks for a “threshold” - I use 33, 66, 99 respectively.

This is all well and good if changing speeds only happens over zwave/SmartThings/HA but if done at the wall, the switch acts like a dimmer so the level might end up at 40 rather than 66 and then HA does not read the speed correctly.