Different beeps needs multiple gpio places error

This does not work anymore. It now gives an error.
“Pin 15 is used in multiple places.”

I don’t understand how to fix this. Why did it change to an error now?

THE ERROR OUTPUT:

INFO ESPHome 2024.9.2
INFO Reading configuration /config/esphome/laundry-wall.yaml…
Failed config

switch.gpio: [source /config/esphome/laundry-wall.yaml:341]

Pin 15 is used in multiple places.

  platform: gpio
  pin: 
    number: 15
    mode: 
      output: True
      input: False
      open_drain: False
      pullup: False
      pulldown: False
      analog: False
    inverted: False
  id: lauwall_buz
switch.gpio: [source /config/esphome/laundry-wall.yaml:351]
  
  Pin 15 is used in multiple places.
  platform: gpio
  pin: 
    number: 15
    mode: 
      output: True
      input: False
      open_drain: False
      pullup: False
      pulldown: False
      analog: False
    inverted: False
  id: lauwall_buz_a
switch.gpio: [source /config/esphome/laundry-wall.yaml:362]
  
  Pin 15 is used in multiple places.
  platform: gpio
  pin: 
    number: 15
    mode: 
      output: True
      input: False
      open_drain: False
      pullup: False
      pulldown: False
      analog: False
    inverted: False
  id: lauwall_bz_long

Have a look at allow_other_uses in the documentation for gpios.

https://esphome.io/guides/configuration-types.html

It changed quite a while ago in ESPHome

PS putting your code in quotes allows others to read easier and more likely to get a response.

This works. Note the “allow_other_uses: True”

Also I found the “Preformatted text” button. Mine is hidden in the gear now.
I didn’t notice “Blockquote” didn’t work.

switch:

# buzzers
  - platform: gpio
    pin: 
      number: GPIO15  #D8 #choose a free pin here
      allow_other_uses: True    # THIS IS NOW NEEDED 
    id: lauwall_buz
    name: "Lau Wall buz"
    on_turn_on:
    - rtttl.play: 'short:d=4,o=5,b=100:16e6'
    - delay: 5s # add delay here
    on_turn_off:
    - rtttl.stop

You shouldn’t need to use that option.

Possibly a copy switch might fit your use case (although I’m not sure from your yaml snippet).

Could be that you need on_multi_click.

Not sure I follow… I don’t see an alternative from the links you’ve provided.

If you explain your use case and/or share your full yaml I can try to give more specific ideas, if you’d like to try to avoid reusing pins.