ESP32 - What now?

Hello!
I have our HomeAssistant installation running.
It has a small number of devices… yet so far working awesome.

I installed the ESPHome addon.
After baby-steps, I was able to configure an ESP32 board with ESPHome inside HomeAssistant.

HomeAssistant used the secrets to connect it to wifi and everything.
My question: what now?

Should that ESP32 board show up somewhere?
If I go to ESPHome inside HomeAssistant, the entity shows as OFFLINE.

Right now I would be happy to push a “blinking LED” program (script? sketch?) via HomeAssistant.

Ultimately, I want to control a small relay with the ESP32.

Yet baby-steps… how can I push this blinking LED?
Maybe something that I can turn on/off the LED via HomeAssistant?

Yet I am SUPER stuck as to “what now?”?
What is the next step?
Do I put the sketch inside the HomeAssistant and push it to the device? Should it then appear in HomeAssistant?

Thank you for the patience with this question!

Post the YAML you used in the ESPhome add-on to flash the device. If done right, and mDNS is working on your network, then it should show up as a discovered device. ESPhome uses an API to allow HA to connect to it (by default). You could alternatively setup MQTT on the ESP device, but I’d say that’s a more advanced setup.

As a general note, ESPhome doesn’t use ‘sketches’ like Arduino. You set the device configurations in YAML instead in the ESPhome add-on for compiling the firmware.

Same concept though, you configure whatever you’re wanting to setup in the config YAML and they’ll show in Home Assistant via the ESPhome integration.

Thank you!
The YAML config is below.

You mentioned mDSN… hmmm… I gotta check that.
I don’t know if it is working properly (or working at all).

esphome:
  name: test3
  friendly_name: test3

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "ChfKsROzT+xuoVKErxETSBMMUpLyk5x3mdcnJi/aktQ="

ota:
  - platform: esphome
    password: "98c0a7f9a94ba27c3c19e6b9856e2390"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test3 Fallback Hotspot"
    password: "rJPfvx2Hi9xh"

captive_portal:

If it’s connected to your WiFi (validated from your network gear, you can manually add the device to the ESPhome integration by providing the IP address.

For the ESPhome add-on, you can add a line to your config to tell it what up to use.

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_adress: xxx.xxx.xxx.xxx
1 Like

use_address is only for changing static ip address.

https://esphome.io/components/wifi
Screenshot 2024-08-20 at 07-28-56 WiFi Component — ESPHome

You should use this format:

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

  manual_ip:
    static_ip: 192.168.0.123
    gateway: 192.168.0.1
    subnet: 255.255.255.0
1 Like

Add some sensors.

1 Like

That might be what it’s meant for but that’s not the only thing it does. It tells ESPhome what IP to reach the device on…ergo, bypassing mDNS.

No, as I said that is what this is for:

The method you are using only works for ESPHome add-on to reach the device. It does not assign the IP address to the device for the HA integration to contact.

Now, you enter the rabbit hole and think of things youd like to make or do… Theres all sorts of places to get project ideas or just to learn stuff. They can all be easily found by visiting the search box here or Google.

Configuration.

Yes, in the ESPHome page.

And, there it is. You haven’t told it to do anything yet.
Add the WiFi Signal Sensor recommended by @tom_l.

Here is all you need. Add this to your test3.yaml file:

# Example configuration entry
sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 60s
web_server:
  port: 80

(I added the web server component. It is in another part of the docs).
After it boots, point your browser to test3.local. You should see your WiFi Signal Sensor value.

Do not use static IP unless you really need it and know what you are doing. You don’t need it.

I never said it would give an IP…I said that OP could add it if the device was connected to WiFi but not showing up as online in the ESPhome add-on as a quick test to see if mDNS is the issue.

Wouldn’t it be better to figure out why the device is not connecting to WiFi?
Did @aj-light set up his WiFi credentials in the secrets.yaml correctly?

@aj-light, install again and copy the log text that results. Post that here using code tags.

OP mentioned the device connected to WiFi. But, to your point, that may have been an assumption.