Skip to main content

Use a ESP8266 to control your A/C via MQTT

We had some very (very!) hot days here in Sydney, up to 40 DegC over several days. After a day in the office, you open the door to your apartment and… 50 DegC šŸ™ I looked for a solution toĀ cool down home right after i left the office – with my phone – usingĀ MQTT šŸ˜‰

Hardware

I am using three components for my project. The MCU, an adapterĀ board and the IR-LED

NodeMCU

  • ESP8266
  • 4Mbyte ROM
  • On-board USB/UART

Grove Base Shield for NodeMCU

  • 5 Digital connectors
  • 2 I2C sockets
  • 1 Analog connectors (A0)
  • Power indicator LED

Shop |Ā Wiki

Grove – Infrared Emitter

  • Voltage: 3.3-5V
  • Distance:10m

Shop | Wiki

 

Software

 

The Basics

The project is based on theĀ Arduino core for ESP8266 and uses several additional libraries. I am using the platform.io IDE for development. The advantages are the fully integratedĀ build and deployment process (via USB or over WiFi), the library manager and the code completion and linting. You can download my completeĀ platform.io project here.

You’ll also need an MQTT server like RabbitMQ to send commands and receive the status. If you are familiar with Docker, you should read my previous postĀ Dockerize RabbitMQĀ to get a server up and running in no time. If not: There are several binary pages on the RabbitMQ Website.

Read More