control 12 V fan via Vera/Arduino

I want to control a 12 V fan using a scene on my vera. When temp or humidity exceed X I want to be able to turn the fan on and vary it's speed based on the those variables. I have been thinking about this for a while looked at a lot of posts and youtube vids. I can't seem to get my head around the way to do it. Any ideas would be appreciated. I have built several sensors and relay controls for mysensors so I have a rough idea of how his stuff works.

@scottdube the key for the speed control is to use a PWM signal. To control the fan, i would either use a mosfet or an h-bridge controller. Use an h-bridge if you at any time think you would want to run the fan in reverse. The mosfet or h-bridge will take the 12v needed for powering the fan and the 3.3v or 5v PWM signal from the arduino to control the fan.

Just doing some looking at the serial API pages, I think you would want to present the fan as a S_DIMMER with V_PERCENTAGE. I am not sure if you are on UI5 or UI7 for your Vera, but it looks like you should see something like this (UI5 example)
I don't know if you can change the icon or not though.