Here is an Ngram chart comparing the frequency of occurrence in published works of the phrases "played piano" (blue line), "played the piano" (red line) and "played a piano" (green line) for the period 175–2019:
The chart indicates that none of the three wordings were especially frequent until the early 1800s, at which point "played the piano" began a steady 120-year ascent, followed by a 30-year dip, followed by another period of increased frequency. For its part, "played piano" became increasingly (although somewhat irregularly) more frequent over the course of the twentieth century, after registering a low frequency throughout the nineteenth century.
The earliest Google Books matches for "played piano" involve instances where the phrase is not equivalent in meaning to "played the piano." For example, from "State of Music on the Continent," in The Quarterly Musical Magazine and Review (Autumn 1823):
March, 1823. On the 20 there was a concert for LEOPOLDINA BLAHETHA, 12 years of age, who played piano variations with orchestral accompaniments, composed by herself. This child merited and received (as usual) much applause.
Here, "played piano" is part of a longer phrase, "played piano variations"—that is "played variations on [the] piano." Elsewhere in this volume, a writer describes a child who "played the piano forte," and the periodical's usual wording for the instrument is "the piano forte," occasionally reduced to "the piano."
And from Tour in Holland in the Year 1819 (1824):
The tones of the organ are very powerful, and when played piano very sweet, but the sound of that at Trent seemed to me, on recollection, to be preferable.
Here, the meaning of piano is "softly" (a complication of "play piano" noted in gabriellapax's answer). Multiple early Google Books matches for "played piano" have this meaning.
The earliest instance I've been able to find in which "played piano" carries the same meaning as "played the piano" is from a note dated March 26, 1843, in "Henri Heine About Music and Musicians," in The Music World (August 7, 1858):
The acquisition of Herr Pixis must have been some compensation to the French. He played piano, composed, too, very neatly, and his little musical pieces were particularly valued by the bird-sellers, who teach canary-birds to sing on hand-organs.
The phrase "played the piano," meanwhile seems to have been firmly established by the early decades of the 1800s. For example, from "Miss Paton," in Pocket Magazine (November 1822):
When only two years old she could name any tone, or semitone, on hearing it sounded—which was frequently ascertained by musical professors at the time. When four years of age, she played the piano, and a small harp, and also sung not only with some execution, but with a style peculiar to herself.
Over the past century, "played piano" and "played the piano" appear most frequently in situations where they could be used interchangeably. For example, from Julie Coryell & Laura Friedman, Jazz-Rock Fusion: The People, the Music (2000):
Miles, the son of Miles Dewey Davis II, a successful dentist and dental surgeon, and a mother who played piano and violin, moved with his family to St. Louis when he was one. Miles's father was a landowner as was his father before him.
And from Julie Coryell & Laura Friedman, Jazz-Rock Fusion: The People, the Music (2000):
I started playing the guitar when I was twenty. I was in college studying psychology and I suddenly realized that the guitar was my instrument and that I wanted to play, so I got a teacher and changed my major to music. I played the piano when I was five, hating every minute of it.
There are certainly some instances where "played the piano" refers to playing a particular piano that has been identified earlier in the same text. That may be what is going on here (from the same book):
There was music in the house all day. I had a sister who played classical piano and sang spirituals. My mother played the piano by ear and I had a brother who played the bass and tenor.
and here (same book again):
I began my involvement with music when I was seven years old by learning to play piano. This was at the encouragement of my mother who also played the piano, and I learned to play piano and learned music theory.
For the most part, however, in present-day English, "played the piano" means "played a type of musical instrument called a piano"—as does "played piano."