This is a very simple firmware for a ESP8266 (WEMOS D1 mini) based thermostat, using the excellent project Homie for ESP8266. The whole firmware was created in less than a day, so don't expect production quality, though I use it without any issues every day on 5 devices in my home.
- WEMOS D1 mini
- SHT21/HTU21 temperature & humidity sensor
- WEMOS Relay shield
- WEMOS OLED shield
- 220V AC to 5V DC power supply module (not mandatory for the project)
There are no PCB schematics, as its pretty straightforward using the WEMOS shields. Only possible places for mistakes are the buttons and the SHT21/HTU21 sensor. Pins for buttons are defined on lines 76 and 77. And SHT21/HTU21 sensor uses I2C, so it needs to be hooked on SCA and SCL pins of the ESP.
There is a simple Mosca MQTT broker in the "mosca" folder. You can run it by first running npm install
(to install node modules) and then node index
. It expects MongoDB installed and running.
Edit update.sh
to replace deviceid
with the targeted Homie ID. Then run update.sh
in console. The update script expects a compiled bin
binary file inside M-Thermo folder (esp_firmware/M-Thermo/M-Thermo.ino.d1_mini.bin
). You can build & export that file using Arduino IDE: Sketch -> Export compiled Binary
.
Because why not?