Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Input Flickering Issue with KC868-A16
#4
The debounce filter ensures that the input signal is stable and ignores short, unintended changes (debounce is used to filter out the bouncing effect of mechanical buttons).
Code:
# Configuring a binary sensor (button or switch input)
binary_sensor:
  - platform: gpio  # Use the GPIO platform to read the input
    name: "PCF8574 Input 7"  # The name of the sensor, visible in platforms like Home Assistant
    pin:
      pcf8574: pcf8574_hub  # Reference the PCF8574 hub ID defined earlier
      number: 7  # The input will be read from pin number 7 on the PCF8574 chip
      mode: INPUT  # The pin mode is set as input
      inverted: false  # Whether the signal is inverted, false means it's not inverted
    filters:
      - debounce: 50ms  # The debounce filter to delay by 50 milliseconds to handle button bounce
    on_press:
      - logger.log: "Button Pressed"  # Logs "Button Pressed" when the button is pressed
    on_release:
      - logger.log: "Button Released"  # Logs "Button Released" when the button is released
Reply


Messages In This Thread
Input Flickering Issue with KC868-A16 - by amir - 09-10-2024, 07:03 AM
RE: Input Flickering Issue with KC868-A16 - by admin - 09-10-2024, 11:00 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)