Our own Morgan Meis in The Smart Set:
E.T.A. Hoffmann's stories don't make sense. That's how they first work into your brain. “The Sandman” may be his best for that very reason. It's the typical tale of a young dreamer tortured by childhood nightmares/memories of a bogeyman (The Sandman) who turns out to be a friend of the family who tries to steal the boy's eyes and then kills the boy's father. Later the Sandman returns (or does he…?), and sells the young man a telescope that he uses to watch a beautiful girl across the way, the daughter of an elusive professor. The young man falls in love with the daughter and spurns his wonderful fiancé in the name of his obsession. But it turns out that the beautiful daughter is actually a robot and the young man goes mad. Later, his senses revive and he goes back to his fiancé. All are content and set to leave town when they decide to go up to the tower and look down upon their beloved home one last time. They notice a bush moving in the distance. The young man takes out his spyglass and, presumably, sees the robot girl sneaking around in the bush. He goes mad again, tries to push his fiancé out of the tower, and then later thinks better of it and jumps to his own death. At the very end of the story, we learn that the young man's fiancé went on to live in the countryside with her two children and enjoy “that quiet domestic happiness which was so agreeable to her cheerful disposition.”
Thus, the plot. Freud was always a fan of Hoffmann and particularly of “The Sandman.” He made the story a centerpiece of his now famous essay “The Uncanny.” Ultimately, Freud boils the central meaning of Hoffmann's story down to castration complexes and other Freudian whatnot. This is of little interest to us. The idea of the uncanny, however, is. The German word Freud uses is unheimlich — the negation of the word heimlich, which means, basically, “comfortable,” “known,” or more literally, “homely.” Something unheimlich is therefore something uncomfortable.