DIY $23-55 alternative to MyQ

Frustrated that MyQ is now blocking Home Assistant, I thought I would try coming up with something on my own.

I started mentioning my project on this post: Removal of MyQ integration - #123 by briadelour

Here is the full detail.

Two items I purchased:

Ewelink wifi smart relay (1CH version, KR0548-1CH) $9.99 - https://www.amazon.com/gp/product/B0C7QQHMCX/?th=1

Sonoff wifi door sensor (DW2-L model) $12.99 -
https://www.amazon.com/gp/product/B08BC98RKR/

Modified LiftMaster 883LM to adapt Security+ 2.0 yellow button garage door opener to work with dry contact - Ebay modified switch for $29.97 I could have saved a few bucks as I found the instructions online on what needed to be soldered to modify the 883LM. It was just easier to buy the modified one on Ebay and it worked out fine. If you don’t have a Security+ 2.0 garage door you might not need this part as you might be able to tap the dry contact on the garage door opener directly or to a wall switch to connect to the relay.

Other parts:

  • I had a USB wire and 1A 5V old phone charger that I plugged into an outlet off a light socket
  • I also had spare low voltage wire used for the garage door sensors that I was able to run from the dry contact output to the relay. On the relay I’m using Normally Open (NO) and Common (COM)
  • I also had a spare outside outlet box lying around, but experimented with other housings as well.

My plan is to leave the MyQ in place for Amazon in-garage deliveries and maybe if the car app integration looks promising for the future. In the meantime I wanted to restore the functionality I had by opening and closing the garage door in HA as well as Apple CarPlay and see what else I can do.

I’m pretty happy with the result. I can now control my garage door from HA, Apple Home, Apple CarPlay, and Alexa without paying for any subscriptions.

I could not have done it so easily without this HACS integration that works great! GitHub - AlexxIT/SonoffLAN: Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant

All I had to do was set up the two devices in the ewelink phone app, install the HACS integration above, then add this to my configuration.yaml

In the eWeLink app I configured the device to act as a switch, enabled LAN control, and turned on the inching settings set to 0.5sec. This gives me a chance to toggle the switch just log enough to make the contact to act as if the button was pushed.

sonoff:
  username: !secret sonoff_username
  password: !secret sonoff_password
  scan_interval: 60 #(optional, lower values than 60 won't work anymore!)
  grace_period: 600 #(optional)
  api_region: "us" #(optional)
  entity_prefix: True #(optional)
  debug: False #(optional)

Once I got the entities to show up in HA, the rest was easy.

The finished HA Card on my dashboard looks like this . . .
With the door closed:

With the door open:

type: entities
entities:
  - entity: switch.sonoff_1001exxxxx
    name: Virtual Garage Door Button
    icon: mdi:remote
  - entity: binary_sensor.sonoff_1001dxxxx
    name: Garage door sensor
  - entity: cover.garage_door
  - entity: sensor.sonoff_1001dxxxx_battery
  - type: weblink
    name: last garage door snapshot
    url: >-
      http://X.X.X.X:8123/media-browser/browser/app%2Cmedia-source%3A%2F%2Fmedia_source
title: Garage
state_color: true

I’m using a very old IP camera that FTPs screenshots on motion to the /media folder on my HA. GitHub - hassio-addons/addon-ftp: FTP - Home Assistant Community Add-ons

This is how I set up the Cover in my configuration.yaml:

cover:
  - platform: template
    covers:
      garage_door:
        device_class: garage
        friendly_name: "DIY Garage Door Button"
        unique_id: DIYgaragedoor
        value_template: >
          {% if is_state('binary_sensor.sonoff_1001dxxxx', 'off') %}
            false
          {% else %}
            true
          {% endif %}
        open_cover:
          - condition: state
            entity_id: binary_sensor.sonoff_1001dxxxx
            state: "off"
          - service: switch.turn_on
            target:
              entity_id: switch.sonoff_1001exxxxx
        close_cover:
          - condition: state
            entity_id: binary_sensor.sonoff_1001dxxxx
            state: "on"
          - service: switch.turn_on
            target:
              entity_id: switch.sonoff_1001exxxxx
        stop_cover:
          - service: switch.turn_on
            target:
              entity_id: switch.sonoff_1001exxxxx

Also modified the blueprint I got from here to work with a binary sensor: 📸 Send camera snapshot notification on motion

Modified blueprint:

blueprint:
  name: Send a camera snapshot when motion is detected
  description:
    "This automation blueprint creates a camera snapshot if motion is detected  and
    sends a notification to your phone with the picture.

    "
  domain: automation
  input:
    binary_sensor:
      name: Binary sensor
      description: The sensor wich triggers the snapshot creation
      selector:
        entity:
          domain: binary_sensor
          device_class: door
          multiple: false
    camera:
      name: Camera
      description: The camera which creates the snapshot
      selector:
        entity:
          domain: camera
          multiple: false
    notify_device:
      name: Device to notify
      description:
        Device needs to run the official Home Assistant app to receive
        notifications
      selector:
        device:
          integration: mobile_app
          multiple: false
    is_ios:
      name: Is it an iOS device?
      description: Toggle if your selected device runs iOS, default is Android
      selector:
        boolean: {}
      default: false
    notification_title:
      name: Notification title (Optional)
      description: 'Default: "Motion detected!"'
      default: Motion detected!
    notification_message:
      name: Notification message (Optional)
      description: 'Default: "{{ motion_sensor_name }} detected movement!"'
      default: "{{ motion_sensor_name }} detected movement!"
    delay:
      name: Delay (Optional)
      description: Wait before creating camera snapshot
      default: ""
      selector:
        number:
          min: 0.0
          max: 60.0
          unit_of_measurement: seconds
          mode: slider
          step: 1.0
  source_url: https://community.home-assistant.io/t/send-camera-snapshot-notification-on-motion/254565
trigger:
  platform: state
  entity_id: !input binary_sensor
  from: "off"
  to: "on"
variables:
  motion_sensor: !input binary_sensor
  motion_sensor_name: "{{ states[motion_sensor].name }}"
  camera: !input camera
  notify_device: !input notify_device
  is_ios: !input is_ios
  notification_title: !input notification_title
  notification_message: !input notification_message
  delay: !input delay
  snapshot_create_file_path: /media/doorshot.jpg
  snapshot_access_file_path:
    "{{ snapshot_create_file_path | replace('/media','/local')
    }}"
action:
  - delay: "{{ delay }}"
  - service: camera.snapshot
    entity_id: !input camera
    data:
      filename: "{{ snapshot_create_file_path }}"
  - device_id: !input notify_device
    domain: mobile_app
    type: notify
    title: "{{ notification_title }}"
    message: "{{ notification_message }}"
    data:
      '{% set android_data = {"image": "%s"} | format(snapshot_access_file_path)
      %} {% set ios_data = {"attachment": {"url": "%s", "content_type": "JPEG"}} | format(snapshot_access_file_path)
      %} {{ ios_data if is_ios else android_data }}'

The automation:

alias: garage door was opened
description: ""
use_blueprint:
  path: vorion/send-camera-snapshot-notification-on-motion.yaml
  input:
    binary_sensor: binary_sensor.sonoff_1001dxxxx
    camera: camera.garage_cam
    notify_device: [id for my phone]
    delay: 2
    is_ios: true

The blueprint and automation notification above works, but I’m still figuring out how to get the thumbnail to show.

I’m using HomeKit Bridge with two entries, one for my phone and one for my wife’s that I added to Apple Home for a separate QR code each: HomeKit Bridge - Home Assistant HomeKit Mode is bridge, Inclusion Mode is include, and I select Cover in the Domains to include, then specifically added my cover.garage_door. “Siri, open the garage door” and “Siri, close the garage door” both work.

This is what it looks like in my phone closed:

This is from Apple CarPlay:

I added the eWeLink Smart Home skill to Alexa and was able to create a routine that toggles the relay that is like pushing the garage door button. “Alexa, push the garage door button” works.

Alexa routine:

Relay in Alexa:

Sensor in Alexa:

Here are some pictures of the hardware.

Powered ewelink board:

Close up of board in box:

Modified dry contact 883LM switch:

Wifi magnetic reed sensor for door status, currently powered by 2 AAA batteries:

Not sure that I like the idea of AAA batteries for the sensor. If they drain quickly I was thinking of getting a AC to DC step down converter and hardware power, or I found this that looks a little easier with no soldering required: https://www.amazon.com/dp/B0873Y5MQ5/?th=1

The one thing I don’t like is that the Sonoff DW2-Wi-Fi-L requires the ewelink cloud to get it’s status. The Ewelink 1CH relay board can operating on LAN or Cloud. If the DW2 could operate on LAN only, then I could just connect to the cloud to get the initial configuration of the devices and then operate in local mode exclusively.

So that’s it, a DIY garage door opener that works with no subscriptions, integrated with HA and is Siri and Alexa compatible. The added bonus, I don’t get loud beeping and flashing when I want to close the door.

2 Likes

:slight_smile:
I have a similar setup:
image
I am changing the icon for the door status sensor into the garage door icon, as well as the icon for the relay into the push button icon.

1 Like

Can you share the code you are using in that card for the push button?

Is it something like this?

show_name: true
show_icon: true
type: button
tap_action:
  action: toggle
entity: switch.sonoff_1001exxxxx
icon: mdi:gesture-tap-button

Started mine with codes similar to the above. But as of today:

show_name: false
show_icon: true
type: button
tap_action:
  action: more-info
  confirmation: true
entity: cover.garage_opener
icon_height: 36px
icon: mdi:gesture-tap-button
hold_action:
  action: toggle
  confirmation:
    text: Open / Close the Garage Door
show_state: false

With some setup to prevent accidental button press… One would have to press and hold, and confirm the dialog box, before the door would open.

Thought about maybe change the dialog box into some pin code confirmation, but that would be too much for me.

1 Like

Very cool!

Here’s what I just added:

show_name: false
show_icon: true
type: button
tap_action:
  action: more-info
  confirmation: false
entity: cover.garage_door
icon: mdi:gesture-tap-button
name: Open/Close Garage Door
icon_height: 36px
hold_action:
  action: toggle
  confirmation:
    text: Open/Close Garage Door
show_state: false

Works great! Thanks.

I’m pretty new at this.

I had already set up the same relay in eWeLink and linked that to ST without issues, but now I am switching over to HA.

I’ve got the relay configured in the eWeLink app, have the code in configuration.yaml, and have the SonoffLAN HACS integration installed, but I’m not following what you meant by “Once I got the entities to show up in HA…” Should it just show up under “Sonoff LAN”? All I see is “+1 entity not shown,” which is “Pre-release.”

Do I somehow add the relay in HA from scratch? I tried that using the “add device” button, but nothing changed.

EDIT: Never mind–I did multiple restarts trying to connect a different device and it showed up.