Toggle Switch Fan Controller

Never use a lamp dimmer for a fan. You’ll burn out the fan motor, and may burn down the house. Many topics already discussing this.

As far as a toggle wall switch, or a relay, you have to get one that’s rated to control the amperage of the fan. These are often higher than a typical light fixture. If you just want to toggle, you should be able to use a motor control relay inside the switch box (again, check the rating). SmartenIT makes some zigbee ones that should work. This one is on the official “works with SmartThings” list and is good for most ceiling fans: