From fe081bf14504e5370f5f8bf843c6263a97864780 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 16 Oct 2025 12:27:35 +0200 Subject: [PATCH] Updated Raspiaudio Muse Luxe to latest microww config. --- esphome/raspiaudio-muse-luxe.yaml | 47 ++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/esphome/raspiaudio-muse-luxe.yaml b/esphome/raspiaudio-muse-luxe.yaml index 1f0946d..0698096 100644 --- a/esphome/raspiaudio-muse-luxe.yaml +++ b/esphome/raspiaudio-muse-luxe.yaml @@ -22,9 +22,6 @@ ota: external_components: - source: github://RASPIAUDIO/esphomeLuxe@main -# - source: -# type: local -# path: components components: [es8388] refresh: 0s @@ -47,6 +44,9 @@ esphome: platformio_options: board_build.flash_mode: dio board_build.arduino.memory_type: qio_opi + project: + name: raspiaudio.voice-assistant + version: "2025.2.6" on_boot: priority: -100.0 then: @@ -213,6 +213,19 @@ sensor: - lambda: return clamp(x, 0.0f, 100.0f); binary_sensor: + - platform: gpio + pin: + number: GPIO27 + mode: + input: true + pullup: true + id: jack_detect + name: Jack Detect + internal: true + on_press: + - script.execute: jack_detect_high + on_release: + - script.execute: jack_detect_low - platform: gpio pin: number: GPIO19 @@ -292,6 +305,7 @@ light: update_interval: 2s i2s_audio: + id: i2s0 i2s_lrclk_pin: GPIO25 i2s_bclk_pin: GPIO5 i2s_mclk_pin: GPIO0 @@ -299,6 +313,7 @@ i2s_audio: microphone: - platform: i2s_audio id: luxe_mic + i2s_audio_id: i2s0 sample_rate: 16000 i2s_din_pin: GPIO35 bits_per_sample: 16bit @@ -312,20 +327,22 @@ speaker: dac_type: external sample_rate: 48000 bits_per_sample: 16bit - channel: stereo + num_channels: 2 buffer_duration: 100ms media_player: - platform: speaker name: None id: luxe_media_player + internal: false +# task_stack_in_psram: true # volume_min: 0.5 # volume_max: 0.8 announcement_pipeline: speaker: luxe_speaker format: FLAC sample_rate: 48000 - num_channels: 2 + num_channels: 1 files: - id: little_sound file: https://github.com/esphome/home-assistant-voice-pe/raw/dev/sounds/timer_finished.flac @@ -384,6 +401,7 @@ voice_assistant: on_tts_start: - logger.log: "answering 4 => phase" + - micro_wake_word.stop: - lambda: |- id(phase) = 4; - script.execute: update_led @@ -403,8 +421,23 @@ voice_assistant: ######### # Scripts - script: + - id: jack_detect_high + then: + - logger.log: "Jack detect high -> route to speaker" + - output.turn_off: dac_mute + - lambda: |- + id(my_es8388).write_byte(0x1D, 0x20); + id(my_es8388).write_byte(0x1C, 0x10); + id(my_es8388).write_byte(0x04, 0x30); + - id: jack_detect_low + then: + - logger.log: "Jack detect low -> route to line out" + - output.turn_on: dac_mute + - lambda: |- + id(my_es8388).write_byte(0x1D, 0x00); + id(my_es8388).write_byte(0x1C, 0x00); + id(my_es8388).write_byte(0x04, 0x0C); - id: update_led then: - logger.log: "==>>>update_led" @@ -429,7 +462,7 @@ script: - lambda: id(phase) = 1; - media_player.speaker.play_on_device_media_file: media_file: little_sound - announcement: true + announcement: false - script.execute: update_led - id: waiting