What is the origin of the tradition that Mary lived in Turkey after John took her there? This website says that the last home of Mary, the mother of Jesus, was in Ephesus, Turkey.

Where did this idea originate?
There seems to be only two historical possibilities as to where Mary ended the pilgrim journey on earth: Jerusalem or Ephesus?

Historically, there are proponents to both sides of this question as can be seen in this article on the Tomb of the Blessed Virgin Mary. These two theories do not seem to take into account the solicitude that St. John would have had in keeping Mary safe! We know that Christians were being persecuted at Jerusalem from the very foundation of the Church, so Ephesus is a real possibility. 

From New World Encyclopedia: 


  "Catholic and Orthodox tradition say that John, together with the the Virgin Mary, moved to Ephesus, where both eventually died. According to Tertullian, John was banished (presumably to Patmos) after being plunged into boiling oil in Rome and miraculously suffering nothing from it. Some believe his tomb is located at Selçuk, a small town in the vicinity of Ephesus.
  
  In his Dialogue with Trypho (Chapter 81) Justin Martyr refers to "John, one of the Apostles of Christ" as an eye-witness of Jesus' ministry who had lived "with us" at Ephesus. Irenæus declares that he wrote his Gospel at Ephesus (Adv. haer., III, i, 1), and that he had lived there until the reign of Trajan. Eusebius and Jerome related that John was the teacher of the Papias, the bishop of Hierapolis in Syria. When John was old he is believed to have trained the future Saint Polycarp, bishop of Smyrna, in today's Turkey. Polycarp is thought to have carried John's message and apostolic authority to a new generation, until he himself became a martyr for the faith." 


The visions of Catherine Emmerich seem to be a confirmation of the Ephesian tradition, rather than its' source.