To podstatné = mikrofony fungují. LEDka, podsvícení displeje a tlačítka také. Displej snad také, měl by, netestoval jsem. Repro nevím, zvuk jsem z něj na první pokus nevyloudil.
Kód: Vybrat vše
esphome:
name: s3box3
friendly_name: S3box3
platformio_options:
board_build.flash_mode: dio
esp32:
board: esp32s3box
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
# Enable logging
logger:
hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
encryption:
key: "jgVfSe0zIPTlfAEeM2zt5k2exvNL+6LK10sqsQ9qS3k="
ota:
password: "94431478a5e4b99a956cb61f1a9dcda8"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "S3Box3 Fallback Hotspot"
password: "sDHiUghr0220"
captive_portal:
# dashboard_import:
# package_import_url: github://esphome/firmware/voice-assistant/esp32-s3-box.yaml@main
binary_sensor:
- platform: gpio
pin:
number: GPIO1
inverted: true
name: "Mute"
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: true
name: Top Left Button
disabled_by_default: true
on_click:
- if:
condition:
switch.is_off: use_wake_word
then:
- if:
condition: voice_assistant.is_running
then:
- voice_assistant.stop:
- script.execute: reset_led
else:
- voice_assistant.start:
else:
- voice_assistant.stop
- delay: 1s
- script.execute: reset_led
- script.wait: reset_led
- voice_assistant.start_continuous:
- platform: status
id: api_connection
filters:
- delayed_on: 1s
on_press:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
on_release:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.stop:
output:
- platform: ledc
pin: GPIO47
id: backlight_output
light:
- platform: monochromatic
output: backlight_output
name: LCD Backlight
id: led
restore_mode: ALWAYS_OFF
disabled_by_default: true
default_transition_length: 0s
effects:
- pulse:
transition_length: 250ms
update_interval: 250ms
- pulse:
name: Fast Pulse
transition_length: 50ms
update_interval: 50ms
microphone:
- platform: esp_adf
id: box_mic
speaker:
- platform: esp_adf
id: box_speaker
voice_assistant:
id: va
microphone: box_mic
speaker: box_speaker
use_wake_word: true
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 2.0
vad_threshold: 3
on_listening:
- light.turn_on:
id: led
brightness: 100%
effect: pulse
on_tts_start:
- light.turn_on:
id: led
brightness: 75%
effect: pulse
on_end:
- delay: 100ms
- wait_until:
not:
speaker.is_playing:
- script.execute: reset_led
on_error:
- light.turn_on:
id: led
brightness: 50%
effect: fast_pulse
- delay: 1s
- script.execute: reset_led
- script.wait: reset_led
- lambda: |-
if (code == "wake-provider-missing" || code == "wake-engine-missing") {
id(use_wake_word).turn_off();
}
on_client_connected:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
- script.execute: reset_led
on_client_disconnected:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.stop:
- light.turn_off: led
script:
- id: reset_led
then:
- if:
condition:
switch.is_on: use_wake_word
then:
- light.turn_on:
id: led
brightness: 25%
effect: none
else:
- light.turn_off: led
switch:
- platform: template
name: Use wake word
id: use_wake_word
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- lambda: id(va).set_use_wake_word(true);
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
- script.execute: reset_led
on_turn_off:
- voice_assistant.stop
- lambda: id(va).set_use_wake_word(false);
- script.execute: reset_led
external_components:
# - source: github://pr#5230
source: github://kiklhorn/esphome
components: esp_adf
refresh: 0s
esp_adf:
# board: esp32s3box3
board: esp32s3box
psram:
mode: octal
speed: 80MHz
Marně jsem se snažil nadefinovat nový board, skončím an defaultním audio HAL ESP32 Lyra...
Mám podezření že je to chybějícím boardem v rejstříku, nevím. Děje se moc věcí co přepisují jiné, konfigurují framework atd... Trochu jsem se ztratil a nemám tušení jak na to. Dlouhá noc...
Takže jsem nakonec vzal blob ESP-ADF v2.5 (branche jsou jen 2.4 a master (2.6) který je poněkud rozbitý...) a prohodil v konfiguraci desky pin displeje s pinem I2S u původního ESP32_S3_BOX.
Vše co si přinesu domů je buď Shelly, nebo to skončí buď pod ESPhome nebo pod Zigbee2mqtt.
Ajťák co pamatuje BBS a OS/2 Warp a je mu jedno o jaký systém nebo síťařinu běží.
HA OS jako jedna z Proxmox VM na Odroid H3+/64GB
https://github.com/tteck/Proxmox