Skip to content

Latest commit

 

History

History
86 lines (59 loc) · 4.94 KB

Six-Buttons.md

File metadata and controls

86 lines (59 loc) · 4.94 KB

Button Thermostat from Smart Switch

⚠️Warning⚠️

This project involves line voltage, which can be extremely dangerous and deadly. I am not an electrician or electrical engineer so proceed at your own risk. Always turn off the power at the breaker and double triple check the power is disconnected before touching any wires.

Parts List

  1. A inexpensive smart switch.
  2. A ESP32 which fits in the case. I used a D1 Mini ESP32. (Amazon Link)
  3. DHT22/AM2302 (Amazon Link)
  4. 6X 12x12x7.3mm momentary buttons (Amazon Link)
  5. Prototypeing PCB Board (Amazon Link)
  6. 128X64 (0.96") SSD1306 OLED display (Amazon Link)
  7. KF2510 Wire Connectors (Optional) (Amazon Link)
  8. 4x wire nuts (I reused the ones already in the wall)
  9. 2X #6 screws for the switch
  10. 3D printed case
  11. Hot glue gun
  12. 2X #6 x 1" decorative wall plate screws (colored to match your 3D printed case)

Soldering Components

Case and ESP

In order to fit, the wires need to be soldered directly to the ESP without headers. Then I used some 90o headers to connect to the 3.3V, GND, and switch I/O from the smart switch and hot-glued the ESP32 in place.

I connected the buttons, screen, and AM2302 with KF2510 connectors to make everything easy to assemble and take apart. You could also just solder everything directly but it would probably be unwieldy.

Buttons

I wired the buttons in a pull-up configuration (so they pulled to ground when pressed). In order to fit the case they need to be soldered on a 0.6 in (15.24 mm) grid, which works out to 7 solder points center to center.

OLED Display

In order to get the OLED display to fit into the case, I de-soldered the header pins from the board and just soldered the wires directly onto the back.

OLED

Case

The case was designed in Alibre Atom 3D. I've included the original file as well as the .stl and STEP files if anyone wants to modify them. I printed mine on my Ender 3 Pro in black PETG. You can print it either face up or face down. Face up requires a lot more filament for supports but gives you a better front surface.

case

Putting It All Together

I like to try and make things as re-usable as possible so I prefer to use hot glue to hold everything together.

Before gluing or closing anything up, it's always good to do a quick test to make sure all your connections are secure.

⚠️ When testing using line voltage, always put wire nuts over any unconnected wires (switched wire) and never touch any exposed connections! ⚠️

Installing It On The Wall

As I am not an electrician, I don't want to give detailed instructions on how to install the high voltage aspects. The basics of installing the thermostat are:

  1. ⚠️ Make sure the power is turned off at the breaker ⚠️
  2. ⚠️ Check again that the power is turned off ⚠️
  3. ⚠️ Use a non-contact voltage tester to make sure theres no power! (Seriously this is important!) ⚠️
  4. Connect the wires appropriately.
  5. Screw in the switch
  6. Connect the 3.3V and data cables to the components in the 3D printed case.
  7. Screw on the 3D printed case
  8. Cross your fingers & turn back on the power

YAML Configuration

You'll need to set the substitutions at the top of the YAML file before you flash using ESPHome. You'll also need to set your wifi_ssid, wifi_password, api_encryption (key) and ota_password in your secrets file. More information on the secrets file is in the ESPHome documentation

Thermostat Operation

  • The thermostat will work even when disconnected from Home Assistant.
  • The large number is the current temperature and the small number is the set-point.
  • The thermostat will toggle between the radiator off and radiator on symbol depending on it's state.
  • The thermostat will display the flame icon while the heater is running.
  • The thermostat will display the clock icon if the timer is running.

There are six buttons, I currently have them set to:

Temperature up (by 0.5 o) Toggle On/Off 30 minute timer
Temperature down (by 0.5 o) Toggle preset (Toggle between 69o and 77o ) 1 hour timer