O'Reilly logo

ESP8266 Home Automation Projects by Catalin Batrinu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required