Advertisement
Guest User

atom echo

a guest
Oct 8th, 2023
362
0
147 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.78 KB | Source Code | 0 0
  1. esphome:
  2.   name: voiceassistant
  3.   name_add_mac_suffix: true
  4.   project:
  5.     name: m5stack.atom-echo-voice-assistant
  6.     version: "1.0"
  7.   min_version: 2023.5.0
  8.  
  9. esp32:
  10.   board: m5stack-atom
  11.   framework:
  12.     type: esp-idf
  13.  
  14. dashboard_import:
  15.   package_import_url: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main
  16.  
  17. ota:
  18.   password: !secret ota_password
  19.  
  20. wifi:
  21.   ssid: !secret wifi_ssid
  22.   password: !secret wifi_password
  23.   manual_ip:
  24.     static_ip: 10.0.2.154 # Your IP address for this device
  25.     gateway: 10.0.2.1 # Your gateway IP Address, this is normally the IP of your router
  26.     subnet: 255.255.255.0 # Your subnet, this you can find in your router
  27.  
  28. api:
  29.   encryption:
  30.     key: !secret api_encryptionkey
  31.  
  32. logger:
  33. improv_serial:
  34. i2s_audio:
  35.   i2s_lrclk_pin: GPIO33
  36.   i2s_bclk_pin: GPIO19
  37.  
  38. microphone:
  39.   - platform: i2s_audio
  40.     id: echo_microphone
  41.     i2s_din_pin: GPIO23
  42.     adc_type: external
  43.     pdm: true
  44.  
  45. speaker:
  46.   - platform: i2s_audio
  47.     id: echo_speaker
  48.     i2s_dout_pin: GPIO22
  49.     dac_type: external
  50.     mode: mono
  51.  
  52. voice_assistant:
  53.   microphone: echo_microphone
  54.   speaker: echo_speaker
  55.   on_start:
  56.     - light.turn_on:
  57.         id: led
  58.         blue: 100%
  59.         red: 0%
  60.         green: 0%
  61.         effect: none
  62.   on_tts_start:
  63.     - light.turn_on:
  64.         id: led
  65.         blue: 0%
  66.         red: 0%
  67.         green: 100%
  68.         effect: none
  69.   on_tts_end:
  70.     - light.turn_on:
  71.         id: led
  72.         blue: 0%
  73.         red: 0%
  74.         green: 100%
  75.         effect: pulse
  76.   on_end:
  77.     - delay: 1s
  78.     - wait_until:
  79.         not:
  80.           speaker.is_playing:
  81.     - light.turn_off: led
  82.   on_error:
  83.     - light.turn_on:
  84.         id: led
  85.         blue: 0%
  86.         red: 100%
  87.         green: 0%
  88.         effect: none
  89.     - delay: 1s
  90.     - light.turn_off: led
  91.  
  92.  
  93. binary_sensor:
  94.   - platform: gpio
  95.     pin:
  96.       number: GPIO39
  97.       inverted: true
  98.     name: Button
  99.     disabled_by_default: true
  100.     entity_category: diagnostic
  101.     id: echo_button
  102.     on_multi_click:
  103.       - timing:
  104.          - ON FOR AT LEAST 350ms
  105.         then:
  106.           - voice_assistant.start:
  107.       - timing:
  108.          - ON FOR AT LEAST 350ms
  109.           - OFF FOR AT LEAST 10ms
  110.         then:
  111.           - light.turn_on:
  112.               id: led
  113.               blue: 100%
  114.               red: 0%
  115.               green: 0%
  116.               effect: pulse
  117.           - voice_assistant.stop:
  118. light:
  119.   - platform: esp32_rmt_led_strip
  120.     id: led
  121.     name: None
  122.     disabled_by_default: true
  123.     entity_category: config
  124.     pin: GPIO27
  125.     default_transition_length: 0s
  126.     chipset: SK6812
  127.     num_leds: 1
  128.     rgb_order: grb
  129.     rmt_channel: 0
  130.     effects:
  131.       - pulse:
  132.           transition_length: 250ms
  133.           update_interval: 250ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement