Software and casing for a small device that works with ESPHome / Home Assistant to capture temperature and hudity and display it locally. Includes a button to toggle screen saver / lights out mode.
More on this project on my blog ESPHome Temperature and Humidity with OLED Display
This setup assumed you are using ESPHome through Home Assistant. If you are using ESPHome directly, the directions are likley close enough.
- From the ESPHome web interface in Home Assistant, select "+ New Device" (the green button in the lower right corner)
- From the "New device" dialog, you will be asked to select the first-time install method, "OPEN ESPHOME WEB" or "CONTINUE", these directions assume you continue via Home Assistant.
- In the "Create configuration" dialog, provide a name for this device
- In the "Select your device type", select the board you are using (we assume ESP8266, others may work)
- You should see a "Configuration created!" dialog, with the options to "SKIP", or "INSTALL". Select "SKIP"
- In the ESPHome web interface, find your device and select "EDIT". You should see pre-existing content that looks something like this:
esphome:
name: tho-tutorial
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "[random chracters that are your key]"
ota:
password: "[random characters that are your password]"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "THO Fallback Hotspot"
password: "5EKR17"
captive_portal:
- Append the following to your file and modify as you please (copy from "substitutions" section for latest options)
substitutions:
friendly_name: "THO Tutorial"
area_name: "Garage"
display_in_fahrenheit: "true" # visual display only, calculation and sensor to HA always in Celsius
temperature_calibration_offset: '0' # step 1, degrees added to temperature (negative to subtract)
temperature_calibration_multiply: '1' # step 2, multiplier for temperature
humidity_calibration_offset: '0' # step 1, percent (100 basic points) added to humidity (negative to subtract)
humidity_calibration_multiply: '1' # step 2, multiplier for humidity
packages:
bdurrett.esphome-temp-humid-OLED: github://bdurrett/esphome-temp-humid-OLED/temp-humid-OLED.yaml
- In the
esphomesection of your config, add an entryname_add_mac_suffix: trueif you want the MAC address added to each device name (generally for bulk installs) - In the
esp8266section, comment out the board if it is notd1_mini(if you see errors about references to D6, D5, D1, or D2, this is the board not recognizing NodeMCU pins.
FIXME TODO: Maybe add a narrative (that said, diagram is self explanatory)
- ESP8266 board, any should work, the ESP-12F is nice and tiny and fits the 3D printed case
- SSD1306 OLED display, other types may work, I used this one
- 6mm button (momentary switch), I used these
- A 10 K ohm resistor (for pull down)
Wiring diagram created with Fritzing
I finally got around to tuning up my 3D printer and making a model. The case can be a bit tight... I'm using 30 gauge wire, anything much thicker might be a beast to work with. The button used is 6x6mm, the OLED matches the one linked, above.
- Temperature (and humidity) seems higher, possibly heat from components influencing the ratings? Add configurable offsets to calibrate once good readings are known.
- Preceed the sensor labels with the friendly name


