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 iotcentral.eu.

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}  

Here:

  • 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 iotcentral.eu without a local broker. Receiving any message on this topic will trigger ESP8266 ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.