here is a little tweak>
output:
- platform: esp8266_pwm
pin: GPIO0 #D3
id: buzzer_output
rtttl:
output: buzzer_output
on_finished_playback:
- switch.turn_off: buzzer_switch1
- switch.turn_off: buzzer_switch2
- switch.turn_off: buzzer_switch3
- switch.turn_off: buzzer_switch4
- switch.turn_off: buzzer_switch5
switch:
- platform: gpio
pin: GPIO0 #D3
name: "BuzzerMission"
id: buzzer_switch1
on_turn_on:
- rtttl.play: 'MissionImp:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,a#,g,2d,32p,a#,g,2c#,32p,a#,g,2c,a#5,8c,2p,32p,a#5,g5,2f#,32p,a#5,g5,2f,32p,a#5,g5,2e,d#,8d'
on_turn_off:
- rtttl.stop
- switch.turn_off: buzzer_switch1
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
pin: GPIO0 #D3
name: "BuzzerMario"
id: buzzer_switch2
on_turn_on:
- rtttl.play: 'mario:d=4,o=5,b=100:16e6,16e6,32p,8e6,16c6,8e6,8g6,8p,8g,8p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,16p,8c6,16p,8g,16p,8e,16p,8a,8b,16a#,8a,16g.,16e6,16g6,8a6,16f6,8g6,8e6,16c6,16d6,8b,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16c7,16p,16c7,16c7,p,16g6,16f#6,16f6,16d#6,16p,16e6,16p,16g#,16a,16c6,16p,16a,16c6,16d6,8p,16d#6,8p,16d6,8p,16c6'
on_turn_off:
- rtttl.stop
- switch.turn_off: buzzer_switch2
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
pin: GPIO0 #D3
name: "Buzzer2"
id: buzzer_switch3
on_turn_on:
- rtttl.play: 'scale_up:d=32,o=5,b=100:c,c#,d#,e,f#,g#,a#,b'
on_turn_off:
- rtttl.stop
- switch.turn_off: buzzer_switch3
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
pin: GPIO0 #D3
name: "BuzzerStarWars"
id: buzzer_switch4
on_turn_on:
- rtttl.play: 'star_wars:d=16,o=5,b=100:4e,4e,4e,8c,p,g,4e,8c,p,g,4e,4p,4b,4b,4b,8c6,p,g,4d#,8c,p,g,4e,8p'
on_turn_off:
- rtttl.stop
- switch.turn_off: buzzer_switch4
restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
pin: GPIO0 #D3
name: "Buzzer2short"
id: buzzer_switch5
on_turn_on:
- rtttl.play: 'two_short:d=4,o=5,b=100:16e6,16e6'
on_turn_off:
- rtttl.stop
- switch.turn_off: buzzer_switch5
restore_mode: RESTORE_DEFAULT_OFF