Last night I dreamed about living in a haunted house. I would switch the lights on and they would immediately turn off again. Because of the darkness and a bad feeling in my stomach, I was too scared to go into my room (which was downstairs) and ended up staying up all night in the entrance hall next to the door.

Once it was morning I would go to bed. Then I would leave home and spend half the night walking around in the city (which was almost deserted). I didn't feel safe in the city but it was worse at home. There were also some noises (steps) in the attic and the fire would turn on/off in the kitchen. I had a feeling there was someone (a ghost?) upstairs who wanted to harm me.
Is this maybe related to my memories of how scared I was when a burglar tried to break in?