2024-10-24 21:08:03 +02:00
|
|
|
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:
|
2024-10-25 14:36:24 +02:00
|
|
|
- speaker_media_player.play_local_media_file: wake_word_trigger_sound
|
2024-10-28 13:01:44 +01:00
|
|
|
- speaker_media_player.stop_stream: media
|
2024-10-25 14:36:24 +02:00
|
|
|
- speaker_media_player.play_local_media_file:
|
2024-10-24 21:08:03 +02:00
|
|
|
media_file: wake_word_trigger_sound
|
|
|
|
announcement: true
|
2024-10-28 13:01:44 +01:00
|
|
|
- speaker_media_player.stop_stream: announcement
|
2024-10-24 21:08:03 +02:00
|
|
|
|
|
|
|
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:
|
2024-10-25 14:36:24 +02:00
|
|
|
- platform: speaker
|
|
|
|
id: speaker_media_player
|
2024-10-24 21:08:03 +02:00
|
|
|
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:
|
2024-10-25 14:36:24 +02:00
|
|
|
- speaker_media_player.set_ducking:
|
2024-10-24 21:08:03 +02:00
|
|
|
decibel_reduction: 20
|
|
|
|
duration: 0.0s
|
|
|
|
- wait_until:
|
|
|
|
media_player.is_idle:
|
2024-10-25 14:36:24 +02:00
|
|
|
- speaker_media_player.set_ducking:
|
2024-10-24 21:08:03 +02:00
|
|
|
decibel_reduction: 0
|
|
|
|
duration: 2.0s
|