They've not marked the ground wires in the diagrams. Your current wiring scheme corresponds to the top diagram.

You need to check what those white wires do in your wall boxes. If they're neutral wires then the primary switch in the diagram would be wired between the black wire that came from the auxiliary and one of the white wires with the output going to the bulb.