Thermostat Wiring

I have delusions of possibly making an embedded thermostat solution that tracks energy usage, inside and outside temperature and humidity and possibly online weather forecasts for setting house temperature. For this to work, I need to fully understand thermostat wiring.  It took a bit of looking around the net to identify thermostat wire colors, thermostat terminals and functions, so I thought I would summarize it in a post.

All signals are 24 VAC controlled

Label Code Function Wire Color
R Power (24 VAC) Red
RC Power for Cooling Red
RH Power for Heating (RC and RH may be jumped together) Red
Y Cooling Power to Compressor Relay Yellow
Y2 2nd Stage Cooling Power Varies (Lgt. Blue)
W Heating (Gas, Oil, or Electric) White
G Indoor Blower Fan Green
C Common for 24VAC Transformer Black
O/B Reversing Value for Heat Pump Varies
O Energised in Cooling Mode Orange
B Energised in Heating Mode Dark Blue or Blue (Rheem/Ruud)
E Emergency Heat Varies
X/Aux Back up for Heat Pump or Aux Heating Varies
S1-S2 Shielded Outside Air Temp. Sensor Varies