Hallo zusammen,
ich habe mir als erstes ESPHome Projekt einen Bodenfeuchtigkeitssensor + einen BMP280 als Temperaturfühler an einen ESP32 gebastelt und diesen über USB über den HA geflasht.
Der Code funktioniert auch solange der ESP32 über USB mit dem HA verbunden ist.
Wenn ich diese Verbindung trenne ist der ESP zwar im Netzwerk, ich kann ihn über cmd anpingen und bekomme eine perfekte Verbindung und ESPHome zeigt ihn selbst meist als Online an, jedoch werden keine Werte geliefert.

Wenn ich die Software neu über Wlan aufspiele / update scheint alles zu funktionieren bis auf den Punkt an welchem er den Logoutput über die API Startet:
Compiling .pioenvs/esphome-moist1/FrameworkArduino/wiring_pulse.c.o
Compiling .pioenvs/esphome-moist1/FrameworkArduino/wiring_shift.c.o
Archiving .pioenvs/esphome-moist1/libFrameworkArduino.a
Linking .pioenvs/esphome-moist1/firmware.elf
RAM: [= ] 12.5% (used 40992 bytes from 327680 bytes)
Flash: [===== ] 51.5% (used 944921 bytes from 1835008 bytes)
Building .pioenvs/esphome-moist1/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs/esphome-moist1/firmware.bin"], [".pioenvs/esphome-moist1/firmware.elf"])
Wrote 0xf81a0 bytes to file /data/build/esphome-moist1/.pioenvs/esphome-moist1/firmware-factory.bin, ready to flash to offset 0x0
======================== [SUCCESS] Took 150.57 seconds ========================
INFO Successfully compiled program.
INFO Resolving IP address of esphome-moist1.local
INFO -> 192.168.188.43
INFO Uploading /data/build/esphome-moist1/.pioenvs/esphome-moist1/firmware.bin (950688 bytes)
Uploading: [============================================================] 100% Done...
INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from esphome-moist1.local using esphome API
WARNING Can't connect to ESPHome API for esphome-moist1.local: Error connecting to ('192.168.188.43', 6053): [Errno 113] Connect call failed ('192.168.188.43', 6053) (SocketAPIError)
INFO Trying to connect to esphome-moist1.local in the background
In der Fritz Box ist er online, mit Internetzugang (auch wenn der ja eigl nicht notwendig sein sollte): selbst. Portfreigabe erlaubt
2,4 GHz, 57 / 68 Mbit/s
Bin leider weder in Hardware noch Netzwerkdingen ein Experte daher diese vermutliche Anfängerfrage… Ich konnte leider online nichts finden und probiere schon seit drei Tagen rum. Ich hoffe mal es sind alle Infos zum Setup dabei die notwendig. Freue mich auf euer Feedback!
Anbei noch der Code, nur für den Fall:
esphome:
name: esphome-moist1
friendly_name: ESPHome-Moist1
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "XXXX="
ota:
password: "XXX"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Moist1 Fallback Hotspot"
password: "3nbgokqqN8LX"
captive_portal:
i2c:
- id: "bmp280_i2c"
sda: GPIO12
scl: GPIO14
scan: true
sensor:
- platform: bmp280
i2c_id: bmp280_i2c
temperature:
name: "BME280 Temperature"
oversampling: 16x
pressure:
name: "BME280 Pressure"
address: 0x76
update_interval: 8s
- platform: adc
pin: GPIO36
name: "Soil Moisture1"
update_interval: 5s
force_update: true
unit_of_measurement: "%"
attenuation: 11db
filters:
- median:
window_size: 7
send_every: 4
send_first_at: 1
- calibrate_linear:
- 0.89 -> 100.00
- 2.2 -> 0.00
- lambda: if (x < 1) return 0; else return (x);
accuracy_decimals: 0
- platform: adc
pin: GPIO39
name: "Soil Moisture2"
update_interval: 5s
force_update: true
unit_of_measurement: "%"
attenuation: 11db
filters:
- median:
window_size: 7
send_every: 4
send_first_at: 1
- calibrate_linear:
- 0.94 -> 100.00
- 2.24 -> 0.00
- lambda: if (x < 1) return 0; else return (x);
accuracy_decimals: 0
- platform: adc
pin: GPIO34
name: "Soil Moisture3"
update_interval: 5s
force_update: true
unit_of_measurement: "%"
attenuation: 11db
filters:
- median:
window_size: 7
send_every: 4
send_first_at: 1
- calibrate_linear:
- 0.9 -> 100.00
- 2.23 -> 0.00
- lambda: if (x < 1) return 0; else return (x);
accuracy_decimals: 0
- platform: adc
pin: GPIO35
name: "Soil Moisture4"
update_interval: 5s
force_update: true
unit_of_measurement: "%"
attenuation: 11db
filters:
- median:
window_size: 7
send_every: 4
send_first_at: 1
- calibrate_linear:
- 0.91 -> 100.00
- 2.2 -> 0.00
- lambda: if (x < 1) return 0; else return (x);
accuracy_decimals: 0
Hardware:
Home Assistant auf einem Rasperry 4