2 Answers
2

It's at least as old as the Sh'la (around 1600), according to Taame Haminhagim, kuntres acharon 94 to paragraph 396, which says in the Sh'la's name, via the Baer Hetev OC 307:2: "Someone visiting his friend on Shabas should not say, e.g., 'good morning' as on a weekday, but rather 'shabas shalom' or 'shabas tov', to fulfill 'zachor es yom hashabas'."

It is prescribed in שער הכוונות (Sha'ar Hakavanos, published in the sixteenth century) in the 7th paragraph here) to announce it loudly upon arriving home on Friday night for the reasons mentioned by msh210.