How to get Ratgdo into ESPHome add-on

This is probably a simple question, but I just added a ratgdo ESPHome device to HomeAssistant and it shows up in devices, entities, etc. like it should. But when I go to the ESPHome add-on, it doesn’t show up there. If I wanted to see the yaml configuration or change something like ports, how can I get it into the add-on? I only have an option to add a new device which appears to be just for starting from scratch. I believe I’ve seen others posting that they have it in the add-on and can modify the configs.

Im not familiar with with ratgdo but, i im familiar with doing a Google search and the documentation with the instructions and files you need was ths very first search result.

If you want to edit the config for it, well you need the default config file they flash on them. This might sound crazy but, a good place to start looking for these things would be their website.

You essentially are. The ESPhome add-on has no way to pull the current config from the device. There is an option that can be added to the device firmware that would allow the add-on to import the config from somewhere like GitHub automatically, but doesn’t sound like they set that. So, to get it added, you’ll have to grab this

and then reflash the device.

EDIT: I just checked their documentation and they say it should be adoptable (what I mentioned above). If that is the case, then it should auto-populate with an “adopt” button in the add-on.

Thanks. I did look at their website and the documentation. There are examples of configuration files that get put together depending on what version gets installed, but it’s unclear what actually got flashed onto mine after all the variable substitutions. If I were to use those files, I would only be guessing as to whether it was correct. I also, still don’t see how to get the device I’ve already added to HomeAssistant into the ESPHome add-on. Do I have to create a new device in the add-on and make sure it has the exact same name as the device that’s already been added? Then whatever config I end up with will be pushed out to the device overwriting what was done with the web installer? I’m just curious if anyone else has done this and how they did it.

If the device doesn’t show up as adoptable mDNS may not be working on your network or you configured the addon to use ICMP (Ping) instead of mDNS to discover devices.

1 Like

Yes, it should show up as adoptable but you will probably need to access the device first via your web browser and it will pull up a wifi scan and you need to configure your wifi ssid and the password because right now it doesnt have a network to connect to and cant be discovered

If you pull up your wifi settings in your phone or pc. You should see an AP for a ratgdo device. Idk if it needs a default password or it may not require one, im not sure but you need to connect to it and configure your wifi first.

They already have it connected to HA so it’s on the network.

So HA discovered the Esphome device correct? You also have the Esphome add on installed in HA correct?
Im not sure why but, its not uncommon for HA or Esphome to not discover a new device right away and every single time. You can try restarting HA and if that doesnt work you can try to manually add it.

If you go to Devices/Services - Esphome
This is where you can find Esphome devices even if you dont have the config file. Does your ratgdo device show up here?

I used the web flasher at ESPHome ratgdo to install the firmware on the Wemos mini D1.

I then manually added the board to HA using the integrations page. HA found the board and added the device/entities, so it is available and usable. Right now it’s just the wemos board with the firmware flashed. I’m building my own Rat-Ratgdo board with this as the basis.

It’s setup to work now, but I cannot see it in the ESPHome add-on, so I can’t see the configuration or modify it. By default, I think it’s not setup for OTA updates and I would need to configure the port for that as well. This is my 2nd ESPHome device (and there will be a third for my other garage door). All of my ESPHome devices, IP Cameras, etc. run on a separate router connected to my main network, so HA accesses all of them through one IP address on my main network and the ports are forwarded by NAT on the secondary router.

So, in some cases, I need to configure ESPHome/HA to access these devices on different ports than the defaults since as far as HA can tell, they all use the same IP address.

That sounds like a lot of headache.
But it would also explain why the device is not detected for adoption in the ESPHome Dashboard. mDNS is Multicast and therefor only works on the same network segment or if Multicast is routed or forwarded. And even then, the mDNS Service Discovery information an ESPHome node sends usually expects there to be a routed connection between the dashboard and the device. It wouldn’t know if ports are mangled using NAT in between.

Ok, if I understand you correctly, if the device was within my primary network, then the ESPHome add-on should have automatically detected it and added it into the dashboard? Would I then be able to see/edit it’s existing configuration yaml?

1 Like

Almost.

The way it works is that the selection on the ESPHome ratgdo Webinstaller will point the webinstaller to some pre-built images. These images are built based on the YAML files in the esphome-ratgdo repository.
So let’s assume you selected the “v2.5i/2.52i/2.53i Board Security+ 2.0” variant. That means you’d be installing an image built from v25iboard.yaml. In that YAML file there’s a section:

dashboard_import:
  package_import_url: github://ratgdo/esphome-ratgdo/v25iboard.yaml@main

What this will do is saving that reference (not the entire config) in the built image. The ESPHome Dashboard will receive this information upon adopting this device and then proceed to reference this package in a minimal YAML configuration it creates for the device.
Again, it does not pull the configuration from the device itself because it doesn’t exist on the device in this form.
This minimal YAML configuration should be sufficient to compile a new ESPHome build that will conform to the configuration of the device that it came from.
Further modifications can then be made by supplying your own substitutions to the minimal YAML file ESPHome created for you.

Its not showing up in esphome because theres no config there. You used the web installer from ratgdo so the config is there not your esphome. Did you try the manual adopt option?