I bought one a few years back (I think at Wal-Mart) that you just screwed into the light bulb socket and then screwed the light bulb into it. It works just fine and I've been using it for years to turn on the light in the closet every time I open the door. I think I paid about $15 bucks for it.
If you just want something to 'Plug and play'? As the above <
formatting link
> site indicates you will pay somewhere between $25 and say $60 dollars for something you can just plug into the wall outlet. And it may have the capacity to operate several lamps? Maybe that's more capacity and size than you want? However; "don't look a gift (horse) in the mouth"! The other freely provided suggestions are useful! For example; you could screw that $15 bulb gadget into something, plug that something into an outlet and plug a table lamp into that adapter/sensor? It all depends if you can be a bit ingenious, how much you want to spend and how simple and or unobtrusive you want it to be etc.?
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.