mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-02-28 03:41:57 +01:00
Merge branch 'current' into next
This commit is contained in:
commit
7e0d1f85c3
2
.github/workflows/component-image.yml
vendored
2
.github/workflows/component-image.yml
vendored
@ -50,7 +50,7 @@ jobs:
|
||||
component: ${{ needs.prepare.outputs.name }}
|
||||
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4.5.0
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
id: upload-artifact
|
||||
with:
|
||||
name: ${{ needs.prepare.outputs.name }}
|
||||
|
@ -62,7 +62,7 @@ Configuration variables:
|
||||
:ref:`Binary Sensor <config-binary_sensor>` that turns on when the closed position is reached.
|
||||
|
||||
- **stop_action** (**Required**, :ref:`Action <config-action>`): The action that should
|
||||
be performed when the remote requests the cover to be closed or an endstop is reached.
|
||||
be performed when the remote requests the cover to stop or an endstop is reached.
|
||||
- **max_duration** (*Optional*, :ref:`config-time`): The maximum duration the cover should be opening
|
||||
or closing. Useful for protecting from dysfunctional endstops.
|
||||
- All other options from :ref:`Cover <config-cover>`.
|
||||
|
@ -426,6 +426,98 @@ Below is a config example:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 5
|
||||
|
||||
|
||||
Inkplate 10
|
||||
***********
|
||||
|
||||
The Inkplate 10 has a configuration similar to 5 and 6, except it has 2 expanders and the battery read MOSFET is not inverted. Also, some versions have an embedded RTC to aid in clock sync.
|
||||
Below is a config example:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
time:
|
||||
- platform: pcf85063
|
||||
id: esptime
|
||||
# repeated synchronization is not necessary unless the external RTC
|
||||
# is much more accurate than the internal clock
|
||||
update_interval: never
|
||||
- platform: homeassistant
|
||||
# instead try to synchronize via network repeatedly ...
|
||||
on_time_sync:
|
||||
then:
|
||||
# ... and update the RTC when the synchronization was successful
|
||||
pcf85063.write_time:
|
||||
|
||||
pca6416a:
|
||||
- id: pca6416a_hub
|
||||
address: 0x20
|
||||
# Primary expander for display control and additional I/O
|
||||
- id: pca6416a_hub2
|
||||
address: 0x21
|
||||
# Secondary expander for additional I/O
|
||||
|
||||
switch:
|
||||
- platform: gpio
|
||||
id: battery_read_mosfet
|
||||
pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 9
|
||||
|
||||
sensor:
|
||||
- platform: adc
|
||||
id: battery_voltage
|
||||
update_interval: never
|
||||
attenuation: 12db
|
||||
pin: 35
|
||||
- platform: template
|
||||
name: "Inkplate Battery Voltage"
|
||||
unit_of_measurement: "V"
|
||||
accuracy_decimals: 3
|
||||
lambda: |-
|
||||
// Enable MOSFET to connect battery voltage divider
|
||||
id(battery_read_mosfet).turn_on();
|
||||
// Wait for voltage to stabilize
|
||||
delay(5);
|
||||
// Sample ADC value
|
||||
float adc = id(battery_voltage).sample();
|
||||
// Disable MOSFET to save power
|
||||
id(battery_read_mosfet).turn_off();
|
||||
return adc;
|
||||
filters:
|
||||
- multiply: 2 # Compensate for voltage divider (1:2 ratio)
|
||||
|
||||
display:
|
||||
- platform: inkplate6
|
||||
id: inkplate_display
|
||||
greyscale: true
|
||||
partial_updating: false
|
||||
update_interval: never
|
||||
model: inkplate_10
|
||||
|
||||
ckv_pin: 32
|
||||
sph_pin: 33
|
||||
gmod_pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 1
|
||||
gpio0_enable_pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 8
|
||||
oe_pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 0
|
||||
spv_pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 2
|
||||
powerup_pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 4
|
||||
wakeup_pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 3
|
||||
vcom_pin:
|
||||
pca6416a: pca6416a_hub
|
||||
number: 5
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
|
@ -100,10 +100,9 @@ is already set up. You can however change this using the ``priority`` parameter.
|
||||
esphome:
|
||||
# ...
|
||||
on_boot:
|
||||
priority: 600
|
||||
# ...
|
||||
then:
|
||||
- switch.turn_off: switch_1
|
||||
- priority: 600
|
||||
then:
|
||||
- switch.turn_off: switch_1
|
||||
|
||||
Configuration variables:
|
||||
|
||||
@ -138,9 +137,9 @@ too many WiFi/MQTT connection attempts, Over-The-Air updates being applied or th
|
||||
esphome:
|
||||
# ...
|
||||
on_shutdown:
|
||||
priority: 700
|
||||
then:
|
||||
- switch.turn_off: switch_1
|
||||
- priority: 700
|
||||
then:
|
||||
- switch.turn_off: switch_1
|
||||
|
||||
Configuration variables:
|
||||
|
||||
|
@ -52,12 +52,13 @@ Next, create a ``font:`` section in your configuration:
|
||||
size: 28
|
||||
bpp: 4
|
||||
glyphs: [
|
||||
a,A,á,Á,e,E,é,É,
|
||||
0123456789aAáÁeEéÉ,
|
||||
(,),+,-,_,.,°,•,µ,
|
||||
"\u0020", #space
|
||||
"\u0021", #!
|
||||
"\u0022", #"
|
||||
"\u0027", #'
|
||||
"\u0020", # space
|
||||
"\u002C", # ,
|
||||
"\u0021", # !
|
||||
"\u0022", # "
|
||||
"\u0027", # '
|
||||
]
|
||||
|
||||
- file: "fonts/RobotoCondensed-Regular.ttf"
|
||||
|
@ -291,16 +291,19 @@ whose ``id`` is set to ``player_volume``:
|
||||
then:
|
||||
- lambda: |-
|
||||
json::parse_json(body, [](JsonObject root) -> bool {
|
||||
if (root["vol"]) {
|
||||
id(player_volume).publish_state(root["vol"]);
|
||||
} else {
|
||||
ESP_LOGD(TAG,"No 'vol' key in this json!");
|
||||
}
|
||||
if (root["vol"]) {
|
||||
id(player_volume).publish_state(root["vol"]);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
ESP_LOGI(TAG,"No 'vol' key in this json!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
else:
|
||||
- logger.log:
|
||||
format: "Error: Response status: %d, message %s"
|
||||
args: [response->status_code, body.c_str()];
|
||||
args: [ 'response->status_code', 'body.c_str()' ]
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
@ -44,7 +44,7 @@ Configuration variables:
|
||||
|
||||
.. note::
|
||||
|
||||
If the device can support multiple I²C buses (ESP32 has 2, ESP8266 does not support more than one) these buses need to be defined as below and sensors need to be setup specifying the correct bus:
|
||||
If the device can support multiple I²C buses these buses need to be defined as below and sensors need to be setup specifying the correct bus:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
@ -46,6 +46,7 @@ Configuration variables
|
||||
- **max_refresh_rate** (*Optional*, :ref:`config-time`): A time interval used to limit the number of commands a light
|
||||
can handle per second. For example, ``16ms`` will limit the light to a refresh rate of about 60Hz. Defaults to
|
||||
sending commands as quickly as changes are made to the lights.
|
||||
- **use_psram** (*Optional*, boolean): Set to ``false`` to force internal RAM allocation even if you have the the PSRAM component enabled. This can be useful if you're experiencing issues like flickering with your leds strip. Defaults to ``true``.
|
||||
|
||||
IDF configuration variables:
|
||||
****************************
|
||||
|
@ -518,7 +518,7 @@ Remote code selection (exactly one of these has to be included):
|
||||
|
||||
.. note::
|
||||
|
||||
For the Sonoff RF Bridge, you can bypass the EFM8BB1 microcontroller handling RF signals with
|
||||
For the black Sonoff RF Bridge, you can bypass the EFM8BB1 microcontroller handling RF signals with
|
||||
`this hack <https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack>`__
|
||||
created by the GitHub user wildwiz. Then use this configuration for the remote receiver/transmitter hubs:
|
||||
|
||||
@ -532,7 +532,25 @@ Remote code selection (exactly one of these has to be included):
|
||||
pin: 5
|
||||
carrier_duty_percent: 100%
|
||||
|
||||
There's also a software `"hack" <https://github.com/mightymos/RF-Bridge-OB38S003>`__ that allows the radio chip to mirror all the voltages to the ESP to do the decoding,
|
||||
rendering the hardware hack uncessary. This software passthrough mode can be used for the OB38S003 (white) and EFM8BB1 (black) sonoff RF bridge. Then use this configuration for the remote receiver/transmitter hubs:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
remote_receiver:
|
||||
pin:
|
||||
# sonoff and wemos board
|
||||
number: GPIO3
|
||||
mode:
|
||||
input: true
|
||||
pullup: false
|
||||
tolerance: 60%
|
||||
filter: 4us
|
||||
idle: 4ms
|
||||
|
||||
remote_transmitter:
|
||||
pin: 1
|
||||
carrier_duty_percent: 100%
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
@ -7,7 +7,7 @@ AS7341 Spectral Color Sensor
|
||||
:keywords: AS7341
|
||||
|
||||
The ``as7341`` sensor platform allows you to use your AS7341 spectral color sensor
|
||||
(`datasheet <https://ams.com/documents/20143/36005/AS7341_DS000504_3-00.pdf/5eca1f59-46e2-6fc5-daf5-d71ad90c9b2b>`__,
|
||||
(`datasheet <https://look.ams-osram.com/m/24266a3e584de4db/original/AS7341-DS000504.pdf>`__,
|
||||
`Adafruit`_) with ESPHome. The :ref:`I²C Bus <i2c>` is required to be set up in
|
||||
your configuration for this sensor to work.
|
||||
|
||||
|
@ -34,7 +34,7 @@ an ``i2c:`` section in your config for this integration to work.
|
||||
|
||||
sensor:
|
||||
- platform: grove_gas_mc_v2
|
||||
no2:
|
||||
nitrogen_dioxide:
|
||||
name: "Nitrogen Dioxide"
|
||||
ethanol:
|
||||
name: "Ethanol"
|
||||
@ -46,7 +46,7 @@ an ``i2c:`` section in your config for this integration to work.
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **no2** (**Required**): The Nitrogen Dioxide sensor data.
|
||||
- **nitrogen_dioxide** (**Required**): The Nitrogen Dioxide sensor data.
|
||||
All options from :ref:`Sensor <config-sensor>`.
|
||||
- **ethanol** (**Required**): The Ethanol (C2H5OH) sensor data.
|
||||
All options from :ref:`Sensor <config-sensor>`.
|
||||
|
@ -211,21 +211,24 @@ want new features, please either create a new issue on the `GitHub issue
|
||||
tracker <https://github.com/esphome/issues/issues>`__ or find us on the
|
||||
`Discord chat <https://discord.gg/KhAMKrd>`__ (also make sure to read the :doc:`FAQ <faq>`).
|
||||
|
||||
Bonus: ESPHome dashboard
|
||||
------------------------
|
||||
.. _esphome-device-builder-docker:
|
||||
|
||||
ESPHome features a dashboard that you can use to easily manage your nodes
|
||||
from a nice web interface. It was primarily designed for
|
||||
:doc:`the Home Assistant add-on <getting_started_hassio>`, but also works with a simple command.
|
||||
Bonus: ESPHome Device Builder
|
||||
-----------------------------
|
||||
|
||||
To start the ESPHome dashboard, simply start ESPHome with the following command
|
||||
(with ``config/`` pointing to a directory where you want to store your configurations)
|
||||
The ESPHome Device Builder allows you to easily manage your nodes from a nice web interface. It was primarily designed
|
||||
as a :doc:`Home Assistant add-on <getting_started_hassio>`, but can run in docker independently from Home Assistant.
|
||||
|
||||
To start the ESPHome Device Builder, simply start ESPHome with the following command (with ``config/`` pointing to a
|
||||
directory where you want to store your configurations):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Install dashboard dependencies
|
||||
pip install tornado esptool \
|
||||
esphome dashboard config
|
||||
pip install tornado esptool
|
||||
|
||||
# Start the dashboard
|
||||
esphome dashboard config
|
||||
|
||||
# On Docker, host networking mode is required for online status indicators
|
||||
docker run --rm --net=host -v "${PWD}":/config -it ghcr.io/esphome/esphome
|
||||
@ -235,7 +238,7 @@ To start the ESPHome dashboard, simply start ESPHome with the following command
|
||||
docker run --rm -p 6052:6052 -e ESPHOME_DASHBOARD_USE_PING=true -v "${PWD}":/config -it ghcr.io/esphome/esphome
|
||||
|
||||
|
||||
After that, you will be able to access the dashboard through ``localhost:6052``.
|
||||
After that, you will be able to access the ESPHome Device Builder at ``localhost:6052``.
|
||||
|
||||
Logging level can be set with the env var `ESPHOME_LOG_LEVEL` (default is `INFO`).
|
||||
|
||||
|
@ -2,19 +2,37 @@ Getting Started with ESPHome and Home Assistant
|
||||
===============================================
|
||||
|
||||
.. seo::
|
||||
:description: Getting Started guide for installing ESPHome Device Compiler as a Home Assistant add-on and creating a basic configuration.
|
||||
:description: Getting Started guide for installing ESPHome Device Builder as a Home Assistant add-on and creating a basic configuration.
|
||||
:image: home-assistant.svg
|
||||
|
||||
In this guide we’ll go through how to install ESPHome on a device using the ESPHome Device Compiler, installed as a Home Assistant add-on.
|
||||
In this guide, we'll walk you through how to install ESPHome onto a device/microcontroller using the ESPHome Device
|
||||
Builder, installed as a Home Assistant add-on.
|
||||
|
||||
First, here's a very quick introduction to how ESPHome works. ESPHome allows you to write configurations and turn your microcontrollers
|
||||
into smart home devices. It reads a YAML configuration file, creates custom firmware, and can install it directly on your device. Any devices
|
||||
or sensors defined in the ESPHome configuration will automatically appear in Home Assistant's user interface.
|
||||
This is generally the easiest way to get started with ESPHome.
|
||||
|
||||
Installing ESPHome Device Compiler
|
||||
----------------------------------
|
||||
Introduction to ESPHome
|
||||
-----------------------
|
||||
|
||||
To install the ESPHome Device Compiler in Home Assistant, click the following button to open the ESPHome add-on page and hit the INSTALL button:
|
||||
ESPHome allows you to create "configurations" which allow you to turn common microcontrollers into smart home devices.
|
||||
|
||||
A device "configuration" consists of one or more `YAML files <https://en.wikipedia.org/wiki/YAML>`__ and, based on the
|
||||
content of the file(s), ESPHome creates custom firmware which you can then install directly onto your device. Hardware
|
||||
defined in the configuration--such as sensors, switches, lights, and so on--will automatically appear in Home
|
||||
Assistant's user interface.
|
||||
|
||||
Note that there are two "parts" to ESPHome:
|
||||
|
||||
- The part which runs on the device/microcontroller, and...
|
||||
- The part which runs on your computer system, whether that's a single-board computer (SBC) such as a Raspberry Pi or
|
||||
a laptop/desktop-class system.
|
||||
|
||||
The ESPHome Device Builder provides a simple web user interface (UI) which allows you to create, edit and install your
|
||||
device configurations onto your devices.
|
||||
|
||||
Installing ESPHome Device Builder
|
||||
---------------------------------
|
||||
|
||||
To install the ESPHome Device Builder in Home Assistant, click the following button:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
@ -22,80 +40,87 @@ To install the ESPHome Device Compiler in Home Assistant, click the following bu
|
||||
<img src="https://my.home-assistant.io/badges/supervisor_addon.svg" alt="Open your Home Assistant instance and show the user interface of the ESPHome add-on." />
|
||||
</a>
|
||||
|
||||
If you run a Home Assistant installation that does not have access to add-ons, take a look at the other installation methods here.
|
||||
This should open the ESPHome add-on page; once you're there, just click the INSTALL button:
|
||||
|
||||
It can take a bit until the add-on is installed. Once done, click "Start" and then click "Open Web UI".
|
||||
|
||||
.. figure:: images/hassio_addon.png
|
||||
.. figure:: images/addon.png
|
||||
:align: center
|
||||
:width: 75.0%
|
||||
|
||||
You should now be greeted by a nice introduction wizard which will step you through
|
||||
creating your first configuration.
|
||||
Installation of the add-on may take a moment or two. Once done, click "Start" and then click "Open Web UI".
|
||||
|
||||
.. note::
|
||||
|
||||
If you're running Home Assistant in a way that does not provide access to add-ons, you may
|
||||
:ref:`run the ESPHome Device Builder independently in Docker<esphome-device-builder-docker>`.
|
||||
|
||||
The web UI will present a wizard which will walk you through creating your first configuration:
|
||||
|
||||
.. figure:: images/dashboard_empty.png
|
||||
:align: center
|
||||
:width: 95.0%
|
||||
|
||||
The wizard will guide you through creating your first configuration and, depending on your browser, install it on your ESP device. You will need to name your configuration and enter your wireless network settings so that the ESP device can come online and can communicate with Home Assistant.
|
||||
After creating your first configuration, you'll need to install it on your device.
|
||||
|
||||
.. note::
|
||||
|
||||
The most difficult part of setting up a new ESPHome device is the initial installation. Installation requires that your ESP device is connected with a cable to a computer. Later updates can be installed wirelessly.
|
||||
The initial installation of ESPHome onto a new device is often the most difficult and/or intimidating part -- at
|
||||
least until you've done it a few times.
|
||||
|
||||
For guidance on making this first connection, see :doc:`physical_device_connection`
|
||||
If you haven't done this before, please see :doc:`physical_device_connection`.
|
||||
|
||||
If you didn't do so when prompted upon creating your first device, you'll need to enter your Wi-Fi network credentials
|
||||
immediately following installation so that your device can connect to your Wi-Fi network and subsequently communicate
|
||||
with Home Assistant.
|
||||
|
||||
ESPHome Interface
|
||||
-------------------
|
||||
.. _esphome-interface:
|
||||
|
||||
Assuming you created your first configuration file with the wizard, let's take a quick
|
||||
tour of the ESPHome Device Compiler interface.
|
||||
Device Builder Interface
|
||||
------------------------
|
||||
|
||||
Let's take a quick tour of the ESPHome Device Builder interface.
|
||||
|
||||
.. figure:: images/dashboard_states.png
|
||||
:align: center
|
||||
:width: 95.0%
|
||||
|
||||
On the front page you will see all configurations for nodes you created. For each file,
|
||||
there are a few basic actions you can perform:
|
||||
|
||||
- **UPDATE**: This button will show up if the device has not been installed with the same ESPHome version currently running.
|
||||
The main page displays a list of all configuration files for nodes you've created. For each file, there are a few
|
||||
actions you can perform:
|
||||
|
||||
- **UPDATE**: This button appears when the device is running an ESPHome version which is older than that available in
|
||||
the ESPHome Device Builder add-on.
|
||||
- **EDIT**: This will open the configuration editor.
|
||||
|
||||
- **LOGS**: With this command you can view all the logs the node is outputting. If a USB device is
|
||||
connected, you can choose to use the serial connection. Otherwise it will use the built-in OTA logs.
|
||||
|
||||
- **Overflow menu**: This is a dropdown menu which allows you to perform more actions.
|
||||
- **LOGS**: This allows you to view logs emitted by the device. If a device is connected via USB, you can choose to use
|
||||
the USB/serial connection; otherwise, it will attempt to connect to the device and (once connected) display the logs
|
||||
via the Wi-Fi connection.
|
||||
- **Overflow menu**: This is a dropdown menu which allows you to perform some additional actions. Of note are:
|
||||
|
||||
- **Validate**: This will validate the configuration file.
|
||||
- **Install**: Opens the Install dialog.
|
||||
- **Clean Build Files**: This will delete all of the generated build files and is a safe operation to perform. Sometimes old files are not removed and can cause compile issues later on.
|
||||
- **Clean Build Files**: This will delete all of the generated build files; it can help to resolve compile issues
|
||||
should they occur. *This is safe to perform at any time and you should try this before reporting bugs or other
|
||||
issues.*
|
||||
- **Delete**: This will delete the configuration file.
|
||||
|
||||
The configuration files for ESPHome can be found and edited under ``<HOME_ASSISTANT_CONFIG>/esphome/``.
|
||||
For example the configuration for the ``garage-door`` node in the picture above can be found
|
||||
in ``/config/esphome/garage-door.yaml``.
|
||||
The configuration files for ESPHome are stored in the ``<HOME_ASSISTANT_CONFIG>/esphome/`` directory. For example, the
|
||||
configuration for the "Bedroom Light" node in the picture above can be found in ``/config/esphome/bedroom-light.yaml``.
|
||||
|
||||
.. note::
|
||||
|
||||
Since Home Assistant add-ons run as individual containers, accessing these through
|
||||
command line is not very straightforward, but it's possible. To do that,
|
||||
install Home Assistant's SSH addon, configure a username and a password,
|
||||
and disable `Protection Mode` (please assess the risks you take with that).
|
||||
Then, for example to access the logs from a device through an SSH client,
|
||||
log in, and you can use a command like
|
||||
`docker exec -it addon_15ef4d2f_esphome esphome logs /config/esphome/garage-door.yaml`.
|
||||
See :doc:`getting_started_command_line` for more.
|
||||
Home Assistant add-ons run as individual containers; this can make accessing your configuration files/logs a bit
|
||||
challenging. If you wish to do so, you'll need to install Home Assistant's
|
||||
`SSH add-on <https://www.home-assistant.io/common-tasks/os/#installing-and-using-the-ssh-add-on>`__, configure it
|
||||
with a username and password and also disable "Protection Mode" (please assess the risks associated with doing so).
|
||||
|
||||
Now go ahead and use one of the :ref:`devices guides <devices>` to extend your configuration.
|
||||
Finally, to access the logs from a device through an SSH client, you can log in and use a command like
|
||||
``docker exec -it addon_15ef4d2f_esphome esphome logs /config/esphome/bedroom-light.yaml``.
|
||||
|
||||
Adding some (basic) features
|
||||
----------------------------
|
||||
See :doc:`getting_started_command_line` for more detail.
|
||||
|
||||
So now you should have a file called ``/config/esphome/livingroom.yaml`` (or similar).
|
||||
Go open that file (in any text editor) and add a :doc:`simple GPIO switch </components/switch/gpio>`
|
||||
to the configuration like this:
|
||||
Adding Features
|
||||
---------------
|
||||
|
||||
After stepping through the wizard, you should have a device configuration (YAML) file. In the ESPHome Device Builder,
|
||||
click on "EDIT" to open that file and add a :doc:`GPIO switch</components/switch/gpio>` to the configuration like this:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@ -104,35 +129,21 @@ to the configuration like this:
|
||||
name: "Living Room Dehumidifier"
|
||||
pin: GPIO5
|
||||
|
||||
In above example, we're simply adding a switch that's called "Living Room Dehumidifier" (could control
|
||||
anything really, for example lights) and is connected to the pin ``GPIO5``.
|
||||
|
||||
.. _connecting-your-device-to-home-assistant:
|
||||
|
||||
Connecting your device to Home Assistant
|
||||
----------------------------------------
|
||||
|
||||
Once your configuration is installed on your ESP device and is online, it will be automatically discovered by Home Assistant and offered to set up on your integrations screen:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<a href="https://my.home-assistant.io/redirect/config_flow_start/?domain=esphome" target="_blank"><img src="https://my.home-assistant.io/badges/config_flow_start.svg" alt="Open your Home Assistant instance and start setting up a new integration." /></a>
|
||||
|
||||
Alternatively, you can manually add the device on the Home Assistant Integrations page. Click on the "Add Integration" button (bottom right), search for esphome, and enter the host name, eg: "<NODE_NAME>.local" as the host. Use the same process to add multiple esphome devices.
|
||||
In Home Assistant, the example code above will look like this:
|
||||
|
||||
.. figure:: /components/switch/images/gpio-ui.png
|
||||
:align: center
|
||||
:width: 75.0%
|
||||
|
||||
After the first installation, you will probably never need to use the USB
|
||||
cable again, as all features of ESPHome are enabled remotely as well.
|
||||
In the example above, we're simply adding a switch that's called "Living Room Dehumidifier" and is connected to the pin
|
||||
``GPIO5``. This switch could really control anything -- lights or a tabletop fan, for example. Its name and function is
|
||||
arbitrary and should be set as is appropriate for your particular application.
|
||||
|
||||
Adding A Binary Sensor
|
||||
----------------------
|
||||
|
||||
Next, we’re going to add a very simple binary sensor that periodically
|
||||
checks a GPIO pin to see whether it’s pulled high or low - the :doc:`GPIO Binary
|
||||
Sensor </components/binary_sensor/gpio>`.
|
||||
Next, let's add a :doc:`binary sensor which will monitor a GPIO pin </components/binary_sensor/gpio>` to determine and
|
||||
report its state.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@ -140,32 +151,63 @@ Sensor </components/binary_sensor/gpio>`.
|
||||
- platform: gpio
|
||||
name: "Living Room Window"
|
||||
pin:
|
||||
number: 16
|
||||
number: GPIO0
|
||||
inverted: true
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
|
||||
This time when installing, you don’t need to have the device plugged in
|
||||
through USB again. The upload will happen wirelessly (:doc:`"over the air" </components/ota/index>`).
|
||||
In Home Assistant, the example code above will look like this:
|
||||
|
||||
.. figure:: /components/binary_sensor/images/gpio-ui.png
|
||||
:align: center
|
||||
:width: 75.0%
|
||||
|
||||
After adding this to your device's configuration file, be sure to click "SAVE" to save the changes you've made to your
|
||||
configuration...and read on to the next section!
|
||||
|
||||
Updating your Device
|
||||
--------------------
|
||||
|
||||
Any time you make changes to your device's configuration file, you'll need to update the associated physical device
|
||||
with your modified configuration. Put another way, just saving the configuration file alone does not update the
|
||||
ESPHome device with the changes you've made.
|
||||
|
||||
Each time you modify a device's configuration file, you need to update the device by clicking **INSTALL** to recompile
|
||||
and reinstall your updated configuration onto the device.
|
||||
|
||||
Note that you won't need to have the device connected to your system with a USB data cable again, as (once ESPHome is
|
||||
installed on your device) it can update the device :doc:`"over the air" </components/ota/index>`.
|
||||
|
||||
.. _connecting-your-device-to-home-assistant:
|
||||
|
||||
Connecting your device to Home Assistant
|
||||
----------------------------------------
|
||||
|
||||
Once your configuration is installed on your device and it's connected to your Wi-Fi, Home Assistant will automatically
|
||||
discover it (assuming your network permits this) and offer to configure it:
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<a href="https://my.home-assistant.io/redirect/config_flow_start/?domain=esphome" target="_blank"><img src="https://my.home-assistant.io/badges/config_flow_start.svg" alt="Open your Home Assistant instance and start setting up a new integration." /></a>
|
||||
|
||||
Alternatively, you can manually add the device on the Home Assistant Integrations page. To do so, click on the "Add
|
||||
Integration" button (bottom right), search for "ESPHome" and enter the ESPHome device's host name. The host name is
|
||||
based on the name you've given to the device; if you named your device "living-room-lamp", its host name will be
|
||||
``living-room-lamp.local``. You can also enter the device's IP address, if for some reason you prefer to use that.
|
||||
|
||||
You can repeat this process for each ESPHome device.
|
||||
|
||||
Where To Go Next
|
||||
----------------
|
||||
|
||||
Great 🎉! You’ve now successfully setup your first ESPHome project
|
||||
and installed your first ESPHome custom firmware to your node. You’ve
|
||||
also learned how to enable some basic components via the configuration
|
||||
file.
|
||||
Great! 🎉 You've successfully set up your first ESPHome project and installed your first ESPHome custom firmware to your
|
||||
device. You've also learned how to enable some basic components via the configuration file.
|
||||
|
||||
So now is a great time to go take a look at the :doc:`Components Index </index>`.
|
||||
Hopefully you’ll find all sensors/outputs/… you’ll need in there. If you’re having any problems or
|
||||
want new features, please either create a new issue on the `GitHub issue
|
||||
tracker <https://github.com/esphome/issues/issues>`__ or find us on the
|
||||
`Discord chat <https://discord.gg/KhAMKrd>`__ (also make sure to read the :doc:`FAQ <faq>`).
|
||||
Now is a great time to go take a look at the :doc:`Components Index </index>`. Hopefully you'll find all the hardware
|
||||
components you need there. If you're having any problems or want to request new features, please either create a new
|
||||
issue on the `GitHub issue tracker <https://github.com/esphome/issues/issues>`__ or find us on the
|
||||
`Discord chat <https://discord.gg/KhAMKrd>`__. Be sure to read the :doc:`FAQ <faq>`, as well!
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
BIN
guides/images/addon.png
Normal file
BIN
guides/images/addon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
Binary file not shown.
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 111 KiB |
Binary file not shown.
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 166 KiB |
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
19
index.rst
19
index.rst
@ -75,6 +75,11 @@ ESPHome is a system to control your microcontrollers by simple yet powerful conf
|
||||
Configuration types
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="reference" href="https://devices.esphome.io/">
|
||||
Device configuration examples
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="reference" href="/guides/creators.html">
|
||||
Sharing ESPHome devices
|
||||
@ -1202,11 +1207,21 @@ Cookbook
|
||||
Arduino Port Extender, cookbook/arduino_port_extender, arduino_logo.svg
|
||||
EHMTX a matrix status/text display, cookbook/ehmtx, ehmtx.jpg
|
||||
|
||||
.. _device_database:
|
||||
|
||||
Device Database
|
||||
---------------
|
||||
|
||||
You will find configurations for specific devices in our `ESPHome Devices <https://devices.esphome.io/>`__ database.
|
||||
|
||||
.. _contributing:
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Do you have other awesome automations or cool setups? Please feel free to add them to the
|
||||
documentation for others to copy. See :doc:`Contributing </guides/contributing>`.
|
||||
|
||||
If you'd like to share configurations for specific devices, please contribute to our `ESPHome Devices <https://devices.esphome.io/>`__ database.
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user