# ESP32 - [ESP32](#esp32) - [Install](#install) - [Devices](#devices) - [Lilygo tdongle](#lilygo-tdongle) - [Local Flashing](#local-flashing) - [Adding a New Device](#adding-a-new-device) - [Controlling Home Assistant](#controlling-home-assistant) - [Configuration Sections](#configuration-sections) - [esphome](#esphome) - [esp32](#esp32-1) - [logger](#logger) - [api](#api) - [wifi](#wifi) - [ota](#ota) - [captive portal](#captive-portal) - [button](#button) - [i2s audio](#i2s-audio) - [microphone](#microphone) - [speaker](#speaker) - [media player](#media-player) - [voice assistant](#voice-assistant) - [micro wake word](#micro-wake-word) - [light](#light) - [binary sensor](#binary-sensor) - [lambda](#lambda) ## Install ```bash # Check that you have python 3.11 installed uv python list --only-installed # Create the venv (python 3.11 is recommended in the docs) uv venv --python 3.11 # Install esphome uv pip install esphome wheel pip source .venv/bin/activate ``` ## Devices ### Lilygo tdongle Display: 80 X 160 ## Local Flashing Make sure your permissions are set correctly ```bash sudo usermod -a -G dialout ducoterra ``` Then "run" your config file ```bash cd active/device_esp32 uv venv uv pip install esphome source .venv/bin/activate esphome run m5stack-atom-echo.yaml ``` ## Adding a New Device 1. Create a new yaml configuration file called "my-device-device-type.yaml" ## Controlling Home Assistant ## Configuration Sections ### esphome ### esp32 ### logger ### api ### wifi ### ota ### captive portal ### button ### i2s audio ### microphone ### speaker ### media player Sometimes you'll need to convert media files to supported encoders. ```bash ffmpeg -i input.flac output.wav ``` To play media on other devices from home assistant, put the ```yaml action: media_player.play_media target: entity_id: media_player.kitchen_google_home data: media_content_type: "audio/wav" media_content_id: "media-source://media_source/local/wake_word_triggered.wav" ``` ### voice assistant In Home Assistant's configuration.yaml, add the following to listen to audio recordings of your voice request: ```bash assist_pipeline: debug_recording_dir: /share/assist_pipeline ``` ### micro wake word ### light ### binary sensor ### lambda > id(...) is a helper function that makes ESPHome fetch an object with the > supplied ID (which you defined somewhere else, like top_end_stop ) and lets > you call any of ESPHome’s many APIs directly. For example, here we’re > retrieving the current state of the end stop using .state and using it to > construct our cover state.