ESPHome - Hasatio/esphome GitHub Wiki

ESPHome can be installed in two different ways:

  • ESPHome Cli

    1. Install Python and Setup ESPHome

    Windows

    image

    • Make sure you check “Add Python to PATH”, and go all the way through the installer. Log out and back in, or restart your computer. Whichever is easiest. Open the start menu and type cmd. Press the enter key. In the terminal that comes up, check that Python is installed: Note: Do not copy the command containing ">". It shows that this is a command output from the console
    python --version
    > Python 3.10.1

    image

    • Looks good? You can go ahead and install ESPHome:
    pip3 install wheel
    pip3 install esphome
    • And you should be good to go! You can test that things are properly installed with the following:
    esphome version
    > Version: 2021.12.3

    image

    Mac
    • There are no tested installation instructions for Mac. ESPHome does support Mac & will run with no problem. Contributions are welcome!
    • The process will likely be similar to Windows. You can install Python from the official site, and then install ESPHome with pip3 install esphome. You can then test that things are properly installed with the following:
    esphome version
    > Version: 2021.12.3
    Linux
    • Your distribution probably already has Python installed. Confirm that it is at least version 3.9:
    python3 --version
    > Python 3.9.15
    • Looks good? Now create a virtual environment to contain ESPHome and it’s dependencies.
    python3 -m venv venv
    source venv/bin/activate
    • You may or may not see (venv) at the beginning of your prompt depending on your shell configuration. This indicates that you are in the virtual environment.
    • You can go ahead and install ESPHome:
    pip3 install esphome
    Caution:
    - Don’t use sudo with pip. If you do, you’ll run into trouble updating your OS down the road.
    - For details, see DontBreakDebian. pip install is equivalent to make install in this context. The advice in the article applies to all Linux 
    distributions, not just Debian.
    - Some people install ESPHome without the virtual environment, which can lead to issues with PATHs etc. Non virtual environment installations are 
    considered not “supported” as people end up having to know your exact system setup.
    
    • At this point, you should be able confirm that ESPHome has been successfully installed:
    esphome version
    > Version: 2022.11.4

    If you get an error like “Command not found”, you need to add the binary to your PATH using export PATH=$PATH:$HOME/.local/bin. To set this permanently, you can run echo 'export PATH=$PATH:$HOME/.local/bin' >> $HOME/.bashrc, then log out and back in.

    2. New Yaml/Project file

    • Open terminal by typing "cmd" on run or start
    • Run the command below and write where you want the file to be created in the "folder path" section.
    cd /d "folder path"
    • Run the code below. "test" can be replaced with the name of the file and anything optional.
    esphome wizard test.yaml

    You can give any name

    image

    Choose your esp model

    image

    Choose your board, example: esp32dev

    image

    Type the wifi name

    image

    Type the wifi password

    image

    Optional, encryption for connection is possible.

    image

    Yaml file has been created

    image

    3. Upload device

    • Open git terminal by typing "cmd" on start or run
    • Using the command below, enter the location of the yaml file to be created or used in the "folder path" section.
    cd /d "folder path"
    • It can be loaded into esp by typing the command below.
    esphome run test.yaml
    • When the compile process is completed, if the device is connected to both usb and wifi, it asks which one to use to install the program. preference is personal, desired can be chosen. The first program needs to be via the USB option. if it is not connected to usb or wifi connection, it will automatically install using the other option, it does not ask for selection.

    image

    • Install Git (Optional)

      • Download Git from the official site and install the program by clicking next, next, as if you were installing a standard program.
  • ESPHome Homeassistant

    1. Setup ESPHome (Homeassistant required)

    • Click for add-on link and click "OPEN LINK"

    image

    • Click "INSTALL" and wait for it to end

    image

    • Open all features as an option and click start

    image

    2. Add Device

    • Open Home Assistant - ESPHome and Click "NEW DEVICE"

    image

    • Click one of the 2 options

    image

    Click "OPEN ESPHOME WEB"
    • Go to link and click "CONNECT"

    image

    • Select device

    image

    • Click "PREPARE FOR FIRST USE"

    image

    • Click "INSTALL"

    image

    • Wait for end

    image

    • Click "CLOSE"

    image

    • Click "CONNECT TO WIFI"

    image

    • Select the network, type its password and click "CONNECT"

    image

    • Click "CLOSE" and go back to homeassistant-esphome

    image

    • Click "ADOPT"

    image

    • Click "ADOPT"

    image

    • Change name or stay with default name and click "INSTALL"

    image

    • Wait for it to end

    image

    • Click "STOP" and finish

    image

    Click "CONTINUE"
    • Any name and click "NEXT"

    image

    • Select device type and click "NEXT"

    image

    • Click the Encription Key, copy it and click "INSTALL"

    image

    • Click on one of the 4 options

    image

    <details>
    <summary>Click "Wirelessly" and wait for it to end</summary>
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/b8c6cd35-107d-4c45-bd95-c7fa87bbb3d7)
    </details>
    
    
    <details>
    <summary>Click "Plug into this computer"</summary>
    
    - Click "Download project" and click "Open ESPHome Web" to go to https://web.esphome.io/?dashboard_install
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/6c40361c-a7dd-46ff-9b2b-4f92475abc80)
    
    - Select device
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/1057372b-15f6-4edc-8305-98e8644f63b7)
    
    - Wait for it to end
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/da72f933-e4f4-49b2-bbca-9cab02567e31)
    
    - Click "CLOSE"
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/bc00eebe-bfe2-4cda-829b-3c4c3ae16671)
    </details>
    
    <details>
    <summary>Click "Plug into the computer running ESPHome Dashboard"</summary>
    
    - Select device
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/be206aa5-0f2a-43d0-982d-60309551e5a4)
    
    - Click "INSTALL"
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/fd3cfdae-b154-4043-82c2-6291d2213c1b)
    
    - Select the downloaded file and click "INSTALL"
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/8995d3f3-f1af-4acf-b94b-a0a22dca65aa)
    
    - Wait for it to end
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/dae5bc16-2018-4adc-9c82-979c0783d223)
    
    - Click "CLOSE"
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/45159226-6fd9-4e76-9947-1d6630f2e784)
    </details>
    
    <details>
    <summary>Click "Manual download"</summary>
    
    - Click "Open ESPHome Web" to go to https://web.esphome.io/?dashboard_install and go back and click one of the two options to download the file
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/948d6368-78c2-491e-9563-62714d88876f)
    
    - Select device
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/6e3026a3-7817-430f-867a-e9df7922eb62)
    
    - Click "INSTALL"
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/8aba3a0f-e639-43e3-92d6-1fae1fe74497)
    
    - Select the downloaded file and click "INSTALL"
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/2783969b-a404-40fa-b3e0-57d9138aa6d5)
    
    - Wait for it to end
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/fd9bbb7c-6050-4799-9356-2e35dd3798fb)
    
    - Click "CLOSE"
    
    ![image](https://github.com/Hasatio/esphome/assets/17097350/1bfedd55-0416-422c-97f7-1fe6491377ad)
    </details>
    
⚠️ **GitHub.com Fallback** ⚠️