
First thing you should do is to reserve an IP address for your smart plug on your router. For this, you'll need plug's MAC address, which is written on the backside of the device (alternatively you can figure out the MAC address inside the companion Kasa application).
Then you can use tplink-smartplug.py to turn on/off the plug simply like so:
python ./tplink-smartplug.py -t <IP> -c on
which gives the below response:
Sent: {"system":{"set_relay_state":{"state":1}}}
Received: {"system":{"set_relay_state":{"err_code":0}}}
You can also read the real-time power consumption info via (HS110 only):
python ./tplink-smartplug.py -t <IP> -j '{"emeter":{"get_realtime":{}}}'
which gives:
Sent: {"emeter":{"get_realtime":{}}}
Received: {"emeter":{"get_realtime":{"current":0.041124,"voltage":237.504900,"power":9.341753,"total":0.001000,"err_code":0}}}
The nice thing about this plug is that it is operated simply via sending JSON requests, so it can be easily commanded and queried for various information. For example, I'm going to use the above real-time power consumption info for monitoring when my washing machine finishes its job (I'll keep this for next time though).
The final step is to integrate the plug with Domoticz (in my case running on a Raspberry Pi). For this you will need to copy the control script into '~/domoticz/scripts/' and make it executable. This can be achieved via:
cp ./tplink-smartplug.py ~/domoticz/scripts/
sudo chmod +x ~/domoticz/scripts/tplink-smartplug.py
Then you can open Domoticz in your web browser, go to "Setup/Hardware" and add a new virtual hardware of the "Dummy" type. After that click on "Create Virtual Sensors" of the newly created virtual hardware, the bellow popup will appear:

Name the newly created sensor, and select "Switch" as its type. After that you will need to edit the switch and add the on/off actions:
script:///home/pi/domoticz/scripts/tplink-smartplug.py -t <IP> -c on
script:///home/pi/domoticz/scripts/tplink-smartplug.py -t <IP> -c off

That's it! Your switch is now ready.
Related articles:
Home automation with Domoticz, ESP8266 and BME280