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 ratGDOtype - 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