Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can A1 to A4 used as buttons too?
#5
I can, but its over 1200 lines. It includes single click, multi click and long click for every input that can later be configured in home assistant.

For now i tried this:

Code:
  - platform: gpio
    name: ""
    id: "A1_input"
    pin:
      number: 36
      mode: INPUT
      #inverted: true
    on_multi_click:
      - timing:
          - ON for at most 1s
          - OFF for at least 0.5s
        then:
        - switch.toggle: e16s_output16
        - logger.log: ${device_name} A1_input Single-Click
        - text_sensor.template.publish:
            id: A1_input_action
            state: !lambda 'return "single";'   
      - timing:
          - ON for at most 1s
          - OFF for at most 0.3s
          - ON for at most 1s
          - OFF for at least 0.2s
        then:
          - logger.log: ${device_name} A1_input Double-Click
          - text_sensor.template.publish:
              id: A1_input_action
              state: !lambda 'return "double";'
      - timing:
          - ON for 1s to 4s
          - OFF for at least 0.2s
        then:
          - logger.log: ${device_name} A1_input Long-Click
          - text_sensor.template.publish:
              id: A1_input_action
              state: !lambda 'return "long";'

This works with the normal inputs but not with A1 to A4

Since i do not want to damage the board, can you explain how to wire it to a button?

Do i have to use Analog Threshold Binary Sensor https://esphome.io/components/binary_sen...shold.html instead of a normal gpio platform?

Thank you
Reply


Messages In This Thread
Can A1 to A4 used as buttons too? - by exico - 01-08-2023, 05:42 PM
RE: Can A1 to A4 used as buttons too? - by admin - 01-09-2023, 12:43 AM
RE: Can A1 to A4 used as buttons too? - by exico - 01-31-2023, 07:21 PM
RE: Can A1 to A4 used as buttons too? - by admin - 01-31-2023, 11:15 PM
RE: Can A1 to A4 used as buttons too? - by exico - 02-01-2023, 06:34 PM
RE: Can A1 to A4 used as buttons too? - by admin - 02-02-2023, 01:12 AM
RE: Can A1 to A4 used as buttons too? - by exico - 02-02-2023, 09:12 AM
RE: Can A1 to A4 used as buttons too? - by admin - 02-02-2023, 10:23 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)