This commit is contained in:
Kevin Ahrendt 2024-10-24 19:08:03 +00:00
parent 502ebc3c0e
commit d6adb83396
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,66 @@
esphome:
on_boot:
then:
- media_player.volume_set: 0.5
- media_player.volume_up:
- media_player.volume_down:
- if:
condition:
or:
- media_player.is_idle:
- media_player.is_playing:
then:
- media_player.play_media: http://localhost/media.mp3
- media_player.pause:
- media_player.toggle:
- media_player.stop:
- nabu.play_local_media_file: wake_word_trigger_sound
- nabu.stop_pipeline: media
- nabu.play_local_media_file:
media_file: wake_word_trigger_sound
announcement: true
- nabu.stop_pipeline: announcement
wifi:
ssid: MySSID
password: password1
i2s_audio:
i2s_mclk_pin: 15
i2s_lrclk_pin: 16
i2s_bclk_pin: 17
speaker:
- platform: i2s_audio
id: speaker_id
dac_type: external
i2s_dout_pin: 12
sample_rate: 16000
media_player:
- platform: nabu
id: nabu_media_player
name: Media Player
speaker: speaker_id
sample_rate: 16000
volume_increment: 0.02
volume_min: 0.0
volume_max: 1.0
files:
- id: wake_word_trigger_sound
file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/wake_word_triggered.flac
on_mute:
- wait_until:
media_player.is_idle:
on_unmute:
- wait_until:
media_player.is_idle:
on_volume:
- nabu.set_ducking:
decibel_reduction: 20
duration: 0.0s
- wait_until:
media_player.is_idle:
- nabu.set_ducking:
decibel_reduction: 0
duration: 2.0s

View file

@ -0,0 +1 @@
<<: !include common.yaml