Trouble with OTA

Hello

I am using ESP32 board as a Bluetooth proxy for my Home Assistant installation - the device works fine in Home Assistant as a BT proxy, relaying information from a BT electrical energy meter.

I’ve recently received a notification which urges me to upgrade my BT Proxy to ESPHome 2023.4.0 or later.

I’ve configured the Bluetooth proxy via ESPHome Bluetooth Proxy Web page and I am somewhat lost on how to perform OTA. I’ve read a lot of docs on ESPHome Web page but I still don’t understand how to perform the OTA.

I’m running ESPHome Docker container (Package esphome · GitHub) but I have no idea how to add my device to the dasboard running at port 6052. It says I need to first connect the device via USB cable, which I specifically don’t want to do, as it’s installed in a hard-to-reach location and I’d like to upgrade it wirelessly.

I understand I could use CLI, but I guess this would require to have the original ESPHome config, which I don’t have as I configured it from the Webpage.

Any tips on how to proceed with OTA?

Where did you get the notification? And what exactly does it say?
Also: that esphome device does nothing else than acting as a Bluetooth proxy?

That very page has a link to the yaml. Put the yaml into your esphome. Update.

The notification is shown in settings in the Home Assistant:

“Update esp32-bluetooth-proxy-516560 to version ESPHome 2023.4.0 or newer.”

above “Home Assistant Cloud”, with “1 element to fix” heading.

The device acts only as Bluetooth proxy.

That’s the part I am struggling with.
I have initially flashed my ESP32 via ESPHome Bluetooth Proxy (i.e. via Web browser, with the ESP32 connected to USB-to-serial adapter)

I don’t know how to “put the yaml into your esphome”, and the documentation on that is unclear to me. It mentions that future updates can be done via OTA, but I don’t understand how to use OTA here.

The notification links to the same ESPHome Bluetooth Proxy Web page which doesn’t mention OTA.

Open a new project in esphome and paste the yaml.

The thing is: did something stop working? if not, then you have all the time in the world to figure this out. Is this your first time/device you are using esphome with?

It didn’t stop working. The ESP is in a physically hard to reach location and I don’t have access to USB-serial converter so I wanted to use OTA.
Yes, it’s my first and only ESP32 (and hence ESPHome) device, although I’ve been working in programming for more than 20 years.

Unfortnately that’s the part I’m struggling with. I don’t really know what “opening a new project in esphome” really means. ESPHome is a name of the project, and I guess a name for a tool. I’ve run the Docker container provided on Getting Started with the ESPHome Command Line — ESPHome but I starts blank. How do I connect it over WiFi to my device? Where do I get the YAML from?

I initally flashed my device using ESPHome Bluetooth Proxy.

Okay, first a disclaimer: there is probably easier ways to do this, but it works like a charm for me. With that being said:

  1. install esphome CLI on your laptop (Getting Started with the ESPHome Command Line — ESPHome). I just did the manual installation (Installing ESPHome Manually — ESPHome), as I don’t have any experience with docker, but if you get the docker version to run you can also use that one

  2. have the wizard create a base yaml file for you (esphome wizard bluetooth.yaml). You need the board/chip type for that, which one do you have?

  3. open the created yaml file and edit the name of the node to be esp32-bluetooth-proxy-516560

  4. add the other stuff from the bluetooth proxy yaml (I didn’t use the bt proxy so far, so I cannot tell you exactly which ones are needed) and save the file

  5. try out “esphome logs bluetooth.yaml”, that should connect to your current esphome node and show some log output. This is just to verify that esphome can connect to it at all, and got it identified correctly via the name you added to the bluetooth.yaml

  6. use “esphome compile bluetooth.yaml”, this will - well - compile your newly created bluetooth.yaml, and it lets you debug the code without automatically flashing it to the esp node

  7. if everything runs fine with that, you don’t get error messages anymore and it successfully compiles, you can take the leap of faith and do “esphome run bluetooth.yaml”. That will compile again and should flash the new code via OTA to your device. Once it’s done, it should automatically try to connect for log output.

As mentioned: no guarantees, most people here use the build-in esphome version/dashboard within HA, but the command line version works nice for me on my windows 10 laptop

If you are using the ui then there is a big fat button “+ new device”

If you are using the command line simply create a file in an editor.

We’ve been through that. There is a link on the web page. This web page ESPHome Bluetooth Proxy . The one you pointed to. The one that says

  • The YAML configuration is on GitHub

Thanks for bearing with me. I understand that GitHub holds the template for the YAML file. However, as far as I understand correctly, the YAML file uploaded to my device has has been modified with my AP data, my Home Assistant API encryption key, OTA password?

So there are still 2 things I don’t understand how to do:

  • how to get the exact YAML file that is already on the device to avoid breakage when I am upgrading
  • how do I tell the UI the hostname of my device to perform OTA?

Re 1: Docker works fine for me
Re 2: I believe it’s ESP-WROOM-32S
Re 4: is there a way to get the YAML file from the working controller?
Re 5: do I need to have it connected over USB-serial? or would it work over WiFi?

most people here use the build-in esphome version/dashboard within HA

How do I install it?

nope, it’s not the yaml running on the node, it’s a compiled version of it. the yaml itself never gets transfered to the esp node.

the method described in my list works OverTheAir, so no cable, just wifi

if you use the wizard command, you will be asked for your wifi infos, they will be added into the raw yaml file created by the wizard.

1 Like

Yes, you’ll have to type those in. Not so hard.