ESPhome feedback cover with garage door opener - random STOP trigger

Hi All,

I’m pretty new to ESPHome and am working on an ESP32 / ESPHome garage door opener with open and close reed switches and a relay. Everything is working on the test bench, but I am seeing random ‘STOP’ triggers when controlling from home assistant device control screen with the percentage open / closed screen (position mode). e.g.

When opening or closing the door using this screen, I see random ‘STOP’ triggers. e.g.

[11:30:33][D][cover:186]: Current Operation: OPENING
[11:30:33][D][cover:170]: ‘Single Garage’ - Publishing:
[11:30:33][D][cover:173]: Position: 70%
[11:30:33][D][cover:186]: Current Operation: IDLE
[11:30:33][D][feedback.cover:385]: ‘Single Garage’ - Firing ‘STOP’ trigger.

If I switch to the button mode, I don’t see these issues and the door opens / closes / stops as exptected.

YAML code:

esphome:
  name: garage_single
  on_boot:
    priority: 100
    then:
        if:
            condition:
                binary_sensor.is_on: closed_reed_switch
            then:
            - text_sensor.template.publish:
                id: template_text
                state: "Closed" 
            else:
            - text_sensor.template.publish:
                id: template_text
                state: "Not closed" 
                
esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  - platform: esphome
    password: ""

wifi:
  ssid: "******"
  password: "*******"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Garage single fallback Hotspot"
    password: "**********"

captive_portal:

switch:
  - platform: gpio
    pin: GPIO26
    name: "Garage Door relay"
    id: door_relay
    internal: true
    on_turn_on:
    - delay: 250ms
    - switch.turn_off: door_relay
    
sensor:
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: 60s
  - platform: uptime
    type: seconds
    name: Uptime Sensor
    update_interval: 30s
    
cover:
  - platform: feedback
    name: "Single Garage"
    id: single_garage
    has_built_in_endstop: true
    open_action:
      - switch.toggle: door_relay
      - text_sensor.template.publish:
         id: template_text
         state: "Opening"      
    open_duration: 0.5min
    open_endstop: open_reed_switch


    close_action:
      - switch.toggle: door_relay
      - text_sensor.template.publish:
          id: template_text
          state: "Closing"
    close_duration: 0.5min
    close_endstop: closed_reed_switch
    

    stop_action:
      - switch.toggle: door_relay
      - text_sensor.template.publish:
         id: template_text
         state: "Stopped/Idle"    

binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO25
      mode: INPUT_PULLUP
      inverted: true
    id: closed_reed_switch
    name: "closed reed"       
    on_state:
      if:
        condition:
           binary_sensor.is_on: closed_reed_switch
        then:
          - text_sensor.template.publish:
              id: template_text
              state: "Closed" 
        else:
          - text_sensor.template.publish:
              id: template_text
              state: "Partially open" 
              
  - platform: gpio
    pin: 
      number: GPIO27
      mode: INPUT_PULLUP
      inverted: true
    id: open_reed_switch
    name: "open reed"   
    on_state:
      if:
        condition:
           binary_sensor.is_on: open_reed_switch
        then:
          - text_sensor.template.publish:
              id: template_text
              state: "Open"
        else:
          - text_sensor.template.publish:
              id: template_text
              state: "Partially open" 
              
text_sensor:
  - platform: template
    name: "Door State"
    id: template_text

Can anyone give me some pointers as to what might be going on here?

Thanks

What does this mean? What is button mode?

Position Mode:


Random ‘STOP’ triggers occur in this mode.

Button Mode:


Opening, closing and stopping work as expected.

Position and Button modes can be switched by clicking on the appropriate icon in the area I’ve circled.

Then problem is HA related.
At least I don’t see anything could cause that on esphome side.

Yes, my thoughts as well.

I’ve just tested it on another instance of Home Assistant running on ESXi that and it’s doing exactly the same thing.

Delving into it further, it looks like I’ve misunderstood the ‘Position mode’ control. The control is position sensitive. If I click approximately 1/3 of the way up the purple control, the door will stop at approximately 1/3 of the way up. Using the debug mode I can see the following in the logs when using position mode.

DEBUG (MainThread) [aioesphomeapi.connection] garage_single @ 192.168.20.2: Sending CoverCommandRequest: key: 2591523455
has_position: true
position: 0.32

As can be seen, the position value is 0.32 (32%) and this is where it stops.

If I use the button mode, the following is logged:

DEBUG (MainThread) [aioesphomeapi.connection] garage_single @ 192.168.20.2: Sending CoverCommandRequest: key: 2591523455
has_position: true
position: 1

In this instance the position value is 1, i.e fully open and thus the door doesn’t stop until it is fully open.

So in summary, the behaviour is by design. I thought that the ‘Position mode’ was just a display of the status, but it is also a control.

Ya… You adjust the slider to set the position you would like the cover to Open/Close to. It explains this in the documentation.