Integrating Sonoff T1 2CH with Home Assistant for Garage Automation

Hey everyone! I wanted to share my recent project integrating the Sonoff T1 2CH with Home Assistant to control my garage door. It’s been a great learning experience, and I hope my setup can inspire others or provide some tips.

The Goal:
I wanted to automate my garage door using the Sonoff T1 2CH as a reliable and cost-effective solution. The main objectives were to ensure the door only opens if it’s closed, stops when fully open, and integrates seamlessly with a Xiaomi door/window sensor for added security.

The Setup:
I configured the Sonoff T1 2CH with ESPHome, using a YAML file to define the switches and sensors. The key was ensuring the two buttons (open and close) couldn’t be activated simultaneously. I also added automation rules in Home Assistant to handle the door’s state and ensure it doesn’t stay open unnecessarily.

Here’s a snippet of the YAML configuration:
yaml
switch:

  • platform: gpio
    pin: GPIO12
    name: “Garage Door Open Switch”
    icon: “mdi:garage”
    id: open_switch
  • platform: gpio
    pin: GPIO5
    name: “Garage Door Close Switch”
    icon: “mdi:garage”
    id: close_switch

Automations in Action:
I set up automations to monitor the door’s state. For example, if the door is already open and someone tries to open it again, the system ignores the command. This prevents unnecessary wear and tear. The integration with the Xiaomi sensor adds an extra layer of security, notifying me if the door is left open.

Challenges and Solutions:
One challenge was ensuring smooth communication between the Sonoff and Home Assistant. Testing the YAML configuration thoroughly and using the Home Assistant developer tools were crucial. I also had to tweak the automation logic a few times to handle edge cases, like power outages or sensor malfunctions.

Results:
I’m thrilled with how this setup has improved my daily routine. The garage door automation is now reliable, energy-efficient, and integrates perfectly with my smart home ecosystem. It’s also given me a deeper understanding of ESPHome and Home Assistant’s capabilities.

I’d love to hear about your garage automation projects or any tips you might have! Let’s keep the learning and sharing going. :blush: