Garage door relay or something else?

Hopefully, this lengthy post will explain what I am talking about and what your next steps need to be. My apologies if it appears pedantic, you appear bright but a bit inexperienced with ESPHome and Home Assistant.

It's not clear to me what is flashed on your ratGDO. It's been a year or so since I went through the steps myself. As I indicated above, the way I use ratGDO is by adding it to the Home Assistant ESPHome add-on, then bringing it to Hubitat from Home Assistant through HADB. I do it this way because it's easy to update the ratGDO firmware through the ESPHome dashboard from ESPHome. I only control ratGDO through Hubitat. Even though I only use Hubitat Dashboards when I am out of town, ratGDO, brought over by HADB, works fine from the standard Hubitat Garage Door tile. ratGDO did work well from the Hubitat Garage Door tile from the Hubitat ESPHome driver when the ESPHome API was unencrypted (see below).

However, as discussed above, ESPHome, while being an add-on to Home Assistant, is its own subsystem, and defines its own API. The ESPHome devices appear in Home Assistant as what Hubitat would call "child" devices of ESPHome.

That said, back when I first got my ratGDO, I did verify that it worked using the Hubitat ESPHome driver. At that time, ESPHome did not use encrypted communication to ESPHome devices. Subsequent to my initial installation, ESPHome changed its communication with child devices to be encrypted by default. The encryption can be disabled by commenting out two lines in an ESPHome device's yaml code (more on this below).

The ESPHome firmware that you flash to the ratGDO has many parts. One part communicates with the Home Assistant ESPHome add-on (or, in your case, the Hubitat ESPHome driver) using the ESPHome API protocol. The other part is a ratGDO driver that communicates with the ratGDO ESP chip.

The ESPHome firmware, periodically updated, is compiled anew each time you update the firmware. The compilation is modified according to a number of parameters that are passed to the compiler in a .yaml file. The ratGDO firmware flashing page has a bunch of pre-compiled ESPHome files that were compiled for the variant of LiftMaster/Chamberlain model you have, etc., and also that have preset parameters for the type of ESP chip on your ratGDO board, etc.

What I noticed, after my initial flashing of my ratGDO board, was that it stopped working after the subsequent ESPHome Home Assistant add-on update that turned on encryption for the ESPHome API. There is a discussion of this point upthread or in one of the Hubitat community threads I linked to above.

Just to help you understand, here is the .yaml file "ratgdov25i-e764e5.yaml" for my ratGDO (with the encryption key redacted). The "packages:" entry pulls in the current ESPHome driver for the ratGDO that is bundled with the ESPHome code, compiled, and uploaded. Except for redaction of the encryption key, it's unchanged from what was auto-generated. As documented in one of the posts to which I linked, I believe, if the "encryption:" and "key:" lines are commented out, it should allow compilation of an ESPHome firmware file for the ratGDO that will work with the Hubitat ESPHome driver, which does not support encrypted communication over the ESPHome API.

substitutions:
  name: ratgdov25i-e764e5
  friendly_name: ratgdov2.5i e764e5

  
packages:
  ratgdo.esphome: github://ratgdo/esphome-ratgdo/v25iboard.yaml@main

esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: *** redacted ***

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

If the encryption lines were commented out, they would look like:

api:
  # encryption:
  #  key: ###
1 Like

I appreciate your explanation... but I'm still really lost as to what I actually need to do as a next step. I know I'm close though. I have never used Home Assistant nor do I want to use it as it seems to be overkill for my needs and it seems I can do all I want without it. From what you seem to be saying though, I no longer should need to comment out anything in a YAML file since encryption is now supported, right?

So here's what I've done so far.

I flashed the firmware onto my ratGDO from this page: ESPHome ratgdo
I selected "Security + 1.0" since my garage door has a purple button, and I left the "ratdgo 2.5x" option selected since this is what I have. Using Chrome, I flashed that onto my ratGDO device, it prompted my for my WiFi info - and it all works. I went and wired it up to my garage door, and then assigned a static IP address on my router. All good, I can control my garage door by visiting the IP address and using the UI there.

Inside Hubitat I have the ESPHome driver added here:

I made a virtual device with that driver, and entered in that static IP address I assigned to it, and saved it, but I'm still showing "offline"

What am I missing here?

Please navigate to Libraries Code and make sure you have the espHomeAPI Helper code:

Then again I am using Adrian's version of the code and you can verify that by looking here in the driver code:

If not, open up the driver you have and click the Import button and paste in the following URL to update it:
https://raw.githubusercontent.com/ady624/hubitat-public/main/ESPHome/ESPHome-ratGDO.groovy

Then open your garage door device and click Initialize. Make sure your RATGDO has a static IP address assigned too.

Yes, I have all of that and that is the exact driver I am using as well (I did a file diff to compare)

Going into my device shows: networkStatus : offline

Clicking the Initialize button makes that briefly flash to connecting and then it immediately goes back to offline

Go to Settings, Network Settings, Network Test at the top and try to ping the RATGDO to make sure that the HE can talk to it.

You may want to enable debug logging on the device too and click initialize to see if any further details show up in the logs.

Good idea, but network test to ping the ratGDO IP address seems fine

debug logging shows the issue though!

Any ideas for what I can do from here?

ESPHome API encryption is supported by the ESPHome Home Assistant add-on, but not by the Hubitat ESPHome driver. The lines of code are missing. Another community user, who has made some additions to the Hubitat driver, mentioned that he had written the necessary code changes, but had not merged those changes into the Hubitat ESPHome driver.

So, the three options would seem to be:

  1. Make the yaml comments I discuss above to disable ESPHome API encryption for this ESPHome device, compile new ESPHome firmware, upload that modified firmware to your ratGDO device, or

  2. Merge the ESPHome encrypted API changes into the Hubitat ESPHome driver, or

  3. Spin up a Home Assistant instance (or go to someone who has HA running, proceed as in (1), above, edit yaml, compile firmware that doesn’t have encrypted API, upload that firmware to your ratGDO, take your ratGDO back to your installation.

HA isn’t hard to do, it runs on many platforms.

@672southmain is this something new? I ask because I set my RATGDO up in early April and don't remember having to modify a YAML file to get things working. This said I haven't updated its firmware either since that time.

These are the steps I followed to setup my device in April:

Worth mentioning that @ady624's driver changes have been merged in Github so you don't need to use his custom driver code.

@ChrisB I noticed this issue in Github which is exactly what you are getting. Please open your ESPHome ratGDO driver code and scroll to line 241. I did a compare of Ady's to Jonathans and the file on the right had some additional lines that he mentions in the issue that solved the error:

Does your driver code have that null check?

Yes. I posted about this when it changed.

Current ESPHome firmware is ESPHome 2024.8.1, which has an encrypted API by default, but the encryption can be disabled by commenting out the two encryption lines, as I noted above. Perhaps those having success without editing the yaml used to compile the ratGDO firmware installed before the change.

I don't recall the version of ESPHome when it changed. If you did the ratGDO installation before the change occurred, and haven't updated your ratGDO firmware since then, you don't have the issue.

Look at the firmware version reported by your ratGDO.

I am in a different situation because I have ratGDO on Home Assistant and bring it to Hubitat via HADB. So, every time there is a round of ESPHome changes on Home Assistant, the ratGDO firmware changes, too. Frequent breaking changes on Home Assistant, sigh.

I will try to find my post when this change occurred, and the ensuing discussion in this forum.

1 Like

This is good information because I do have HA up and running for local Ecobee and Aqara FP2 and I did connect my RATGDO as well but I haven’t updated HA in a long time either. So good to know this might break my HE integration if I do update.

Here is my post on February 26, 2024, when the default encryption started:

Read the thread from that point on for a discussion.

1 Like

This was the missing piece, thank you! After adding this null check, it all connects and works!

Thank you!


For anyone who come across this in the future, I am improving and clarifying the instructions from this post here, for this specific process because I found this difficult to piece together myself. I feel like this process itself is not difficult... but figuring out the process is. Threads, github pages, copy/pasting old code from pull requests, learning how things work... it's a lot.


How to add a ratGDO to Hubitat directly, using ESPHome firmware (no Home Assistant)

Firmware Installation

  • Install the ESPHome firmware on your ratGDO device using their ESPHome Installer in Chrome (for Mac, you need to install some USB drivers, check the bottom of that page).
    • Yes, this GitHub repo does have a big LEGACY REPOSITORY - NO LONGER ACTIVELY MAINTAINED warning, but this is still apparently the thing to use!

Device Installation

  • Install the ratGDO device as per wiring instructions on the page linked above

Network Configuration

  • Allocate a static IP using your router - this is important so that the IP does not change, ever.

Hubitat Configuration

  • Install the "Hubitat Package Manager" (HPM) app if you do not already have it.
  • Inside HPM, search by keyword for "ESPHome" and Install "ESPHome Integration Library and Example Drivers by Jonathan Bradshaw"
    • Install the ratGDO driver as well when presented with the option
  • Go to "Devices", click "add device" and create a virtual device of the ESPHome ratGDO type
  • Enter the IP address you allocated above and click Save Preferences
  • Refresh the page, all entities should have filled themselves in now

Troubleshooting

  • If nothing gets filled in and it says it is still offline, go to "Drivers Code" and open the "ESPHome ratGDO" driver.
  • Look on line number 141, and if there is no null check there add the following code on line 141:
if (message.position == null) {
    return
 }
  • Now return to the virtual device you created before, and press the "initialize" button, and now everything should populate with current statuses
2 Likes

Awesome glad you got it working.

@672southmain FYI it doesn't appear the encryption affects the HE driver. I am running 2024.3.2 Apr 8 2024, 04:18:32 which is after you mentioned ESP Home encryption happened and @ChrisB is running an August firmware.

Well, that's great news. It just didn't match my experience. Perhaps when I get back from my trip to the Northwest in two weeks, I will try it again. Again, it initially worked for me but stopped working with the Hubitat driver with the Feb. 26, 2024 , update. I have exclusively used HADB since then.

1 Like