In certain conditions, when I try to turn the phone's screen on by pressing the power button or the home button, the screen doesn't turn on.
Repeat pressing of the button, will eventually turn the screen on.
The soft buttons (back and menu) will turn on.
If I am in a very dark environemnt, I can see that the screen has actually turned on, but on a very low brightness.

The phone is an Samsung Galaxy S3, i9300 running Android 4.3.
The same thing happened when I was using Android 4.1.2.

The problem seems to have something to do with my location. It usually happens when I'm at home, but not when I'm at work.

Does anyone have any idea how to fix this?