Main Content

ESP32 and Toit: Integrating Home Assistant through MQTT

In this tutorial, we’ll have a look at how we can create an MQTT sensor for Home Assistant with ESP32 and the Toit platform. Home Assistant is one of the largest open-source platforms for home automation and is very popular for managing things through IoT. Toit on the other hand provides an excellent platform for building and deploying IoT applications with very little effort. Toit recently released the support for MQTT protocol and we’ll be using it to send temperature and humidity values coming from an SHT31-D sensor. The data will then be displayed in Home Assistant in interactive cards with the graphical format. Finally, we’ll also send a high-temperature notification alert through the Home Assistant’s mobile phone app.

Pre-requisites
- A Home Assistant server
- Home Assistant companion application installed in your Android/iOS phone

Gathering the components
- ESP32-WROOM development board
- Adafruit’s SHT31-D sensor
- A micro USB cable for connecting ESP32 to PC
- Breadboard and connecting wires”

Link to article