Many thanks to Bruh Automatiotion for the start of this code as this just a hack together project using his project as a starting off point. https://github.com/bruhautomation/ESP-MQTT-JSON-Multisensor
The code covered in this repository utilizies Home Assistant's MQTT Sensor Component, and a NodeMCU ESP8266 development board.
- SHT31 temperature sensor
- SHT31 humidity sensor
- TSL2561 light sensor
- AM312 PIR motion sensor
- Over-the-Air (OTA) upload from the ArduinoIDE
This code also supports remote uploading to the ESP8266 using Arduino's OTA library. To utilize this, you'll need to first upload the sketch using the traditional USB method. However, if you need to update your code after that, your WIFI-connected ESP chip should show up as an option under Tools -> Port -> Porch at your.ip.address.xxx. More information on OTA uploading can be found here. Note: You cannot access the serial monitor over WIFI at this point.
Amazon Prime (fast shipping)