Building a Low-Power E-Ink Calendar Display with ESP32 and HomeAssistant
GreatScott!
Summary:
This video details how to build a large E-Ink calendar display to replace an underutilized smart home dashboard.
- The old power-hungry LCD dashboard was replaced with a 13.3-inch E-Ink display, chosen for its low power consumption (0.3W) and persistent display.
- The project integrates Google Calendar events via the HomeAssistant smart home platform using its API.
- HomeAssistant processes calendar data, converts it to JSON, and publishes it via MQTT to an ESP32 microcontroller.
- The ESP32 uses a community-developed E-Ink library, includes Over-The-Air (OTA) update functionality, and custom code to sort and display a 7-day agenda.
- A custom enclosure was 3D printed, and the entire system, including a 5V power supply and a Shelly Mini switch for remote power control, was assembled and mounted.
- The final E-Ink calendar provides a functional and aesthetically pleasing smart home upgrade.
Dashboard Replacement Justification [0:00]
The presenter initially had a Smart Home Dashboard (Image 0) which he and his girlfriend found became an "eye sore" due to underuse, as they primarily used the HomeAssistant App on their phones (Image 4).
- Limitations of the old setup:
- The old LCD, touchscreen, and Raspberry Pi combo was overkill for just a calendar display.
- It consumed too much power, up to 10W, which was inefficient for its limited utility.
- Motivation for a new solution:
- They wanted a useful replacement for the old screen that could display their shared online calendar events.
- An E-Ink display was identified as an ideal alternative due to its low power consumption and ability to retain screen information without power.
E-Ink Display Selection and Testing [1:53]
The presenter opted for an E-Ink display to resolve the power and utility issues of the old dashboard.
- Advantages of E-Ink displays:
- Retains screen information when not powered, meaning it only consumes power during refreshes (Image 29).
- Draws almost no current when static.
- Display specifications:
- A 13.3-inch E-Ink display was chosen to cover the existing hole and wall anchors from the previous dashboard setup.
- The display was acquired with an ESP32 development board (Image 41).
- Initial testing:
- Example code was uploaded to the ESP32 board.
- The E-Ink display was hooked up and powered, confirming functionality and acceptable display quality for a calendar (Image 45).
Software Architecture and Setup [3:50]
The project utilizes Google Calendar, HomeAssistant, and an ESP32 for event management and display.
- Google Calendar integration:
- Google Calendar was chosen for its easy sharing features and accessible free API for event data.
- System architecture:
- Instead of the ESP32 handling all data processing, HomeAssistant acts as an intermediary (Image 56).
- HomeAssistant fetches calendar data from the Google API, then processes and sends it to the ESP32 via MQTT.
- This approach allows for calendar management within HomeAssistant and potential future automations.
- HomeAssistant setup steps:
- Enabled Google Calendar API service and integrated it into HomeAssistant using an existing guide (Image 63).
- Created an "eink_calendar_sensor" in
configuration.yaml to grab calendar events (Image 66).
- Verified the sensor successfully retrieved event attributes (Image 68).
- Created an automation to convert the sensor data into JSON format and publish it to an MQTT topic (Image 70, Image 71).
ESP32 E-Ink Calendar Code [5:58]
The ESP32 was programmed to receive, process, and display calendar data efficiently.
- Library selection:
- A community-written Arduino library,
GxEPD2, was chosen over the manufacturer's library for better support and popularity (Image 73).
- A "HelloWorld" example was successfully tested (Image 75).
- Over-The-Air (OTA) updates:
- The
ElegantOTA library was implemented to allow for wireless code uploads via a web server interface, eliminating the need for physical connection (Image 79).
- MQTT integration:
- Code was added to enable the ESP32 to subscribe to the MQTT topic and receive JSON event data from HomeAssistant (Image 81, Image 82).
- Calendar rendering logic:
- The most complex part was sorting events, assigning them to days, and displaying them.
- The goal was a 7-day agenda, always starting with "Today" and "Tomorrow," followed by the remaining weekdays (Image 86).
- This required the ESP32 to grab the current time and date (Image 88), perform additional sorting, and format the output aesthetically (Image 89).
- Further refinement included integrating time sorting, with earlier events at the top and later events at the bottom (Image 92).
Electrical Wiring [7:50]
The power setup was designed for efficiency and convenience.
- Power consumption:
- The entire system, when active, requires approximately 0.3W, with peak current flow just above 100mA (Image 97, Image 98).
- Power supply:
- A small 5V power supply was used (Image 99).
- The power supply was wired to mains voltage (Image 100).
- Remote control:
- A Shelly Mini smart relay was integrated into the wiring to allow the system to be turned on and off remotely via HomeAssistant (Image 102).
Custom Enclosure Design and 3D Printing [8:38]
A custom enclosure was designed and 3D printed to house the E-Ink display and electronics.
- Design process:
- Mechanical drawings of the display were used to create prototype designs.
- The design was refined through several iterations, eventually resulting in three interlocking parts (Image 109).
- 3D printing:
- The final parts were printed using white PETG filament.
Final Assembly and Verdict [9:56]
The components were assembled into the 3D-printed enclosure, and the calendar was mounted.
- Assembly steps:
- The E-Ink display was seated into its indentation.
- A holder piece secured the display with screws (Image 122).
- The ESP32 board was reattached, requiring direct soldering to the 5V and GND pins for power due to USB cable clearance issues (Image 125).
- The ESP32 was secured with hot glue.
- The mains power supply and Shelly Mini were connected to the wall.
- The entire display unit was mounted using existing wall anchors and screws.
- Successful outcome:
- The E-Ink calendar was successfully completed and installed (Image 130).
- The presenter expressed satisfaction with the result, noting its improved utility and aesthetic appeal.