ESP8266 code specifications

The requests for the ESP8266 code and you need to subscribe to topics:

/<TOPIC>/plug/command or <TOPIC>/plug/command

In this case you connect the ESP directly to

The required message to be received by the ESP8266 in order to trigger its GPIO 12 is:

{"device_name":"ESP_3A9108", "type":"plug", "state":1}  


  • Device_name: Is the device's name that we want to trigger.
  • Type: Is the type of device. In this case it is plug.
  • State: Is the desired state of the GPIO 12. In this case, we want to change the state to ON.
/<TOPIC> /status/update or <TOPIC>/status/update

In this case, there is direct connection to without a local broker. Receiving any message on this topic will trigger ESP8266 ...

Get ESP8266 Home Automation Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.