Recently I have attended the workshop Eindhoven IoT: WORKSHOPS Indoor Air Sensor and/or Node Red on RaspberryPi. All info was documented on the site: galagaking.org/ but not all instructions were working on my laptop. So here is my version of, just for my own reference how I did it. Ofcourse a lot of credits to Frank Beks and Lorna Goulden.

ESPHome runs on a variety of ESP8266 and ESP32 boards. I will try to get it working on all my current boards and see how to configure it correctly.

Installation of ESPHome


First, you need to install Python on your laptop. You can skip this step when you already have 3.5.4+ running. I am not sure however which is the minimum version of Python.
During Python installation, please enable “Add Python 3.x to PATH”. ESPHome 1.10.0 supports Python 2.x for probably 2 more releases, so I would suggest upgrading to Python 3.8 now. (I used the Windows x86-64 executable installer).

You can find out which version you are running with:
python –version

C:\WINDOWS\system32>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> quit()

C:\WINDOWS\system32>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> ^Z

C:\WINDOWS\system32>python
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> pip install esphome
File ““, line 1
pip install esphome
^
SyntaxError: invalid syntax
>>> exit()

C:\WINDOWS\system32>pip3 install esphome
Collecting esphome
Downloading https://files.pythonhosted.org/packages/09/c3/f045334521680d75d3571b2cbeff2f8c5c7316bc431b939ef61c1eeedce3/esphome-1.14.2-py2.py3-none-any.whl (1.4MB)
100% |################################| 1.4MB 268kB/s
Collecting ifaddr==0.1.6 (from esphome)
Downloading https://files.pythonhosted.org/packages/9f/54/d92bda685093ebc70e2057abfa83ef1b3fb0ae2b6357262a3e19dfe96bb8/ifaddr-0.1.6.tar.gz
Collecting pyserial==3.4 (from esphome)
Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl (193kB)
100% |################################| 196kB 1.2MB/s
Collecting colorlog==4.0.2 (from esphome)
Downloading https://files.pythonhosted.org/packages/68/4d/892728b0c14547224f0ac40884e722a3d00cb54e7a146aea0b3186806c9e/colorlog-4.0.2-py2.py3-none-any.whl
Collecting voluptuous==0.11.7 (from esphome)
Downloading https://files.pythonhosted.org/packages/24/3b/fe531688c0d9e057fccc0bc9430c0a3d4b90e0d2f015326e659c2944e328/voluptuous-0.11.7.tar.gz (45kB)
100% |################################| 49kB 2.9MB/s
Collecting PyYAML==5.1.2 (from esphome)
Downloading https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz (265kB)
100% |################################| 266kB 821kB/s
Collecting tornado==5.1.1 (from esphome)
Downloading https://files.pythonhosted.org/packages/e6/78/6e7b5af12c12bdf38ca9bfe863fcaf53dc10430a312d0324e76c1e5ca426/tornado-5.1.1.tar.gz (516kB)
100% |################################| 520kB 578kB/s
Collecting platformio==4.0.3 (from esphome)
Downloading https://files.pythonhosted.org/packages/5d/59/2ba54e3f2ae8435997acbd0d0ff31993a7041a8b11515e0b5cc846a71ca4/platformio-4.0.3.tar.gz (140kB)
100% |################################| 143kB 1.1MB/s
Collecting esptool==2.7 (from esphome)
Downloading https://files.pythonhosted.org/packages/6c/bf/578443af2270ebeff78fdfd30cef3a02433cc63b34a912936653a48526dd/esptool-2.7.tar.gz (83kB)
100% |################################| 86kB 1.6MB/s
Collecting tzlocal==2.0.0 (from esphome)
Downloading https://files.pythonhosted.org/packages/ef/99/53bd1ac9349262f59c1c421d8fcc2559ae8a5eeffed9202684756b648d33/tzlocal-2.0.0-py2.py3-none-any.whl
Collecting protobuf==3.10.0 (from esphome)
Downloading https://files.pythonhosted.org/packages/ad/c2/86c65136e280607ddb2e5dda19e2953c1174f9919b557d1d154574481de4/protobuf-3.10.0-py2.py3-none-any.whl (434kB)
100% |################################| 438kB 622kB/s
Collecting paho-mqtt==1.4.0 (from esphome)
Downloading https://files.pythonhosted.org/packages/25/63/db25e62979c2a716a74950c9ed658dce431b5cb01fde29eb6cba9489a904/paho-mqtt-1.4.0.tar.gz (88kB)
100% |################################| 90kB 1.9MB/s
Collecting pytz==2019.3 (from esphome)
Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB)
100% |################################| 512kB 662kB/s
Collecting colorama (from colorlog==4.0.2->esphome)
Downloading https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl
Collecting bottle<0.13 (from platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/69/d1/efdd0a5584169cdf791d726264089ce5d96846a8978c44ac6e13ae234327/bottle-0.12.17-py3-none-any.whl (89kB)
100% |################################| 90kB 2.0MB/s
Collecting click<8,>=5 (from platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
100% |################################| 81kB 2.4MB/s
Collecting requests<3,>=2.4.0 (from platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
100% |################################| 61kB 2.9MB/s
Collecting semantic-version<3,>=2.8.1 (from platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/0f/3b/8fee26649a86c71df159ed0ae7ac5f9ac38829bccd8a7404e116f903929b/semantic_version-2.8.2-py2.py3-none-any.whl
Collecting tabulate<1,>=0.8.3 (from platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/66/d4/977fdd5186b7cdbb7c43a7aac7c5e4e0337a84cb802e154616f3cfc84563/tabulate-0.8.5.tar.gz (45kB)
100% |################################| 49kB 2.9MB/s
Collecting pyaes (from esptool==2.7->esphome)
Downloading https://files.pythonhosted.org/packages/44/66/2c17bae31c906613795711fc78045c285048168919ace2220daa372c7d72/pyaes-1.6.1.tar.gz
Collecting ecdsa (from esptool==2.7->esphome)
Downloading https://files.pythonhosted.org/packages/a6/81/2b170b460c84fdc8700cf08aa077ac6a9ff41f4ad3f05d0b3a64ba9f8f2e/ecdsa-0.13.3-py2.py3-none-any.whl (52kB)
100% |################################| 53kB 3.4MB/s
Collecting six>=1.9 (from protobuf==3.10.0->esphome)
Downloading https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl
Requirement already satisfied (use –upgrade to upgrade): setuptools in c:\users\nlmvni\appdata\local\programs\python\python35\lib\site-packages (from protobuf==3.10.0->esphome)
Collecting chardet<3.1.0,>=3.0.2 (from requests<3,>=2.4.0->platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |################################| 135kB 1.2MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests<3,>=2.4.0->platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl (125kB)
100% |################################| 126kB 2.2MB/s
Collecting certifi>=2017.4.17 (from requests<3,>=2.4.0->platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl (154kB)
100% |################################| 155kB 1.5MB/s
Collecting idna<2.9,>=2.5 (from requests<3,>=2.4.0->platformio==4.0.3->esphome)
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
100% |################################| 61kB 1.9MB/s
Installing collected packages: ifaddr, pyserial, colorama, colorlog, voluptuous, PyYAML, tornado, bottle, click, chardet, urllib3, certifi, idna, requests, semantic-version, tabulate, platformio, pyaes, ecdsa, esptool, pytz, tzlocal, six, protobuf, paho-mqtt, esphome
Running setup.py install for ifaddr
Running setup.py install for voluptuous
Running setup.py install for PyYAML
Running setup.py install for tornado
Running setup.py install for tabulate
Running setup.py install for platformio
Running setup.py install for pyaes
Running setup.py install for esptool
Running setup.py install for paho-mqtt
Successfully installed PyYAML-5.1.2 bottle-0.12.17 certifi-2019.9.11 chardet-3.0.4 click-7.0 colorama-0.4.1 colorlog-4.0.2 ecdsa-0.13.3 esphome-1.14.2 esptool-2.7 idna-2.8 ifaddr-0.1.6 paho-mqtt-1.4.0 platformio-4.0.3 protobuf-3.10.0 pyaes-1.6.1 pyserial-3.4 pytz-2019.3 requests-2.22.0 semantic-version-2.8.2 six-1.13.0 tabulate-0.8.5 tornado-5.1.1 tzlocal-2.0.0 urllib3-1.25.6 voluptuous-0.11.7
You are using pip version 7.1.2, however version 19.3.1 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.

Create a folder for your project

CD
md esphome
cd esphome
esphome myfirst.yaml wizard

C:\_Workshop\esphome>esphome myfirst.yaml wizard
Hi there!
I’m the wizard of ESPHome 🙂
And I’m here to help you get started with ESPHome.
In 4 steps I’m going to guide you through creating a basic configuration file for your custom ESP8266/ESP32 firmware. Yay!

============= STEP 1 =============
_____ ____ _____ ______
/ ____/ __ \| __ \| ____|
| | | | | | |__) | |__
| | | | | | _ /| __|
| |___| |__| | | \ \| |____
\_____\____/|_| \_\______|

===================================
First up, please choose a name for your node.
It should be a unique name that can be used to identify the device later.
For example, I like calling the node in my living room livingroom.

(name): myfirstnode
Great! Your node is now called “myfirstnode”.

============= STEP 2 =============
______ _____ _____
| ____|/ ____| __ \\
| |__ | (___ | |__) |
| __| \___ \| ___/
| |____ ____) | |
|______|_____/|_|

===================================
Now I’d like to know what microcontroller you’re using so that I can compile firmwares for it.
Are you using an ESP32 or ESP8266 platform? (Choose ESP8266 for Sonoff devices)

Please enter either ESP32 or ESP8266.
(ESP32/ESP8266): esp8266
Thanks! You’ve chosen ESP8266 as your platform.

Next, I need to know what board you’re using.
Please go to http://docs.platformio.org/en/latest/platforms/espressif8266.html#boards and choose a board.

For example “nodemcuv2”.
Options: espino, wio_link, inventone, wio_node, oak, nodemcuv2, d1, esp12e, huzzah, phoenix_v2, nodemcu, esp01, d1_mini_lite, d1_mini, esp210, phoenix_v1, modwifi, wifinfo, espresso_lite_v2, esp07, esp8285, d1_mini_pro, wifi_slot, xinabox_cw01, espresso_lite_v1, espduino, heltec_wifi_kit_8, espectro, esp_wroom_02, esp01_1m, wifiduino, thing, thingdev, espinotee, sparkfunBlynk, gen4iod
(board): nodemcuv2
Way to go! You’ve chosen nodemcuv2 as your board.

============= STEP 3 =============
__ ___ ______ _
\ \ / (_) ____(_)
\ \ /\ / / _| |__ _
\ \/ \/ / | | __| | |
\ /\ / | | | | |
\/ \/ |_|_| |_|

===================================
In this step, I’m going to create the configuration for WiFi.

First, what’s the SSID (the name) of the WiFi network myfirstnode I should connect to?
For example “Abraham Linksys”.
(ssid): SSID
Thank you very much! You’ve just chosen “SSID” as your SSID.

Now please state the password of the WiFi network so that I can connect to it (Leave empty for no password)

For example “PASSWORD42”
(PSK): password123456
Perfect! WiFi is now set up (you can create static IPs and so on later).

============= STEP 4 =============
____ _______
/ __ \__ __|/\\
| | | | | | / \\
| | | | | | / /\ \\
| |__| | | |/ ____ \\
\____/ |_/_/ \_\\

===================================
Almost there! ESPHome can automatically upload custom firmwares over WiFi (over the air) and integrates into Home Assistant with a native API.
This can be insecure if you do not trust the WiFi network. Do you want to set a password for connecting to this ESP?

Press ENTER for no password
(password): password123

DONE! I’ve now written a new configuration file to myfirst.yaml

Next steps:
> Check your Home Assistant “integrations” screen. If all goes well, you should see your ESP being discovered automatically.
> Then follow the rest of the getting started guide:
> https://esphome.io/guides/getting_started_command_line.html

Lorem Ipsum

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.