There is electricity
There is a rail in a room
There is a longitudinal groove on the rail
There is electricity in the groove of a rail in a room,
There is a hanger
There is a plug on the upper end of the hanger
The idea is forward and simple.
Put the hanger on the rail it will light on Take it off it will turn off.