do I need both and how tdo they work together, how do i connect a thermostat??