ESP32 supermini using ESPhome running automations on boot/shutdown

I am trying to enable a few multi-purpose buttons around the house. 4 buttons per device, 4 actions per button. I have finally gotten the inputs and events to work as intended, but my automations/events are triggered on boot. I have enabled the debounce filters (delay_on_off: 100ms), but all attempts have failed to stop boot triggers. Considering these devices can be tied to up to 16 HA actions if all actions are triggered every time power is removed and restored or every time ESPhome pushes an update, it will be a chaotic mess if I can’t mitigate this issue. Any help is appreciated.
TYIA

esphome:
  name: tinybutton
  friendly_name: tinyButton

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

logger:
api:
  encryption:
    key: *******

ota:
  - platform: esphome
    password: $$$$$$$$$

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "Esptiny Fallback Hotspot"
    password: "1y684PhLkg6W"
# The "Brain" that sends events to Home Assistant

event:
  - platform: template
    name: "button1triple"
    id: triple1
    event_types:
      - "triple1pressed"
  - platform: template
    name: "button1double"
    id: double1
    event_types:
      - "double1pressed"
  - platform: template
    name: "button1single"
    id: single1
    event_types:
      - "single1"
  - platform: template
    name: "button1long"
    id: long1
    event_types:
      - "long1"
  - platform: template
    name: "button2triple"
    id: triple2
    event_types:
      - "triple2pressed"
  - platform: template
    name: "button2double"
    id: double2
    event_types:
      - "double2pressed"
  - platform: template
    name: "button2single"
    id: single2
    event_types:
      - "single2"
  - platform: template
    name: "button2long"
    id: long2
    event_types:
      - "long2"
  - platform: template
    name: "button3triple"
    id: triple3
    event_types:
      - "triple3pressed"
  - platform: template
    name: "button3double"
    id: double3
    event_types:
      - "double3pressed"
  - platform: template
    name: "button3single"
    id: single3
    event_types:
      - "single3"
  - platform: template
    name: "button3long"
    id: long3
    event_types:
      - "long3"
  - platform: template
    name: "button4triple"
    id: triple4
    event_types:
      - "triple4pressed"
  - platform: template
    name: "button4double"
    id: double4
    event_types:
      - "double4pressed"
  - platform: template
    name: "button4single"
    id: single4
    event_types:
      - "single4"
  - platform: template
    name: "button4long"
    id: long4
    event_types:
      - "long4"

binary_sensor:
  - platform: gpio
    name: "Button1"
    id: button_input1
    pin:
      number: 4
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_on_off: 50ms
    on_multi_click:

  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger:
            id: triple1
            event_type: "triple1pressed"

  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger: 
            id: double1
            event_type: "double1pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger: 
            id: single1
            event_type: "single1"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - event.trigger: 
            id: long1
            event_type: "long1"

  - platform: gpio
    name: "Button2"
    id: button_input2
    pin:
      number: 3
      inverted: true
      mode: INPUT_PULLUP
    filters:      
      - delayed_on_off: 50ms
    on_multi_click:
  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger:
            id: triple2
            event_type: "triple2pressed"

  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger: 
            id: double2
            event_type: "double2pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger: 
            id: single2
            event_type: "single2"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - event.trigger: 
            id: long2
            event_type: "long2"

  - platform: gpio
    name: "Button3"
    id: button_input3
    pin:
      number: 5
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_on_off: 50ms
    on_multi_click:
  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger:
            id: triple3
            event_type: "triple3pressed"

  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger: 
            id: double3
            event_type: "double3pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger: 
            id: single3
            event_type: "single3"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - event.trigger: 
            id: long3
            event_type: "long3"

  - platform: gpio
    name: "Button4"
    id: button_input4
    pin:
      number: 6
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_on_off: 50ms
    on_multi_click:
  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger:
            id: triple4
            event_type: "triple4pressed"
  
  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then: 
        - event.trigger: 
            id: double4
            event_type: "double4pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - event.trigger: 
            id: single4
            event_type: "single4"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - event.trigger: 
            id: long4
            event_type: "long4"

You could use global variable boolean as a flag. Then set that flag true on on_boot. And on your binary sensors check that the flag is set.

 on_boot:
    priority: -100
    then:
      - delay: 1s
      - lambda: |-
          id(boot_done) = true;

Pardon my ignorance, but what is allowed a conditional operation, I know .yaml does not support 'if(x == y then()). Is the condition of boot_done = true the event gate or the event.trigger gate?

Lambda does. But you don’t need it.

globals:
  - id: boot_done
    type: bool
    restore_value: no
    initial_value: 'false'

So the on_boot sets the boolean and your binary sensor checks it

    on_multi_click:
      - timing:
          - ON for at most 0.5s
          - OFF for at least 0.2s
        then:
          - if:
              condition:
                lambda: 'return id(boot_done);'
              then:
                - event.trigger:
                ...

The event is still being triggered. I installed it again to be sure that it wasn’t triggering during the shutdown. I added my new code in case I misunderstood or mistyped something.

esphome:
  name: tinybutton
  friendly_name: tinyButton

  on_boot:
    priority: -100
    then:
      - delay: 1s
      - lambda: |-
          id(boot_done) = true;

globals:
  - id: boot_done
    type: bool
    restore_value: no
    initial_value: 'false'

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

logger:
api:
  encryption:
    key: blah

ota:
  - platform: esphome
    password: boo

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "Esptiny Fallback Hotspot"
    password: "1y684PhLkg6W"
# The "Brain" that sends events to Home Assistant

event:
  - platform: template
    name: "button1triple"
    id: triple1
    event_types:
      - "triple1pressed"
  - platform: template
    name: "button1double"
    id: double1
    event_types:
      - "double1pressed"
  - platform: template
    name: "button1single"
    id: single1
    event_types:
      - "single1"
  - platform: template
    name: "button1long"
    id: long1
    event_types:
      - "long1"
  - platform: template
    name: "button2triple"
    id: triple2
    event_types:
      - "triple2pressed"
  - platform: template
    name: "button2double"
    id: double2
    event_types:
      - "double2pressed"
  - platform: template
    name: "button2single"
    id: single2
    event_types:
      - "single2"
  - platform: template
    name: "button2long"
    id: long2
    event_types:
      - "long2"
  - platform: template
    name: "button3triple"
    id: triple3
    event_types:
      - "triple3pressed"
  - platform: template
    name: "button3double"
    id: double3
    event_types:
      - "double3pressed"
  - platform: template
    name: "button3single"
    id: single3
    event_types:
      - "single3"
  - platform: template
    name: "button3long"
    id: long3
    event_types:
      - "long3"
  - platform: template
    name: "button4triple"
    id: triple4
    event_types:
      - "triple4pressed"
  - platform: template
    name: "button4double"
    id: double4
    event_types:
      - "double4pressed"
  - platform: template
    name: "button4single"
    id: single4
    event_types:
      - "single4"
  - platform: template
    name: "button4long"
    id: long4
    event_types:
      - "long4"

binary_sensor:
  - platform: gpio
    name: "Button1"
    id: button_input1
    pin:
      number: 4
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_on_off: 50ms
    on_multi_click:
    

  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s 
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
              - event.trigger:
                  id: triple1
                  event_type: "triple1pressed"

  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
              - event.trigger: 
                  id: double1
                  event_type: "double1pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
              - event.trigger: 
                  id: single1
                  event_type: "single1"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger:
                id: long1
                event_type: "long1"

  - platform: gpio
    name: "Button2"
    id: button_input2
    pin:
      number: 3
      inverted: true
      mode: INPUT_PULLUP
    filters:      
      - delayed_on_off: 50ms
    on_multi_click:
  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger:
                id: triple2
                event_type: "triple2pressed"

  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: double2
                event_type: "double2pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: single2
                event_type: "single2"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: long2
                event_type: "long2"

  - platform: gpio
    name: "Button3"
    id: button_input3
    pin:
      number: 5
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_on_off: 50ms
    on_multi_click:
  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger:
                id: triple3
                event_type: "triple3pressed"

  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: double3
                event_type: "double3pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: single3
                event_type: "single3"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: long3
                event_type: "long3"

  - platform: gpio
    name: "Button4"
    id: button_input4
    pin:
      number: 6
      inverted: true
      mode: INPUT_PULLUP
    filters:
      - delayed_on_off: 50ms
    on_multi_click:
  # --- TRIPLE CLICK ---
    - timing:
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger:
                id: triple4
                event_type: "triple4pressed"
  
  # --- DOUBLE CLICK ---
    - timing:
      - ON for at most 0.5s
      - OFF for at most 0.3s
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: double4
                event_type: "double4pressed"

    # --- SINGLE CLICK --- 
    - timing:
      - ON for at most 0.5s
      - OFF for at least 0.2s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: single4
                event_type: "single4"
            
    # --- LONG PRESS ---
    - timing:
      - ON for at least 1.5s
      then:
        - if:
            condition:
              lambda: 'return id(boot_done);'
            then:
            - event.trigger: 
                id: long4
                event_type: "long4"

I also added more time to the delay. should the delay priority be higher?

Have a look at your esphome logs to see what’s going on.

Every event is triggered/detected. Do I need to change the way I turn multipress into an assignable action?

You need to see esphome logs


I’m sorry I haven’t done this level of debuggin before. I am an EE with a focus on power hardware, so I am a bit out of my depths here.

Go where you normally upload the code, next to install there is button “logs”.

INFO ESPHome 2026.1.2
INFO Reading configuration /config/esphome/esptiny.yaml...
WARNING WiFi AP is configured but neither captive_portal nor web_server is enabled. The AP will not be usable for configuration or monitoring. Add 'captive_portal:' or 'web_server:' to your configuration.
INFO Starting log output from tinybutton.local using esphome API
INFO Successfully resolved tinybutton.local in 0.266s
INFO Successfully connected to tinybutton @ 192.168.68.3 in 0.007s
INFO Successful handshake with tinybutton @ 192.168.68.3 in 0.098s
[14:16:49.614][I][app:206]: ESPHome version 2026.1.2 compiled on 2026-01-27 13:19:12 -0600
[14:16:49.614][I][app:213]: ESP32 Chip: ESP32-C3 r0.4, 1 core(s)
[14:16:49.614][C][logger:316]: Logger:
[14:16:49.614][C][logger:316]:   Max Level: DEBUG
[14:16:49.614][C][logger:316]:   Initial Level: DEBUG
[14:16:49.618][C][logger:322]:   Log Baud Rate: 115200
[14:16:49.618][C][logger:322]:   Hardware UART: USB_SERIAL_JTAG
[14:16:49.618][C][logger:332]:   Task Log Buffer Size: 768 bytes
[14:16:49.744][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button1'
[14:16:49.744][C][gpio.binary_sensor:152]:   Pin: GPIO4
[14:16:49.744][C][gpio.binary_sensor:073]:   Mode: interrupt
[14:16:49.744][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[14:16:49.776][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button2'
[14:16:49.781][C][gpio.binary_sensor:152]:   Pin: GPIO3
[14:16:49.783][C][gpio.binary_sensor:073]:   Mode: interrupt
[14:16:49.788][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[14:16:49.825][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button3'
[14:16:49.828][C][gpio.binary_sensor:152]:   Pin: GPIO5
[14:16:49.835][C][gpio.binary_sensor:073]:   Mode: interrupt
[14:16:49.853][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[14:16:50.039][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button4'
[14:16:50.059][C][gpio.binary_sensor:152]:   Pin: GPIO6
[14:16:50.059][C][gpio.binary_sensor:073]:   Mode: interrupt
[14:16:50.059][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[14:16:50.065][C][wifi:1304]: WiFi:
[14:16:50.065][C][wifi:1304]:   Local MAC: 34:CD:B0:D1:EE:64
[14:16:50.065][C][wifi:1304]:   Connected: YES
[14:16:50.066][C][wifi:1037]:   IP Address: 192.168.68.3
[14:16:50.066][C][wifi:1048]:   SSID: [redacted]
[14:16:50.066][C][wifi:1048]:   BSSID: [redacted]
[14:16:50.066][C][wifi:1048]:   Hostname: 'tinybutton'
[14:16:50.066][C][wifi:1048]:   Signal strength: -44 dB ▂▄▆█
[14:16:50.066][C][wifi:1048]:   Channel: 9
[14:16:50.066][C][wifi:1048]:   Subnet: 255.255.255.0
[14:16:50.066][C][wifi:1048]:   Gateway: 192.168.68.2
[14:16:50.066][C][wifi:1048]:   DNS1: 192.168.68.2
[14:16:50.066][C][wifi:1048]:   DNS2: 192.168.68.2
[14:16:50.076][C][esphome.ota:075]: Over-The-Air updates:
[14:16:50.076][C][esphome.ota:075]:   Address: tinybutton.local:3232
[14:16:50.076][C][esphome.ota:075]:   Version: 2
[14:16:50.076][C][esphome.ota:082]:   Password configured
[14:16:50.076][C][safe_mode:021]: Safe Mode:
[14:16:50.076][C][safe_mode:021]:   Successful after: 60s
[14:16:50.076][C][safe_mode:021]:   Invoke after: 10 attempts
[14:16:50.076][C][safe_mode:021]:   Duration: 300s
[14:16:50.087][C][safe_mode:038]:   Bootloader rollback: not supported
[14:16:50.088][C][api:221]: Server:
[14:16:50.088][C][api:221]:   Address: tinybutton.local:6053
[14:16:50.088][C][api:221]:   Listen backlog: 4
[14:16:50.088][C][api:221]:   Max connections: 8
[14:16:50.088][C][api:228]:   Noise encryption: YES
[14:16:50.132][C][mdns:177]: mDNS:
[14:16:50.132][C][mdns:177]:   Hostname: tinybutton

You made it. But there’s no activity yet here.

Did you want me to press some of the buttons and capture what is happening during proper operation?

No, just log that shows the lines from boot until the flag is set, binary sensor triggers and your problem occurs.
Log you posted above shows just the beginning of boot.

INFO ESPHome 2026.1.2
INFO Reading configuration /config/esphome/esptiny.yaml...
WARNING WiFi AP is configured but neither captive_portal nor web_server is enabled. The AP will not be usable for configuration or monitoring. Add 'captive_portal:' or 'web_server:' to your configuration.
INFO Generating C++ source...
INFO Compiling app... Build path: /data/build/tinybutton
Processing tinybutton (board: esp32-c3-devkitm-1; framework: arduino, espidf; platform: https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip)
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
 - contrib-piohome @ 3.4.4 
 - framework-arduinoespressif32 @ 3.3.5 
 - framework-arduinoespressif32-libs @ 5.5.0+sha.9bb7aa84fe 
 - framework-espidf @ 3.50502.0 (5.5.2) 
 - tool-cmake @ 4.0.3 
 - tool-esp-rom-elfs @ 2024.10.11 
 - tool-esptoolpy @ 5.1.0 
 - tool-mklittlefs @ 3.2.0 
 - tool-ninja @ 1.13.1 
 - tool-scons @ 4.40801.0 (4.8.1) 
 - toolchain-riscv32-esp @ 14.2.0+20251107
Reading CMake configuration...
Dependency Graph
|-- Networking @ 3.3.5
|-- noise-c @ 0.1.10
RAM:   [=         ]  10.2% (used 33384 bytes from 327680 bytes)
Flash: [=====     ]  53.0% (used 972752 bytes from 1835008 bytes)
========================= [SUCCESS] Took 11.92 seconds =========================
INFO Build Info: config_hash=0x1305f698 build_time_str=2026-01-27 16:13:31 -0600
INFO Successfully compiled program.
INFO Connecting to 192.168.68.3 port 3232...
INFO Connected to 192.168.68.3
INFO Uploading /data/build/tinybutton/.pioenvs/tinybutton/firmware.bin (973152 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 7.65 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.68.3 using esphome API
INFO Successfully resolved tinybutton @ 192.168.68.3 in 0.000s
INFO Successfully connected to tinybutton @ 192.168.68.3 in 5.160s
INFO Successful handshake with tinybutton @ 192.168.68.3 in 0.084s
[08:09:08.939][I][app:206]: ESPHome version 2026.1.2 compiled on 2026-01-27 16:13:31 -0600
[08:09:08.939][I][app:213]: ESP32 Chip: ESP32-C3 r0.4, 1 core(s)
[08:09:08.939][C][logger:316]: Logger:
[08:09:08.939][C][logger:316]:   Max Level: DEBUG
[08:09:08.939][C][logger:316]:   Initial Level: DEBUG
[08:09:08.955][C][logger:322]:   Log Baud Rate: 115200
[08:09:08.955][C][logger:322]:   Hardware UART: USB_SERIAL_JTAG
[08:09:08.955][C][logger:332]:   Task Log Buffer Size: 768 bytes
[08:09:09.073][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button1'
[08:09:09.075][C][gpio.binary_sensor:152]:   Pin: GPIO4
[08:09:09.075][C][gpio.binary_sensor:073]:   Mode: interrupt
[08:09:09.075][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[08:09:09.119][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button2'
[08:09:09.120][C][gpio.binary_sensor:152]:   Pin: GPIO3
[08:09:09.120][C][gpio.binary_sensor:073]:   Mode: interrupt
[08:09:09.132][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[08:09:09.175][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button3'
[08:09:09.175][C][gpio.binary_sensor:152]:   Pin: GPIO5
[08:09:09.180][C][gpio.binary_sensor:073]:   Mode: interrupt
[08:09:09.180][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[08:09:09.221][C][gpio.binary_sensor:016]: GPIO Binary Sensor 'Button4'
[08:09:09.221][C][gpio.binary_sensor:152]:   Pin: GPIO6
[08:09:09.221][C][gpio.binary_sensor:073]:   Mode: interrupt
[08:09:09.221][C][gpio.binary_sensor:075]:   Interrupt Type: ANY_EDGE
[08:09:09.365][C][wifi:1304]: WiFi:
[08:09:09.365][C][wifi:1304]:   Local MAC: 34:CD:B0:D1:EE:64
[08:09:09.365][C][wifi:1304]:   Connected: YES
[08:09:09.366][C][wifi:1037]:   IP Address: 192.168.68.3
[08:09:09.366][C][wifi:1048]:   SSID: [redacted]
[08:09:09.366][C][wifi:1048]:   BSSID: [redacted]
[08:09:09.366][C][wifi:1048]:   Hostname: 'tinybutton'
[08:09:09.366][C][wifi:1048]:   Signal strength: -44 dB ▂▄▆█
[08:09:09.366][C][wifi:1048]:   Channel: 9
[08:09:09.366][C][wifi:1048]:   Subnet: 255.255.255.0
[08:09:09.366][C][wifi:1048]:   Gateway: 192.168.68.2
[08:09:09.366][C][wifi:1048]:   DNS1: 192.168.68.2
[08:09:09.366][C][wifi:1048]:   DNS2: 192.168.68.2
[08:09:09.376][C][esphome.ota:075]: Over-The-Air updates:
[08:09:09.376][C][esphome.ota:075]:   Address: tinybutton.local:3232
[08:09:09.376][C][esphome.ota:075]:   Version: 2
[08:09:09.383][C][esphome.ota:082]:   Password configured
[08:09:09.390][C][safe_mode:021]: Safe Mode:
[08:09:09.390][C][safe_mode:021]:   Successful after: 60s
[08:09:09.390][C][safe_mode:021]:   Invoke after: 10 attempts
[08:09:09.390][C][safe_mode:021]:   Duration: 300s
[08:09:09.414][C][safe_mode:038]:   Bootloader rollback: not supported
[08:09:09.414][C][api:221]: Server:
[08:09:09.414][C][api:221]:   Address: tinybutton.local:6053
[08:09:09.414][C][api:221]:   Listen backlog: 4
[08:09:09.414][C][api:221]:   Max connections: 8
[08:09:09.414][C][api:228]:   Noise encryption: YES
[08:09:09.424][C][mdns:177]: mDNS:
[08:09:09.424][C][mdns:177]:   Hostname: tinybutton
[08:10:02.868][I][safe_mode:066]: Boot seems successful; resetting boot loop counter
[08:10:06.245][D][esp32.preferences:155]: Writing 1 items: 0 cached, 1 written, 0 failed

The triggers are happening at nearly the exact time the “Uploading” finishes and the one automation I have linked to the events is being run twice.

I have this as my set of inputs.


We need to see logs beyond that.
The one you posted doesn’t present anything related to your problem.
There’s no on_boot setting the global variable.
There’s no binary sensor triggered.
There’s no event triggered.

[08:56:48.825][C][mdns:177]:   Hostname: tinybutton
[08:57:42.335][I][safe_mode:066]: Boot seems successful; resetting boot loop counter
[08:57:43.245][D][esp32.preferences:155]: Writing 1 items: 0 cached, 1 written, 0 failed
[08:58:17.215][D][binary_sensor:047]: 'Button3' >> ON
[08:58:17.353][D][binary_sensor:047]: 'Button3' >> OFF
[08:58:19.015][D][binary_sensor:047]: 'Button4' >> ON
[08:58:19.132][D][binary_sensor:047]: 'Button4' >> OFF
[08:58:20.987][D][binary_sensor:047]: 'Button1' >> ON
[08:58:21.169][D][binary_sensor:047]: 'Button1' >> OFF
[08:58:22.728][D][binary_sensor:047]: 'Button2' >> ON
[08:58:22.832][D][binary_sensor:047]: 'Button2' >> OFF
[08:58:24.967][D][binary_sensor:047]: 'Button3' >> ON
[08:58:25.139][D][binary_sensor:047]: 'Button3' >> OFF
[08:58:26.446][D][binary_sensor:047]: 'Button1' >> ON
[08:58:26.696][D][binary_sensor:047]: 'Button1' >> OFF
[08:58:30.586][D][binary_sensor:047]: 'Button2' >> ON
[08:58:30.844][D][binary_sensor:047]: 'Button2' >> OFF
[08:58:31.654][D][binary_sensor:047]: 'Button3' >> ON
[08:58:31.898][D][binary_sensor:047]: 'Button3' >> OFF
[08:58:32.363][D][binary_sensor:047]: 'Button4' >> ON
[08:58:32.539][D][binary_sensor:047]: 'Button4' >> OFF
[08:58:33.331][D][binary_sensor:047]: 'Button1' >> ON
[08:58:33.470][D][binary_sensor:047]: 'Button1' >> OFF
[08:58:34.360][D][binary_sensor:047]: 'Button2' >> ON
[08:58:34.519][D][binary_sensor:047]: 'Button2' >> OFF
[08:58:34.980][D][binary_sensor:047]: 'Button3' >> ON
[08:58:35.136][D][binary_sensor:047]: 'Button3' >> OFF
[08:58:36.463][D][binary_sensor:047]: 'Button4' >> ON
[08:58:36.570][D][binary_sensor:047]: 'Button4' >> OFF
[08:58:39.099][D][binary_sensor:047]: 'Button4' >> ON
[08:58:39.509][D][binary_sensor:047]: 'Button4' >> OFF
[08:58:40.301][D][binary_sensor:047]: 'Button4' >> ON
[08:58:43.893][D][binary_sensor:047]: 'Button4' >> OFF
[08:58:47.072][D][binary_sensor:047]: 'Button4' >> ON
[08:58:47.205][D][binary_sensor:047]: 'Button4' >> OFF
[08:58:47.268][D][binary_sensor:047]: 'Button4' >> ON
[08:58:47.393][D][binary_sensor:047]: 'Button4' >> OFF
[08:58:48.662][D][binary_sensor:047]: 'Button3' >> ON
[08:58:50.033][D][binary_sensor:047]: 'Button3' >> OFF
[08:58:50.871][D][binary_sensor:047]: 'Button2' >> ON
[08:58:52.696][D][binary_sensor:047]: 'Button2' >> OFF
[08:58:53.584][D][binary_sensor:047]: 'Button1' >> ON
[08:58:55.294][D][binary_sensor:047]: 'Button1' >> OFF
[08:58:56.350][D][binary_sensor:047]: 'Button1' >> ON
[08:58:56.479][D][binary_sensor:047]: 'Button1' >> OFF
[08:58:56.537][D][binary_sensor:047]: 'Button1' >> ON
[08:58:56.639][D][binary_sensor:047]: 'Button1' >> OFF

that is only once the startup is complete.

And what is causing the on/off here?

I am pushing the button in this case.
I am trying to connect a stronger pull up resistor to aviod the low on reboot but it isn’t cutting it either. when I load updated code I get the event trigger twice, when I power up the board I get the event twice as well.