Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can A1 to A4 used as buttons too?
#1
Hello, I'm going to buy a couple of these boards for a new house but I'd like to know if the connectors A1 to A4 can be used to attach more switches/buttons.

I will use ESPHOME and connect the boards to Home Assistant. These extra buttons would be nice to have for activating automations.

In the schematics the connectors are attached to pin 36, 35, 34 and 39. Searches on google tells me that it might work but I'd like a confirmation from who built the board  Big Grin

Thank you
Reply
#2
sure, if you want analog input port use for button, no problem, if you want let output different voltage, so you can add many button by one GPIO. because different voltage output means different button pressed.
Reply
#3
(01-09-2023, 12:43 AM)admin Wrote: sure, if you want analog input port use for button, no problem, if you want let output different voltage, so you can add many button by one GPIO. because different voltage output means different button pressed.

Hello, I received the boards. I tried to connect A1 to ground and use it as another input but that does not work.

Can you please provide me an example? I'm using esphome
Reply
#4
if use analog input trigger output, you need to create config. how about your ESPHome ymal file? you can list at here.
Reply
#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
#6
yes, you are right, you can use Analog Threshold Binary Sensor in ESPHome. You can connect a extend power supply, such as 3V, then set the "threshold:2.0" or other value, just means: when analog input > xx.xx v = ON
Reply
#7
Make sense.

Instead of using another power supply can i use the 12v provided to the board or is too much?
Reply
#8
analog input MAX 5V, if connect with 12v will be bad. you can connect power supply <=5V is ok.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)