If you have the motion sensor light on your steps and it looks like the image below, there is nothing you can do to "fix" it. It's failing. All you can do is remove it and replace it with a new one. They are sealed and once they start having problems, all you can do is replace them.
Mine did something similar to what you are describing. It would come on by itself and it drove us batty. I also hated the thing because it was located right at the steps, facing the front door of the camper. When ever the door was opened from the outside, that light was right at eye level blinding us. I hated that. Couldn't see anything but a blaring light. Why didn't they put the light on the opposite side so when you open the outside door from the outside the light is actually shining on the steps and through the rest of the lower level of the fifth wheel. Nope.
At first, I tried covering the entire thing with black tape. But even with that, light still shone around it. So, I finally pulled it and cut the wires, reinserted it so keep the hole in the wall covered where the wires come through and now it's simply dark all the time. Personally, I hate the thing.
To pull it from the wall you have to remove the black cover. It connected with two plastic tips and more than likely when you remove it, you'll end up breaking one. Then the black cover can be removed easily. Then there are 4 screws holding it in place. It's just that simple.
If you want to add an on-off switch, simply cut one of the wires, go to an automotive store so you are getting a switch for 12 volt DC and not 120 volt AC, and get a simple on-off toggle switch. Drill a hole in the paneling beside the light, fish the wire through and connect it to the on-off switch. Then you can activate the light when you want or leave it dark. It's very simple to do.
If you need replacements, here's an Amazon link. You can also pick these up at any RV dealership parts store, but you may end up paying a bit more. It just depends on your own convenience and time and how fast you want a replacement if you go that way.
click here. Or.... pick up a motion sensor light of your choice. It's only 2 wires to hook up.