NEWS
ESPHome - erster Versuch scheitert
-
Hallo,
ich habe einen ESP32 hier mit ESPHome versorgt. Er wird in ESPHome auch als online angezeigt. Im Log von ESPHome sehe ich aber einen Fehler:
INFO Reading configuration /opt/iobroker/iobroker-data/esphome.0/ble-temp-receiver.yaml... INFO Starting log output from ble-temp-receiver.local using esphome API INFO Successfully connected to ble-temp-receiver.local [18:24:16][I][app:102]: ESPHome version 2022.9.4 compiled on Mar 9 2023, 18:14:46 [18:24:16][C][wifi:502]: WiFi: [18:24:16][C][wifi:360]: Local MAC: B4:E6:2D:97:F9:5D [18:24:16][C][wifi:361]: SSID: [redacted] [18:24:16][C][wifi:362]: IP Address: 192.168.1.140 [18:24:16][C][wifi:364]: BSSID: [redacted] [18:24:16][C][wifi:365]: Hostname: 'ble-temp-receiver' [18:24:16][C][wifi:367]: Signal strength: -59 dB ▂▄▆█ [18:24:16][C][wifi:371]: Channel: 11 [18:24:16][C][wifi:372]: Subnet: 255.255.0.0 [18:24:16][C][wifi:373]: Gateway: 192.168.0.2 [18:24:16][C][wifi:374]: DNS1: 192.168.0.8 [18:24:16][C][wifi:375]: DNS2: 0.0.0.0 [18:24:16][C][logger:275]: Logger: [18:24:16][C][logger:276]: Level: DEBUG [18:24:16][C][logger:277]: Log Baud Rate: 115200 [18:24:16][C][logger:278]: Hardware UART: UART0 [18:24:16][C][dht:017]: DHT: [18:24:16][C][dht:018]: Pin: GPIO21 [18:24:16][C][dht:020]: Auto-detected model: DHT11 [18:24:16][C][dht:027]: Update Interval: 60.0s [18:24:16][C][dht:029]: Temperature 'Temperature Test' [18:24:16][C][dht:029]: Device Class: 'temperature' [18:24:16][C][dht:029]: State Class: 'measurement' [18:24:16][C][dht:029]: Unit of Measurement: '°C' [18:24:16][C][dht:029]: Accuracy Decimals: 1 [18:24:16][C][dht:030]: Humidity 'Humidity Test' [18:24:16][C][dht:030]: Device Class: 'humidity' [18:24:16][C][dht:030]: State Class: 'measurement' [18:24:16][C][dht:030]: Unit of Measurement: '%' [18:24:16][C][dht:030]: Accuracy Decimals: 0 [18:24:16][C][captive_portal:088]: Captive Portal: [18:24:16][C][mdns:100]: mDNS: [18:24:16][C][mdns:101]: Hostname: ble-temp-receiver [18:24:16][C][ota:089]: Over-The-Air Updates: [18:24:16][C][ota:090]: Address: ble-temp-receiver.local:3232 [18:24:16][C][ota:093]: Using Password. [18:24:16][C][api:138]: API Server: [18:24:16][C][api:139]: Address: ble-temp-receiver.local:6053 [18:24:16][C][api:141]: Using noise encryption: YES [18:24:25][D][api:102]: Accepted ::FFFF:C0A8:69 [18:24:25][W][api.connection:071]: ::FFFF:C0A8:69: Socket operation failed: BAD_INDICATOR errno=11
Im Protokoll von iobroker steht dies:
2023-03-09 18:29:26.248 - error: esphome.0 (7960) ESPHome client 192.168.1.140 Error: Bad format. Expected 0 at the begin 2023-03-09 18:29:26.249 - error: esphome.0 (7960) ESPHome client 192.168.1.140 Error: Bad format. Expected 0 at the begin 2023-03-09 18:29:31.238 - warn: esphome.0 (7960) Client 192.168.1.140 Timeout, connection Lost, will reconnect automatically when device is available! 2023-03-09 18:29:56.376 - error: esphome.0 (7960) ESPHome client 192.168.1.140 Error: Bad format. Expected 0 at the begin 2023-03-09 18:29:56.379 - error: esphome.0 (7960) ESPHome client 192.168.1.140 Error: Bad format. Expected 0 at the begin 2023-03-09 18:30:01.343 - warn: esphome.0 (7960) Client 192.168.1.140 Timeout, connection Lost, will reconnect automatically when device is available! 2023-03-09 18:30:26.463 - error: esphome.0 (7960) ESPHome client 192.168.1.140 Error: Bad format. Expected 0 at the begin 2023-03-09 18:30:26.464 - error: esphome.0 (7960) ESPHome client 192.168.1.140 Error: Bad format. Expected 0 at the begin 2023-03-09 18:30:31.449 - warn: esphome.0 (7960) Client 192.168.1.140 Timeout, connection Lost, will reconnect automatically when device is available!
die Konfiguration vom ESP sieht so aus:
esphome: name: ble-temp-receiver esp32: board: esp32dev framework: type: arduino # Enable logging logger: # Enable Home Assistant API api: encryption: key: "sMmBZapO8u/XXXXXF3AaxPII5T2K4I0DlFxSEUXOioY=" ota: password: "6bc17b5b9XXXXXd284cf36d5a73da56b" wifi: ssid: !secret wifi_ssid password: !secret wifi_password # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "Ble-Temp-Receiver" password: "neenee" captive_portal: # Example configuration entry sensor: - platform: dht pin: GPIO21 temperature: name: "Temperature Test" humidity: name: "Humidity Test" update_interval: 60s
MOD-EDIT: private Daten entfernt!
Was mache ich falsch? Ich komme irgendwie nicht weiter, da ich nicht weiß wo der Fehler liegt. Irgendwas hab ich noch nicht verstanden.
VG -
@speerwerfer sagte in ESPHome - erster Versuch scheitert:
Signal strength: -59 dB ▂▄▆█
prikelnd ist es nicht.. und es steht auch im Log..
Client 192.168.1.140 Timeout, connection Lost, will reconnect automatically when device is available
-
@arteck ich glaube nicht, das es am schlechten WLAN liegt.
Wenn ich in der YAML zum ESP die Zeilen
api: encryption: key: "sMmBZapO8u/XXXXXF3AaxPII5T2K4I0DlFxSEUXOioY="
durch
api: password: "myPassword"
ersetze, geht es. Irgendwas stimmt bei mir mit der Einrichtung der API nicht.
-
@speerwerfer Ersetze mal „passwort“ durch dein Passwort und trage dieses Passwort auch noch in den Adaptereinstellungen ein.
-
@draexler said in ESPHome - erster Versuch scheitert:
@speerwerfer Ersetze mal „passwort“ durch dein Passwort und trage dieses Passwort auch noch in den Adaptereinstellungen ein.
Hmm, ich glaube wir reden aneinander vorbei
Wenn ich das folgende benutze (natürlich mit einem anderen Passwort und auch in der Adaptereinstellung eingetragen)
api: password: "myPassword"
dann funktioniert es ja einwandfrei. Nur laut Doku ist dies deprecated. Soll also so nicht mehr gemacht werden.
Wenn ich hingegen mit encryption und key arbeite, dann bekomme ich die Fehlermeldungen. Was muss ich tun, damit encryption funktioniert.
-
@speerwerfer: Du Sprichst von der ESPHOME Doku vermutlich und nicht die vom Adapter?
Da muss man machmal ein bisschen Abstriche machen... Der Adapter hängt an ein paar stellen zurück.
Zum Beispiel geht nur Switch und kein Button etc.
Die YAML Prüfung wird dir keinen Fehler melden, aber halt der ioBrokerAm besten den alten Weg verwenden und das API Passwort in die "Secret" YAML eintragen.
-
@speerwerfer
Auszug aus der ESPHome Doku zum Thema Native API:Currently, only the ESPHome tool and Home Assistant use this native API.
Ich Frage mich also für was du das brauchst beim ioBroker...