I was wondering how smart plugs work, how they can be controlled and how secure they are.

Since they are part of your local network and since they can be controlled remotely even from another network I am expecting they have have some port-forwarding method: do they? If not how can they be controlled from outside?

Isn't port-forwarding a little insecure for controlling these kinds of applications?

Do they use RESTful APIs? If so can I control them using for example Postman?

I checked if the ones I have any kind of API documentation but I could not find anything.

2 Answers 2


Most consumer IoT devices do not use port forwarding, they connect out to a central cloud based Command/Control server.

This is for several reasons:

  • Port forwarding limits the number of devices that can be deployed
  • Port forwarding either requires the owner to be technically capable of enabling it or UPnP to be enabled on the router to open ports.
  • Port forwarding needs the controller to knowing which port is mapped to which device.
  • Connecting out removes the need for port forwarding and works though nearly all firewalls with out without NAT.

The remote connection can either be a long pole HTTP or MQTT or similar messaging protocol.

Some will also have local interfaces to control them from on the same network e.g. Ikea Trafri devices use CoAP locally or Belkin WeMo devices use SOAP


Most smart plugs use cloud providers to toggle the power state of the device, there are a few (big) issues with this:

  1. If your internet is down you can't use it, even if you are on the same network.

  2. (And probably the biggest) data security, what data are these cloud servers able to access, what do they do with the data, what happens if they get hacked, what happens if they get sold?

The easiest and cheapest way to battle both of those issues is to setup a home automation server, you can do this a few ways. Search for either of these:

  • Home Assistant
  • OpenHAB

Then get yourself devices that integrate with them. I would recommend anything that is compatible with Tasmota.

  • If it's a home automation server, you have to open some port don't you?
    – m4l490n
    Jan 5, 2019 at 15:02
  • Yeah for some, you could also setup a VPN, or use home assistant's paid service to setup a secure connection.
    – Falz
    Jan 5, 2019 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.