esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
285 stars 34 forks source link

on_click condition never reached with remote_receiver #5765

Open dbozec opened 2 weeks ago

dbozec commented 2 weeks ago

The problem

When trying to trigger some code on a button click from an IR remote control with the remote_receiver component, it doesn't work with on_click condition. It works with on_press condition but I'm unable to make it work with on_click or with on_double_click

Which version of ESPHome has the issue?

2023.12.5

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

all

What platform are you using?

ESP32-IDF

Board

esp32doit-espduino

Component causing the issue

IR receiver

Example YAML snippet

switch:
  - platform: gpio
    pin: GPIO13
    name: "Relay"
    id: relay_1

binary_sensor:
  - platform: remote_receiver
    name: "Power"
    samsung:
      data: 0xE0E036C9
      nbits: 32
    on_click:
      then:
        - switch.toggle: relay_1

remote_receiver:
  pin:
    number: GPIO26
    inverted: true
    mode:
      input: true
      pullup: true

Anything in the logs that might be useful for us?

No response

Additional information

In the YAML example, if you replace on_click with on_press it will work

Conversation about this : https://community.home-assistant.io/t/detect-double-click-on-remote-receiver/715255

dbozec commented 2 weeks ago

It seems that min_length must be configured to less than the default value to make on_click work. 10ms seems to be a good value. Still I'm unable to make on_double_click work, but it may be a normal behavior ?