Magic Mirror: Transforming Home Automation with Raspberry Pi-powered reTerminal DM using Gestures


In the pursuit of a safer, more accessible, and futuristic home experience, a gesture-controlled smart home system was developed. Driven by the need for touchless interfaces during health crises, the project enhances safety and hygiene, addressing accessibility concerns for individuals with disabilities and the elderly. Leveraging the power of Raspberry Pi Powered reTerminal DM HMI, MediaPipe ML library, OpenCV, Home Assistant, and Seeed Studio Xiao ESP32 module, this innovative project envisions a future where homes seamlessly respond to intuitive gestures. Home automation, as showcased in this project, is redefining the way we interact with our living spaces, offering an inclusive, innovative, and delightful living environment

Key Information

Hardware Components:

Software Stack:

  • MediaPipe ML Library: Used for finger detection and counting, turning gestures into actionable commands.
  • OpenCV: Overlaid the home plan onto the real-time video stream, enhancing the user experience.
  • Home Assistant (Supervised Method): The central hub for smart home, managing devices and automation.
  • MQTT Protocol: Facilitating communication between the gesture-controlled interface and the Home Assistant.
  • ESPHome Add-on: Connect the SeeedStudio Xiao ESP32 module with Home Assistant for seamless device integration.


  • Smart Homes
  • Smart Buildings
  • Medical Laboratory
  • Elderly care


One of the primary challenges encountered during the hardware deployment phase was the need for a compact yet powerful solution that seamlessly integrated a camera, large front panel, wireless connectivity, and LAN support while being capable of running Home Assistant (HA). The solution needed to strike a balance between functionality and form factor, ensuring that it met the project’s requirements. The Raspberry Pi, powered Seeed Studio’s ReTerminal DM, emerged as the ideal choice. This hardware provided a compact footprint with a built-in camera, with 10.1” IP65 front panel, wireless capabilities, and LAN connectivity, making it a versatile and efficient platform for the smart home project. Additionally, the compatibility of the ReTerminal DM with the Raspbian OS was a crucial factor, as it allowed for the smooth integration of open-source software components such as MediaPipe and OpenCV. This compatibility ensured a streamlined development process, addressing the challenges associated with hardware deployment and laying the foundation for a robust and efficient smart home system.


  • Gesture Recognition:
    • Implemented hand tracking and finger counting using the MediaPipe ML library.
    • Utilized built-in Pi Camera to capture real-time video feed.
  • Home Interface Overlay:
    • Superimposed home plan onto video stream using OpenCV for intuitive visual feedback.
  • Home Assistant Integration:
    • Installed Home Assistant in supervised mode.
    • Established communication between the gesture control interface and Home Assistant via MQTT.
  • Xiao ESP32 Module Connectivity:
    • Added ESPHome add-on to enable communication between SeeedStudio Xiao ESP32 module and Home Assistant platform.
    • MQTT data from the OpenCV gesture application was transmitted to the Home Assistant platform, and automation events were then relayed to the Xiao ESP32 module for precise device control.

Seeed Studio’s Raspberry Pi Ecosystem

Seeed Studio has been serving the Raspberry Pi user community since 2013 and took the lead to join the approved reseller and design partner. Since the first version of reTerminal in 2021, we have a series of products including reRouteredge controller series, and this year reTerminal DM, serving creators, makers, enthusiasts, students, engineers, enterprises as well as industries, and every scenario needing Raspberry Pi. 

More Resources

About Author


December 2023