8000 Feedback cover gets inconsistent state after transient spike on a sensor · Issue #6660 · esphome/issues · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feedback cover gets inconsistent state after transient spike on a sensor #6660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vdeconinck opened this issue Jan 8, 2025 · 1 comment
Labels

Comments

@vdeconinck
Copy link
vdeconinck commented Jan 8, 2025

The problem

I am using a feedback cover for my parking gate, which has 4 "state" sensors: 2 limit switches (open/closed) and 2 motor sensors (opening/closing).
The cover works perfectly 99.9% of the time but, sometimes, an ingress spike is created by the motor current on the opposite sensor (e.g. at the end of the closing phase, the "opening" sensor registers a transient on/off).
In that case, the issue is that the feedback cover is left in an inconsistent state:
although the gate is really closed, and the position of the cover is "100% closed", and the "open" action is enabled, and the "close" action is disabled,
the state of the cover is "Open" instead of "Closed"...
That can be seen in the following captures taken 2 hours after the gate was closed (info highlighted in green is consistent, red is not):

ESPHome FeedbackCover bug 1

Here is the history log in text and graphical form:

ESPHome FeedbackCover bug 2

The transient spike on the "is_gate_opening" sensor can be seen at 07:29:04 and is immediately followed by a "Was Opened" state (although only the "is_gate_closed" sensor is On). The state of the gate is thus left "Open".

Which version of ESPHome has the issue?

2024-12-2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2025.1.1

What platform are you using?

ESP8266

Board

D1 mini

Component causing the issue

Feedback cover

YAML Config

esphome:
  name: "esp-parking" 
  friendly_name: ESP Parking

esp8266:
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "************"

ota:
  password: "************"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp-Parking Fallback Hotspot"
    password: "************"
  manual_ip:
    static_ip: ************
    gateway: ************
    subnet: ************
    
captive_portal:
    
output:
  - platform: gpio
    pin: D7
    id: gate_control_close
  - platform: gpio
    pin: D8
    id: gate_control_open
  - platform: gpio
    pin: D4
    id: gate_control_stop
    inverted: true

binary_sensor:
  - platform: gpio
    id: is_gate_opening
    name: is_gate_opening
    pin:
      number: D1
      mode:
        input: true
        pullup: true
      inverted: true
  - platform: gpio
    id: is_gate_closing
    name: is_gate_closing
    pin:
      number: D2
      mode:
        input: true
        pullup: true
      inverted: true
  - platform: gpio
    name: "Gate obstacle detected"
    pin:
      number: D3
      mode:
        input: true
        pullup: true
      inverted: true
  - platform: gpio
    id: is_gate_open
    name: is_gate_open
    pin:
      number: D5
      mode:
        input: true
        pullup: true
      inverted: true
  - platform: gpio
    id: is_gate_closed
    name: is_gate_closed
    pin:
      number: D6
      mode:
        input: true
        pullup: true
      inverted: true

cover:
  - platform: feedback
    device_class: gate
    name: "ParkingGate"
    id: parking_gate
    has_built_in_endstop: True
    open_action:
      - output.turn_on: gate_control_open
      - delay: 300ms
      - output.turn_off: gate_control_open
    open_duration: 20s
    open_endstop: is_gate_open
    open_sensor: is_gate_opening
    close_action:
      - output.turn_on: gate_control_close
      - delay: 300ms
      - output.turn_off: gate_control_close
    close_duration: 20s
    close_endstop: is_gate_closed
    close_sensor: is_gate_closing
    stop_action:
      - output.turn_on: gate_control_stop
      - delay: 300ms
      - output.turn_off: gate_control_stop

script:
  - id: postman_access
    then:
      - cover.control: 
          id: parking_gate
          position: 25%        
      - delay: 65s # must be = opening time + duration of the "open" phase
      - cover.close: parking_gate     
      - delay: 8s # must be = closing time + a few secs (motor slows down when nearing full close)
      - switch.turn_off: postman

switch:
  - platform: template
    name: "Postman"
    id: postman
    optimistic: True #otherwise it turns off automatically after a delay as it has no confirmation of a state
    turn_on_action:
      - script.execute: postman_access    
    turn_off_action:
      - script.stop: postman_access
      - cover.stop: parking_gate

button:
  - platform: restart # reboot button
    name: "Gate module reboot"
  - platform: output
    name: "Gate control open"
    output: gate_control_open
    duration: 300ms

  - platform: output
    name: "Gate control close"
    output: gate_control_close
    duration: 300ms

  - platform: output
    name: "Gate control stop"
    output: gate_control_stop
    duration: 300ms 
    
sensor:
  # wifi signal level in dBm 
  - platform: wifi_signal
    name: "Gate WiFi signal"
    update_interval: 60s
  # ESP uptime (to track reboots, if any)
  - platform: uptime
    name: Uptime Sensor

Anything in the logs that might be useful for us?

No response

Additional information

Details on the build, with pictures, schematics and a video demo (of the 99.9% case when it works ;-)) can be found in my blog post at http://blog.deconinck.info/post/2024/01/20/Came-Home-Assistant-Interface

Copy link
github-actions bot commented May 9, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant
0