How to wire fan (with ground and 12v cables) and power to automation phat?

leading off from my last question how would i wire up a fan and 12v power supply to the automation phat? and what code would i use?

Hope this helps with the wiring!

You can join the negative wire from your fan straight to the negative on your power supply. Feed the positive from your power supply to the common on the relay, then from the ‘Normally Open’ go to the positive of your fan.

When the relay is activated with the correct spell / incantation / sourcery, the fan should spin!

I forgot to mention that it doesn’t matter which way round the NO or COM contacts are used, as it is just a switch to make or break the circuit.
The diagrams show both ways…

Thanks that’s FANtastic (pun intended)