GDOv2-Q and Dry-Contact (Magnet Reed) Switch

I just received two GDOv2-Q to install with my Chamberlain LiftMaster (red button) and add to Home Assistant. I attached a door sensor that I had on hand to input 1 and ground (white dot). In Home Assistant and web interface for the controller, I could see no change to any sensors or any log entry in the terminal window of the web interface. I spent time trying to find information and determine what I did wrong. I then found the GitHub repo at GitHub - konnected-io/konnected-esphome: ESPHome firmware configuration and recipes for Konnected devices for konnected garage door opener and saw " 5. Removes dry contact trigger support*. We feel that this is better handled with a template cover in ESPHome, and this library should focus on the Security+ interaction only."

Once I saw that I was disappointed as I saw the “Optional: Additional Input” section in the Quick Guide and expected to see those two inputs exposed so I could use them in Home Assistant. I have not used ESPHome before but decided to try and see if I could get the sensor to work. I was able to install the ESPHome firmware and determined how to edit the YAML file. I want to know is this the only way to go about getting the sensor to work as it should. I was able to get it to work, but was disappointed that I could not change the alert to the Star Trek theme. I looked in the GitHub repository to see if the theme was there, but I only found a couple of the ones listed in the app, not all of them. Not a big deal but wanted to know if I went the hard route to get the input pins working or could I get them working with the shipped firmware without this song and dance?

Here is the YAML file I ended up with.

####
##
## Konnected Garage Door Opener blaQ (GDOv2-Q)
## Firmware configuration for ESPHome
##
## filename: garage-door-esp32.yaml
## GitHub: https://github.com/konnected-io/konnected-esphome
## Buy Konnected hardware: https://konnected.io
## Help & Support: https://help@konnected.io (support is provided for purchasers of Konnected hardware)
##
## Copyright© 2023 Konnected Inc.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
## files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
## modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
## is furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
## OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
## LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
## IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
##
####

####
# INTRODUCTION
#
# This ESPHome based firmware configuration is designed for the Konnected Garage Door Opener GDOv2-S which is built on the ESP32-S3-MINI.
# The Garage Door Opener retrofits an older style traditional garage door opener with a dry-contact trigger and has the
# following features which are included as packages below:
#
# 1. Wired contact sensor for detecting open/closed state of garage door
# 2. Optical range sensor for detecting open/closed state of garage door
# 3. Emulates a garage door opener button wired to a dry contact relay to open/close the garage door.
# 4. Adds a Garage Door "Cover" entity that is exposed to Home Assistant. The cover entity incorporates the state of the
#    garage door and controls to open/close/stop it.
# 5. Flashes an onboard LED and beeps an onboard piezo sounder as a warning before automatically closing.

####
# GENERAL SETTINGS
# Customize these variables to your preferences and needs
# more: https://esphome.io/guides/configuration-types.html#substitutions

####
# GENERAL SETTINGS
# Customize these variables to your preferences and needs
# more: https://esphome.io/guides/configuration-types.html#substitutions
substitutions:

  ####
  # NAME
  # By default, the name of the ESPHome device is "konnected-xxxxxx" where xxxxxx is a unique identifier. The device's
  # hostname on your network is also defined by the name, defaulting to "konnected-xxxxxx.local". Edit this variable to
  # customize the name and hostname. Note: only lowercase characters, numbers and hyphen(-) are allowed.
  name: konnected-51a990
  friendly_name: GDO blaQ
  project_name: konnected.garage-door-gdov2-q
  project_version: "1.4.0"
  garage_door_cover_name: Garage Door
  garage_light_name: Garage Light
  garage_openings_name: Garage Openings
  garage_lock_name: Lock
  garage_motion_name: Motion
  garage_obstruction_name: Obstruction
  garage_motor_name: Motor
  garage_button_name: Wall Button
  garage_sync_name: Synced


  ####
  # GARAGE DOOR CLOSE WARNING DURATION
  # Duration to blink the warning LED and beep the buzzer before the garage door closes.
  garage_door_close_warning_duration: 5s

  ####
  # ADDITIONAL SETTTINGS
  sensor_debounce_time: 200ms
  blink_on_state: "true"

  ####
  # INTERNAL MAPPINGS
  # DO NOT EDIT these when using Konnected hardware
  uart_tx_pin: GPIO1
  uart_rx_pin: GPIO2
  warning_beep_pin: GPIO4
  warning_leds_pin: GPIO3
  status_led: GPIO18
  input1: GPIO5
  input2: GPIO9

external_components:
  - source: github://konnected-io/konnected-esphome@master
    components: [ mdns, secplus_gdo ]

  # Un-comment below and comment above for local modification
  # - source:
  #     type: local
  #     path: components
  #   components: [ secplus_gdo ]

####
# PACKAGES
# Each package includes a Garage Door Opener feature described
# Remove or comment out any packages that you do not need or want.
packages:

  remote_package:
    url: https://github.com/konnected-io/konnected-esphome
    ref: master
    refresh: 5min
    files:

      ####
      # CORE
      # This package is required and sets up core ESPHome features.
      - packages/core-esp32-s3.yaml

      ####
      # WIFI
      # Enables WiFi connectivity and diagnostics. Uncommet below to enable WiFi.
      # wifi: !include packages/wifi.yaml
      - packages/wifi-esp32.yaml

      ####
      # WARNING LED
      # Enables the onboard warning LED light, with strobe effect. Used to visually warn of garage door automatic closing.
      # warning_led: !include packages/warning-led.yaml
      - packages/warning-led.yaml

      ####
      # PRE-CLOSE WARNING
      # Enables a pleasant and customizable pre-close warning tone  using the onboard piezo buzzer. Used to audibly
      # warn of a garage door automatic closing.
      - packages/buzzer-rtttl.yaml
      - packages/pre-close-warning-tones.yaml

      ####
      # STATUS LED
      # Enables the onboard blue status LED as an activity/error indicator
      # status_led: !include packages/status-led.yaml
      - packages/status-led.yaml

      ####
      # SECPLUS GDO
      # The logic and capabilities of the GDO communication
      - packages/secplus-gdo.yaml
      - packages/debug.yaml

####
# DASHBOARD IMPORT
# Enables automatic discovery and upgrades via ESPHome Dashboard
# more: https://esphome.io/guides/getting_started_hassio.html
dashboard_import:
  package_import_url: github://konnected-io/konnected-esphome/garage-door-GDOv2-Q.yaml@master
  import_full_config: false

####
# LOGGER
# more: https://esphome.io/components/logger.html
logger:
  level: VERY_VERBOSE
  # hardware_uart: UART0 # -- uncomment on batch 2403; not needed on batch 2404 and newer
  logs:
    esp-idf: VERBOSE
    api: VERBOSE
    api.service: DEBUG
    esp32_ble: DEBUG
    esp32_ble_server: DEBUG
    scheduler: DEBUG
    esp32.preferences: DEBUG
    sensor.filter: DEBUG
    rtttl: DEBUG
    cover: DEBUG
    sensor: DEBUG
    ledc.output: INFO
    json: INFO

####
# NATIVE API
# Enables the native ESPHome API
# more: https://esphome.io/components/api.html
# Enable Home Assistant API
api:
  encryption:
    key: "..."

web_server:

esphome:
  name: konnected-51a990
  friendly_name: GDO blaQ 51a990
  platformio_options:
    lib_deps:
      - https://github.com/konnected-io/gdolib#4a55112
    build_flags:
      - -Wl,--wrap=esp_panic_handler

# esp32:
#   board: esp32-s3-devkitc-1
#   framework:
#     type: arduino

ota:
  - platform: esphome
    password: "..."

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Iot Fallback Hotspot"
    password: "..."

captive_portal:

binary_sensor:
  - platform: gpio
    pin:
      number: $input1
      mode:
        input: true
        pullup: true
      inverted: true
    name: Door Sensor
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms

Screenshot of the web interface with the door sensor highlighted

BTW: I’m a noob with Home Assistant and ESPHome.

Screenshot of Home Assistant Dashboard (Yes, I will be changing the names.)

ESPHome Device in Home Assistant

The more I think about this, most likely it was necessary to go the ESPHome route, but I’m wondering if I needed to copy the contents of garage-door-esp32.yaml, like I did or would it have been possible to make my YAML file more streamlined and include garage-door-esp32.yaml in the packages section?

Just looking for feedback on how best to write the YAML file to allow the input pins to function?

Yes, it looks like I was correct. I modified the YAML file. It now looks like this.

substitutions:
  name: konnected-51a990
  friendly_name: GDO blaQ
packages:
  konnected.garage-door-gdov2-q: github://konnected-io/konnected-esphome/garage-door-GDOv2-Q.yaml@master
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: xxxx


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

binary_sensor:
  - platform: gpio
    pin:
      number: $input1
      mode:
        input: true
        pullup: true
      inverted: true
    name: Door Sensor
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms

I still have a couple of questions.

  1. I don’t know why the ESPHome Builder add-on is showing the device name/YAML file as “konnected-51a990-51a990.yaml” and I’m see it as well as a discovered device.
  2. I don’t currently have a need to add the second input, but curious as to how that would be done? Would I copy the whole binary block and change pin number to $input2 and give it a different name or do something else?

I was able to answer the questions.

  1. Not certain how it was entered as konnected-51a990-51a990 and not konnected-51a990, but I was able to get it registered correctly after deleting it and reinstalling the garage door opener from scratch. Now the YAML file and mDNS name is konnected-51a990.
  2. I was able to have both inputs working although I will only be using one. The following YAML file provided both inputs.
substitutions:
  name: konnected-51a990
  friendly_name: GDO blaQ 51a990

packages:
  konnected.garage-door-gdov2-q: github://konnected-io/konnected-esphome/garage-door-GDOv2-Q.yaml@master

esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}

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

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

binary_sensor:
  - platform: gpio
    pin:
      number: $input1
      mode:
        input: true
        pullup: true
      inverted: true
    name: Door Sensor 1
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms

  - platform: gpio
    pin:
      number: $input2
      mode:
        input: true
        pullup: true
      inverted: true
    name: Door Sensor 2
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms

I did resolve both questions that I had. The first question I had, required me to delete the device and start over. The second question that I had was regarding enabling both inputs. Below is my configuration.yaml file. Both inputs are now available.

substitutions:
  name: konnected-51a990
  friendly_name: GDO blaQ 51a990

packages:
  konnected.garage-door-gdov2-q: github://konnected-io/konnected-esphome/garage-door-GDOv2-Q.yaml@master

esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}

# Enable Home Assistant API
api:
  encryption:
    key: "---Your Key Here---"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

binary_sensor:
  - platform: gpio
    pin:
      number: $input1
      mode:
        input: true
        pullup: true
      inverted: true
    name: Door Sensor
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms

  - platform: gpio
    pin:
      number: $input2
      mode:
        input: true
        pullup: true
      inverted: true
    name: Door Sensor 2
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms