Hi,
I’ve got a problem for 1 month I’m unable to solve.
I’m trying to integrate a wemos s2 mini into Home Assistant but it fails.
I do it from esphome webpage. When I press on the “connect” button, my device appears and I can connect (it appears as paired/connected) but once I click on “PREPARE FOR FIRST USE”, then on “INSTALL” and finally a window appears saying “connecting” and it fails. Message :
“Failed to initialize. Try resetting your device or holding the BOOT button while selecting your serial port until it starts preparing the installation.”
I’ve tryied to press both buttons in all orders but it doesn’t work.
Thank you for your help.
Jo
I had the same problem and (after trying many things and reading a lot of nonsense on the Internet) solved it by using the Adafruit ESPTool to flash the processor for the first time. It seems there is a bug in the ESPHome web tool for this board. For Adafruit, you will need a web serial browser like Chrome or Edge.
Note: I never use ‘Install for first use’. I see no reason for it. It gives your device the wrong name, then when you change the name it loses WiFi contact and you have to start again anyway.
My steps are as follows:
- From the ESP dashboard create a new device. Give it the name you want. It will create the initial config YAML file with the right name and a device entry on the dashboard. From that entry you can edit the YAML for your specific requirements, but you might want to keep it simple the first time.
- From the EDIT window on the dashboard, click INSTALL. Wait for it to prepare the file (i.e. compile the bin), then execute step 1 to save the file. Select Modern format and save it on your computer in a temporary location (I use the Downloads folder).
- Do not execute step 2 in ESPHome, but open the Adafruit ESPTool page instead. Press ‘Connect’. A popup window opens.
- Plug in your S2 board with a USB cable. Press the “0” (BOOT) button, then while holding it press and let go of the RESET button. You should now see the serial interface in the connect window. You can let go of the “0” button and select the serial input.
- Back in the main window, select the file to load (the one you saved in the previous step). Then load it.
- Once it is finished your new device should be auto-discovered in Home Assistant. If not, try a manual reset to reboot the board. If that fails you can add it manually using the IP address from the installation log file.
- If you now want to change your config file, you can do it on the ESPHome dashboard and load it OTA (over the air, i.e. WiFi). You only need Adafruit again if you mess up and lose the WiFi connection, or want to change the name of your device.
- After changing the config, you should delete the device in Home Assistant and add it again to be sure of getting the correct details. HA can otherwise get confused and mix old and new versions of the device’s entities.
Having overcome that hurdle, I found the S2 mini a nice little board for a range of projects.
Good lock with your projects!
1 Like
Hi Andy,
You are a genious. It almost worked as you said ![:slight_smile: :slight_smile:](https://community.home-assistant.io/images/emoji/twitter/slight_smile.png?v=12)
It now appears in Home Assistant and seems to work well.
I don’t know if you use it for presence detection (I will) but there is this in the yaml file and I don’t know what it is used for, do you have an idea ?
g0:
move_energy:
name: g0 move energy
still_energy:
name: g0 still energy
g1:
move_energy:
name: g1 move energy
still_energy:
name: g1 still energy
g2:
move_energy:
name: g2 move energy
still_energy:
name: g2 still energy
g3:
move_energy:
name: g3 move energy
still_energy:
name: g3 still energy
g4:
move_energy:
name: g4 move energy
still_energy:
name: g4 still energy
g5:
move_energy:
name: g5 move energy
still_energy:
name: g5 still energy
g6:
move_energy:
name: g6 move energy
still_energy:
name: g6 still energy
g7:
move_energy:
name: g7 move energy
still_energy:
name: g7 still energy
g8:
move_energy:
name: g8 move energy
still_energy:
name: g8 still energy
binary_sensor:
- platform: gpio
pin: 16
name: gpio out pin presence
device_class: presence
- platform: ld2410
has_target:
name: Presence
has_moving_target:
name: Moving Target
has_still_target:
name: Still Target
out_pin_presence_status:
name: out pin presence status
number:
- platform: ld2410
timeout:
name: timeout
light_threshold:
name: light threshold
max_move_distance_gate:
name: max move distance gate
max_still_distance_gate:
name: max still distance gate
g0:
move_threshold:
name: g0 move threshold
still_threshold:
name: g0 still threshold
g1:
move_threshold:
name: g1 move threshold
still_threshold:
name: g1 still threshold
g2:
move_threshold:
name: g2 move threshold
still_threshold:
name: g2 still threshold
g3:
move_threshold:
name: g3 move threshold
still_threshold:
name: g3 still threshold
g4:
move_threshold:
name: g4 move threshold
still_threshold:
name: g4 still threshold
g5:
move_threshold:
name: g5 move threshold
still_threshold:
name: g5 still threshold
g6:
move_threshold:
name: g6 move threshold
still_threshold:
name: g6 still threshold
g7:
move_threshold:
name: g7 move threshold
still_threshold:
name: g7 still threshold
g8:
move_threshold:
name: g8 move threshold
still_threshold:
name: g8 still threshold
Thanks again.
Jo
Oh and there is also this in the yaml file ![:slight_smile: :slight_smile:](https://community.home-assistant.io/images/emoji/twitter/slight_smile.png?v=12)
- platform: ld2410
light:
name: light
If I go to the details device, light function is set as “off” and I can choose in the list “below” or “above” and also set a light threshold.
I think it is for example to receive an alert if the light level goes above or below that value.
Do you have an idea ?
Sorry, I am not using it for presence detection and have no idea why those items are in the YAML file.
I have not used it, but LD2410 is a human presence sensor chip
Hi Andy,
One last thing I forgot to mention. I soldered a LD2410 sensor (LD2410 Sensor — ESPHome). In this page comes this information :
Configuration variables:
- light (Optional, int): When in engineering mode, indicates the light sensitivity, otherwise
unknown
. Value between 0
and 255
inclusive. Though it seems that the value 85
is the lowest value at complete darkness. All options from Sensor.
So this is the light element I was refering to.
I just found this information right now and it is also explained what are g1, g2, g3, etc.
Good day.
1 Like