a relay or other control switch like a MOSFET, connected to;
At the other end of the 2km distance is;
a switch, connected to;
a microcontroller, connected to;
a radio transmitter.
Flick the switch, the microcontroller sees it has changed, and transmits a command over the 2km.
Then it is a matter of physics and component selection.
Many of the radio modules at Little Bird will be able to handle it. Some of them have built-in microcontrollers. Like this one;
Which can do 1.2km easily, and up to 20km with antennas, depending on the environment.
Where there is vegetation, buildings, or terrain, then either height or antennas will help.
You might also be able to buy radio network services from an operator. They’ll be able to recommend specific products to work with their network. For mobile networks, ask about M2M, but watch the pricing.