Error connecting

User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Error connecting

Post by durosity »

I'm fairly new to this ESP32 stuff but I think I'm starting to get the hang of it.

I'm having a problem getting Indigo to connect to the ESP32. I have previously been able to get it to connect when I experimented with it last year, but now I'm finally getting something up and running it's not working.

This particular ESP32 device is configured for measuring if the bed is occupied or not using thin film resistance sensors and is configured thusly:

Code: Select all

# --- ANALOG PRESSURE SENSORS ---
sensor:
  - platform: adc
    pin: GPIO36
    name: "Master Bedroom Bed Occupancy Sensor Voltage"
    id: MBBOSV
    update_interval: 1s
    attenuation: 12db

  - platform: adc
    pin: GPIO39
    name: "Master Bedroom Clothes Basket Sensor Voltage"
    id: MBCBSV
    update_interval: 1s
    attenuation: 12db

binary_sensor:
  - platform: template
    name: "Master Bedroom Bed Occupancy Sensor"
    device_class: occupancy
    lambda: |-
      if (id(MBBOSV).state > 3.0) {
        return true;
      } else {
        return false;
      }
    filters:
      - delayed_on: 0s
      - delayed_off: 0s

  - platform: template
    name: "Master Bedroom Clothes Basket Sensor"
    device_class: occupancy
    lambda: |-
      if (id(MBCBSV).state > 3.0) {
        return true;
      } else {
        return false;
      }
    filters:
      - delayed_on: 0s
      - delayed_off: 0s
Home Assistant sees these sensors and updates correctly. However when I try to get this plugin to connect It goes through a state of Starting Up then after a while goes to offline. I've enabled debug logging for startup:

Code: Select all

Requirements for "ESPHome Indigo Plugin 0.1.14" previously processed, continuing startup
   ESPHome Indigo Plugin Debug     (plugin.py:__init__:881): logLevel = 10
   ESPHome Indigo Plugin           ================================================ Initializing New Plugin Session =================================================
   ESPHome Indigo Plugin           Plugin name:                   ESPHome Indigo Plugin
   ESPHome Indigo Plugin           Plugin version:                0.1.14
   ESPHome Indigo Plugin           Plugin ID:                     com.GlennNZ.indigoplugin.ESPhome4indigo
   ESPHome Indigo Plugin           Indigo version:                2025.1.0
   ESPHome Indigo Plugin           Python version:                3.11.6 (v3.11.6:8b6ee5ba3b, Oct  2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)]
   ESPHome Indigo Plugin           Indigo License:                ActiveSubscription
   ESPHome Indigo Plugin           Architecture:                  arm64
   ESPHome Indigo Plugin           ================================================ Initializing New Plugin Session =================================================
   ESPHome Indigo Plugin           
   Started plugin "ESPHome Indigo Plugin 0.1.14"
   ESPHome Indigo Plugin Debug     (plugin.py:startup:946): startup called
   ESPHome Indigo Plugin Debug     (plugin.py:_run_async_thread:957): _run_async_thread starting
   ESPHome Indigo Plugin Debug     (plugin.py:__init__:112): Within init of ESP Home4Indigo
   ESPHome Indigo Plugin Debug     (plugin.py:__init__:130): End of init ESP Home4Indigo
   ESPHome Indigo Plugin Debug     (plugin.py:_async_start:973): _async_start
   ESPHome Indigo Plugin Debug     (plugin.py:_async_start:974): Starting event loop and setting up any connections
   ESPHome Indigo Plugin Debug     (plugin.py:loop_esphome:781): Loop ESPHOME Started for Master Bedroom Weight Measure.
   ESPHome Indigo Plugin Debug     (plugin.py:loop_esphome:790): Running connect
   ESPHome Indigo Plugin Debug     (plugin.py:loop_esphome:818): Timeout Exception.  Retry
   ESPHome Indigo Plugin Debug     (plugin.py:disconnect_linked:753): Disconnecting linked devices from Master Bedroom Weight Measure
In the ESPHome log I'm getting:

Code: Select all

[19:05:58.257][D][api:160]: Accept 10.0.1.10
[19:05:58.267][D][api.connection:1383]: Indigo Master Bedroom Weight Measure (10.0.1.10) connected
Then a moment later:

Code: Select all

[19:06:28.266][W][api.connection:1880]: Indigo Master Bedroom Weight Measure (10.0.1.10): Reading failed CONNECTION_CLOSED errno=128
I've confirmed it's the right IP address and port (and if it weren't I wouldn't expect the log entries in ESPHome), but I'm now rather perpexed as to what's causing it and what can be done to connect to get this data into Indigo. Any ideas?
Computer says no.
User avatar
GlennNZ
Posts: 1872
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Re: Error connecting

Post by GlennNZ »

Thats no good.

Seems like you have done all the right things.

Should be very straight forward - IP address and connects and stays connected.

I suspect has been some breaking library changes (at ESPHome) which your newer firmware devices are having issues with - likely I will need to update plugin for… I’ll have a look… shouldn’t be long..


Sent from my iPad using Tapatalk
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Error connecting

Post by durosity »

GlennNZ wrote: Sat Nov 08, 2025 1:39 pm Seems like you have done all the right things.
Yay for basic troubleshooting! And thank you for looking into it, no rush of course 🙂
Computer says no.
User avatar
GlennNZ
Posts: 1872
Joined: Sun Dec 07, 2014 3:33 pm
Location: Central Coast, Australia

Error connecting

Post by GlennNZ »

Okay.

Try 0.1.25
Release there now, and have updated Plugin Store (fairly happy will be fine….)

There were quite a few library breaking changes, and resulting ESPHome firmware incompatibilities. Biggest one being unique_id no longer exists … more like non-existent Id…

Should all be backwards compatible now in this version, with older firmware devices and have a few which have tested.

You will need to delete your not setup plugin device, or recreate child devices (button in Edit). Any already set up device shouldn’t notice any change.

Glenn


Sent from my iPad using Tapatalk
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Error connecting

Post by durosity »

That seems to be working perfectly, thank you!
Computer says no.
Post Reply

Return to “ESPHome4Indigo”