Autogate Open

Dear Home Assistant Community,
I like to set up Ok Google to open my autogate using voice command. May I know what kind of hardware and software is needed to make it to work? Prefer to use ethernet connection to ensure connection reliability.

Appreciate all the advises
Thanks

If you want help with this you will need to offer a lot more specifics such as your gate motor model etc

But, in the absence of this information it’s likely your gate controller works similar to many garage door openers and have an “O/S/C” or “Button” input on the motor which you can “short” to trigger the motor (try this with a small piece of wire first if you wish to confirm functionality). If this is the case you’d easily find a lot of information searching garage door openers. Your challenge being Ethernet connectivity. You’ll either be running long wires for the switch back to the house or similar and put your controller/relay in the house or putting this out in a weatherproof box at the gate, you’ll be able to use an Ethernet Sheild/connected ES8266/ESP32 or Arduino to interface with a relay.

Dear Dewy,
Thanks for the reply. I don’t know how to tell you my autogate system but I attach a picture for your understanding. I don’t mind the long wires as long as stable connection is achieve. I don’t want to use a WiFi connection for it. I greatly appreciate if you can give me a guide on how to do it

Thanks

Olimex has boards that are based on esp32 (esphome :muscle:) and come already with ethernet and relay, for example :point_down:

They also sell nice metal housing for that board (not waterproof) :point_down:

Dear Orange-Assistant,
So now hardware requirement will be

ESP32-EVB

And where do I go from here?

Thanks

The typical way. After you installed esphome on the device :point_down:

You continue your way to the garage to do the hardware installation :hammer_and_wrench:

Did you ever get this setup?
Got one today and looking for a clue.

No. I don’t know how to get started with the instruction. Maybe if you have get it working, you can guide me with a very detail instruction start from the beginning.

Open your Esphome Dashboard
new device >> continue >> name device >> next >> ESP32 >> skip

Edit the project you just created in Esphome Dashboard
use the code below to fill out the project

substitutions:
  id_prefix: esp32-evb
  friendly_name: "Your devices name"
  
esphome:
  name: ${id_prefix}
  friendly_name: ${friendly_name}

esp32:
  board: esp32-evb
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "your encryption key"

ota:
  password: "your ota password"


###CANNOT USE WIFI WITH ETHERNET###
#wifi:
#  ssid: !secret wifi_ssid
#  password: !secret wifi_password


ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 0
  manual_ip:
    static_ip: 192.168.20.25
    gateway: 192.168.20.1
    subnet: 255.255.255.0
# set it static to start.  Remove it later for DHCP.  
    
web_server:
  port: 80
    
switch:
  - platform: gpio
    pin: GPIO32
    name: "Relay32"

  - platform: gpio
    pin: GPIO33
    name: "Relay33"

# SCHEMATIC
# https://github.com/OLIMEX/ESP32-EVB/blob/491a5bd0293f1701bb22a44f905a3a4f08ab760a/HARDWARE/REV-K/ESP32-EVB_Rev_K.pdf

# GPIO MAP
# 0  ethernet
# 1  USB
# 2  USB
# 3  USB
# 5  CAN TX
# 12 IR TX
# 18 ethernet mdio
# 19 ethernet emac
# 21 ethernet emac
# 22 ethernet emac
# 23 ethernet mdc
# 26 ethernet emac
# 27 ethernet emac
# 35 CAN RX
# 39 IR RCV

Save >> Install >> manual download

Connect the device using usb only. Dont do what I did and use a usb cable that only provides power and not IO.
Use the Esphome web installer to install the project you created.

After first install of ESPhome you may connect and make changes using ethernet. If you want to change the IP you man need to set use_ip. This setup will provide a web UI with 2 relay at device ip. You will use API from file to when you connect to HA

EDIT

I forget this was for gate opener. you can replace swtiches in code above with that below. It changes them to momentary. It also adds software interlock to prevent both on at once

switch:
  - platform: gpio
    pin: GPIO32
    name: "Relay32"
    id: Relay32
    on_turn_on: 
    - delay: 500ms
    - switch.turn_off: Relay32
    interlock: [Relay33] 

  - platform: gpio
    pin: GPIO33
    name: "Relay33"
    id: Relay33
    on_turn_on: 
    - delay: 500ms
    - switch.turn_off: Relay33
    interlock: [Relay32]