richardhopton / smartbed-mqtt

MIT License
54 stars 10 forks source link

Error connecting - encryption expected error with ESPHome #23

Closed ExR90 closed 8 months ago

ExR90 commented 8 months ago

I have a Reverie base. I have currrent builds of HA and ESPHome, and a ESP32 setup as a Bluetooth Proxy. MQTT is working with other services fine using Mosquitto. HA has detected and recognizes the bluetooth proxy in the Integrations/Devices area. In the smartbed config, I added the fqdn of the bluetooth proxy and confirmed it resolves correctly to the IP. I left all MQTT factors as default, which don't appear to be an issue as it says connected in the log.

Also, a little confused as to how to connect the Reverie base to the proxy and/or to Smart Bed, or perhaps that will become obvious once this problem is resolved I suppose.

Logs:

info [2024-03-02T10:43:17.549Z] [MQTT] Connecting... info [2024-03-02T10:43:18.397Z] [MQTT] Connected info [2024-03-02T10:43:18.401Z] [ESPHome] Connecting... error [2024-03-02T10:43:18.657Z] [ESPHome] Failed Connecting (will retry): Error: Bad format: Encryption expected at PlaintextFrameHelper.deserialize (/smartbed-mqtt/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:32:31) at PlaintextFrameHelper.onData (/smartbed-mqtt/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:55:36) at Socket. (/smartbed-mqtt/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:7:47) at Socket.emit (node:events:517:28) at addChunk (node:internal/streams/readable:368:12) at readableAddChunk (node:internal/streams/readable:341:9) at Readable.push (node:internal/streams/readable:278:10) at TCP.onStreamRead (node:internal/stream_base_commons:190:23) error [2024-03-02T10:43:18.672Z] [ESPHome] Failed Connecting: Error: Already connected. Can't connect. at EsphomeNativeApiConnection.connect (/smartbed-mqtt/node_modules/@2colors/esphome-native-api/lib/connection.js:161:35) at doConnect (/smartbed-mqtt/ESPHome/connect.js:19:28) at EsphomeNativeApiConnection.retryHandler (/smartbed-mqtt/ESPHome/connect.js:27:13) at Object.onceWrapper (node:events:632:26) at EsphomeNativeApiConnection.emit (node:events:517:28) at PlaintextFrameHelper. (/smartbed-mqtt/node_modules/@2colors/esphome-native-api/lib/connection.js:81:18) at PlaintextFrameHelper.emit (node:events:517:28) at PlaintextFrameHelper.onData (/smartbed-mqtt/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:60:18) at Socket. (/smartbed-mqtt/node_modules/@2colors/esphome-native-api/lib/utils/plaintextFrameHelper.js:7:47) at Socket.emit (node:events:517:28) error [2024-03-02T10:43:18.675Z] Error: Already connected. Can't connect. error [2024-03-02T10:43:18.676Z] Exit code: 2 warn [2024-03-02T10:43:18.677Z] Shutting down Smartbed-MQTT...

ExR90 commented 8 months ago

Figured out why from Discord, need to add encryption key to the config entry for the bed type you use:

This should be added to the install notes to help others.

Though now that I am through that and the service is running fine I am not seeing any new devices appear in the devices/integrations. Not really sure what to do next.

richardhopton commented 8 months ago

I'll ping you on Discord cos it sounds like your configuration is not quite right.

Aqua1ung commented 8 months ago

Though now that I am through that and the service is running fine I am not seeing any new devices appear in the devices/integrations. Not really sure what to do next.

I'm in the same boat: service seems to be running fine, though no new device shows up, not even after triggering pairing mode. (Leggett and Platt base.)

richardhopton commented 8 months ago

Please join the discord for support.