Merge pull request #1248 from esphome/bump-1.19.0

1.19.0
This commit is contained in:
Jesse Hills 2021-06-17 06:09:33 +12:00 committed by GitHub
commit de4fbdf640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
73 changed files with 1573 additions and 207 deletions

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.18.0
PROJECT_NUMBER = 1.19.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -1,5 +1,5 @@
ESPHOME_PATH = ../esphome
ESPHOME_REF = v1.18.0
ESPHOME_REF = v1.19.0
.PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -1 +1 @@
1.18.0
1.19.0

View File

@ -2,7 +2,7 @@ Changelog
=========
.. redirect::
:url: /changelog/v1.18.0.html
:url: /changelog/v1.19.0.html
.. toctree::
:glob:

View File

@ -1,5 +1,5 @@
Changelog - Version 1.18.0 - 19th May 2021
===============================================
==========================================
.. seo::
:description: Changelog for ESPHome version 1.18.0.
@ -33,7 +33,7 @@ that and help make sure it is stable.
Apart from a few new sensors, we now have built in support for :doc:`/components/external_components`, check it out. Thanks :ghuser:`OttoWinter` and :ghuser:`glmnet`
Also now, an ESPHome device is able to connect to other BLE devices and become a :doc:`/components/ble_client`, reading sensors and controlling switches etc.
You can read basic sensor values using the :doc:`/components/sensor/ble_sensor` component or use the data displayed in the logs to build a new native component
You can read basic sensor values using the :doc:`/components/sensor/ble_client` component or use the data displayed in the logs to build a new native component
that provides the sensors/switches/etc directly.
Jesse

247
changelog/v1.19.0.rst Normal file
View File

@ -0,0 +1,247 @@
Changelog - Version 1.19.0 - 16th June 2021
===========================================
.. seo::
:description: Changelog for ESPHome version 1.19.0.
:image: /_static/changelog-1.19.0.png
:author: ESPHome
:author_twitter: @esphome_
.. imgtable::
:columns: 3
Improv, components/esp32_improv, improv.svg
SM2135, components/output/sm2135, sm2135.svg
XPT2046, components/binary_sensor/xpt2046, xpt2046.jpg
SDM Meter, components/sensor/sdm_meter, sdm220m.png
CS5460A, components/sensor/cs5460a, cs5460a.png
Wow. Ok, so this release may not look big, but there are a number of new features that are not new components.
Improv
------
:doc:`Improv Wi-Fi </components/esp32_improv>` is a new standard that stands for **Improved Provisioning of Wi-Fi
Credentials**. What it does is allow you to provision Wi-Fi credentials to the device by using Bluetooth LE.
Check out the website for more details at `improv-wifi.com <https://www.improv-wifi.com/>`__.
Home Assistant Sensor Attributes
--------------------------------
For a long time now one of the top requested features was to be able to read attributes from Home Assistant
entities into a local sensor in ESPHome. For example the brightness of a light, or the current temperature
of a climate device. :ghuser:`frenck` decided to take a stab and as long as you are running at least ESPHome
1.19.0 and Home Assistant 2021.6 then you can do this. Thanks Frenck!
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: homeassistant
id: current_temperature
entity_id: climate.living_room
attribute: current_temperature
For the Creators
----------------
There have been a few additions to the ESPHome codebase that make it easier for creators to make projects
in ESPHome and distribute them pre-installed and ready to use. See the :doc:`new page here </guides/creators>`.
The Web Experience
------------------
We have been working hard on some new tooling to make it easier for everyone to install ESPHome and other DIY
firmwares onto their ESP-based devices. To do this we have created the
`ESP Web Tools <https://esphome.github.io/esp-web-tools/>`__. Big shoutout to :ghuser:`balloob` on most of that work!
Because of these new tools, the ESPHome dashboard has gotten a slight makeover when you choose to install to a device.
You are now given the option to install directly via WebSerial to the ESP from the browser. No more plugging into the
server/VM running ESPHome and restarting container etc. It just works. (Provided you are using Chrome or Edge).
Full list of changes
--------------------
New Components
^^^^^^^^^^^^^^
- Add sm2135 component :esphomepr:`1736` by :ghuser:`BoukeHaarsma23` (cherry-picked) (new-integration)
- Add support for the XPT2046 touchscreen controller :esphomepr:`1542` by :ghuser:`numo68` (new-integration)
- Add support for SDMXXX energy meters :esphomepr:`1260` by :ghuser:`polyfaces` (new-integration)
- Add CS5460A power-meter component :esphomepr:`1474` by :ghuser:`balrog-kun` (new-integration)
- Added support for Xiaomi CGDK2 :esphomepr:`1451` by :ghuser:`zaluthar` (new-integration)
- Improv - BLE WiFi provisioning :esphomepr:`1807` by :ghuser:`jesserockz` (new-integration) (notable-change)
Breaking Changes
^^^^^^^^^^^^^^^^
- Drop 128x160 ESP-32 camera resolution :esphomepr:`1813` by :ghuser:`oxan` (breaking-change)
- teleinfo: use text_sensor and sensor. :esphomepr:`1403` by :ghuser:`0hax` (breaking-change)
- CLI user experience improvements :esphomepr:`1805` by :ghuser:`oxan` (breaking-change) (notable-change)
Notable Changes
^^^^^^^^^^^^^^^
- Add attribute support to Home Assistant sensors :esphomepr:`1770` by :ghuser:`frenck` (notable-change)
- CLI user experience improvements :esphomepr:`1805` by :ghuser:`oxan` (breaking-change) (notable-change)
- Improv - BLE WiFi provisioning :esphomepr:`1807` by :ghuser:`jesserockz` (new-integration) (notable-change)
Beta Fixes
^^^^^^^^^^
- Upgrade the version of AsyncTCP-esphome to v1.2.2 :esphomepr:`1762` by :ghuser:`glmnet` (cherry-picked)
- Fix build issues for idf 4.2 (Support ESP32-S2) :esphomepr:`1433` by :ghuser:`misery` (cherry-picked)
- Use core constants for sample duration on bh1750 :esphomepr:`1764` by :ghuser:`yuvalabou` (breaking-change) (cherry-picked)
- Add sm2135 component :esphomepr:`1736` by :ghuser:`BoukeHaarsma23` (cherry-picked) (new-integration)
- Allow RC522 components to have multiple configurations :esphomepr:`1782` by :ghuser:`jesserockz` (cherry-picked)
- Simplify LightCall validation :esphomepr:`1874` by :ghuser:`oxan` (cherry-picked)
- Simplify LightCall validation :esphomepr:`1874` by :ghuser:`oxan` (cherry-picked)
- BLE loop use :esphomepr:`1882` by :ghuser:`jesserockz` (cherry-picked)
- BLE loop use :esphomepr:`1882` by :ghuser:`jesserockz` (cherry-picked)
- Add support for waveshare_epaper 1.54v2 :esphomepr:`1843` by :ghuser:`geoffdavis` (cherry-picked)
- Add support for waveshare_epaper 1.54v2 :esphomepr:`1843` by :ghuser:`geoffdavis` (cherry-picked)
- Ensure wifi is in at least station mode before starting improv :esphomepr:`1899` by :ghuser:`jesserockz` (cherry-picked)
- Ensure wifi is in at least station mode before starting improv :esphomepr:`1899` by :ghuser:`jesserockz` (cherry-picked)
- Move esp32_ble_server to its own component :esphomepr:`1898` by :ghuser:`jesserockz` (breaking-change) (cherry-picked) (new-integration)
- Move esp32_ble_server to its own component :esphomepr:`1898` by :ghuser:`jesserockz` (breaking-change) (cherry-picked) (new-integration)
- Add new wizard + allow installing firmware over webserial :esphomepr:`1887` by :ghuser:`balloob` (cherry-picked)
- Add new wizard + allow installing firmware over webserial :esphomepr:`1887` by :ghuser:`balloob` (cherry-picked)
- Allow no networks or AP to be set. :esphomepr:`1908` by :ghuser:`jesserockz` (cherry-picked)
- Allow no networks or AP to be set. :esphomepr:`1908` by :ghuser:`jesserockz` (cherry-picked)
- Validate that either networks, ap, or improv is set up :esphomepr:`1910` by :ghuser:`jesserockz` (cherry-picked)
- Validate that either networks, ap, or improv is set up :esphomepr:`1910` by :ghuser:`jesserockz` (cherry-picked)
- Bump frontend to 20210614.0 :esphomepr:`1912` by :ghuser:`balloob` (cherry-picked)
- Bump frontend to 20210614.0 :esphomepr:`1912` by :ghuser:`balloob` (cherry-picked)
- fixes compatibility with esphome cfg vscode :esphomepr:`1911` by :ghuser:`glmnet` (cherry-picked)
- fixes compatibility with esphome cfg vscode :esphomepr:`1911` by :ghuser:`glmnet` (cherry-picked)
- Bump dashboard to 20210615.0 :esphomepr:`1918` by :ghuser:`balloob` (cherry-picked)
- Shorten the ble name to prevent crash with long device names :esphomepr:`1920` by :ghuser:`jesserockz` (cherry-picked)
- Fix update-all from dashboard :esphomepr:`1924` by :ghuser:`frenck`
All changes
^^^^^^^^^^^
- Bump black from 20.8b1 to 21.5b0 :esphomepr:`1745` by :ghuser:`dependabot[bot]`
- Bump pylint from 2.7.2 to 2.8.2 :esphomepr:`1729` by :ghuser:`dependabot[bot]`
- Fix error when using %% in printf format. :esphomepr:`1713` by :ghuser:`mmakaay`
- Update const.py :esphomepr:`1748` by :ghuser:`cciprian5`
- Allow duration for deep_sleep.enter to be templatable :esphomepr:`1765` by :ghuser:`jesserockz`
- Bump black from 21.5b0 to 21.5b1 :esphomepr:`1768` by :ghuser:`dependabot[bot]`
- Bump flake8 from 3.9.0 to 3.9.2 :esphomepr:`1763` by :ghuser:`dependabot[bot]`
- Bump pytest from 6.2.3 to 6.2.4 :esphomepr:`1769` by :ghuser:`dependabot[bot]`
- Adding delay to aht10.cpp (issue #1635) :esphomepr:`1498` by :ghuser:`krunkel`
- Mitsubishi Heat Pump - Fixed default transmit_state to be generic instead of for a specific type of heat pump :esphomepr:`1414` by :ghuser:`RubyBailey`
- Add function to set SDS011 sensor in sleeping mode :esphomepr:`1416` by :ghuser:`onde2rock`
- Autorepeat filter for the binary sensors :esphomepr:`1681` by :ghuser:`numo68`
- Add action to set total pulses on pulse_meter :esphomepr:`1757` by :ghuser:`jesserockz`
- Add more json schema generation features :esphomepr:`1690` by :ghuser:`glmnet`
- Generate protobuf code closer to formatted files :esphomepr:`1790` by :ghuser:`jesserockz`
- Add attribute support to Home Assistant sensors :esphomepr:`1770` by :ghuser:`frenck` (notable-change)
- Bump Arduino SDK for ESP32 to 1.0.6 :esphomepr:`1789` by :ghuser:`agners`
- Added bottom segment to digit 9 :esphomepr:`1787` by :ghuser:`testbughub`
- Add support for the XPT2046 touchscreen controller :esphomepr:`1542` by :ghuser:`numo68` (new-integration)
- Revert "Added bottom segment to digit 9" :esphomepr:`1791` by :ghuser:`jesserockz`
- Introduce new async-def coroutine syntax :esphomepr:`1657` by :ghuser:`OttoWinter`
- Add on_tag_removed trigger to pn532 :esphomepr:`1436` by :ghuser:`romerod`
- Do not use Serial2 for ESP32C3, too :esphomepr:`1798` by :ghuser:`misery`
- Use latest version of upstream NeoPixelBus library :esphomepr:`1701` by :ghuser:`agners`
- Added fan triggers on_turn_on and on_turn_off :esphomepr:`1726` by :ghuser:`dataway`
- tm1637 - support 6 character displays :esphomepr:`1803` by :ghuser:`dataway`
- Convert core components to async-def coroutine syntax :esphomepr:`1658` by :ghuser:`OttoWinter`
- Lights & GPIO Switch inverted restore mode :esphomepr:`1810` by :ghuser:`frenck`
- allow default option for typed_schema :esphomepr:`1700` by :ghuser:`wifwucite`
- Refactor font creation to save stack space :esphomepr:`1707` by :ghuser:`numo68`
- BME680 BSEC: Allow sample rate overrides for T/P/H sensors :esphomepr:`1710` by :ghuser:`trvrnrth`
- Add the on_page_change display trigger :esphomepr:`1687` by :ghuser:`numo68`
- Allow segments in a light partition to be reversed :esphomepr:`1484` by :ghuser:`jimbauwens`
- Document considerations when changing recommended framework version :esphomepr:`1822` by :ghuser:`OttoWinter`
- Convert components to async-def syntax :esphomepr:`1821` by :ghuser:`OttoWinter`
- Bump protobuf from 3.15.8 to 3.17.0 :esphomepr:`1776` by :ghuser:`dependabot[bot]`
- Convert components to async-def syntax :esphomepr:`1823` by :ghuser:`OttoWinter`
- Update sensor device classes from HA :esphomepr:`1825` by :ghuser:`OttoWinter`
- Update platformio.ini settings and fix test apps :esphomepr:`1815` by :ghuser:`oxan`
- lambda condition should return :esphomepr:`1833` by :ghuser:`glmnet`
- fix dallas pin validation :esphomepr:`1692` by :ghuser:`glmnet`
- Fix typo in wizard :esphomepr:`1836` by :ghuser:`ThomDietrich`
- add validate to components :esphomepr:`1631` by :ghuser:`glmnet`
- Added bottom segment to digit 9 :esphomepr:`1847` by :ghuser:`testbughub`
- Add support for SDMXXX energy meters :esphomepr:`1260` by :ghuser:`polyfaces` (new-integration)
- Add CS5460A power-meter component :esphomepr:`1474` by :ghuser:`balrog-kun` (new-integration)
- Drop 128x160 ESP-32 camera resolution :esphomepr:`1813` by :ghuser:`oxan` (breaking-change)
- Rf Bridge: add bucket sniffing and beep functionality :esphomepr:`1819` by :ghuser:`ianchi`
- Use built-in validation for altitude :esphomepr:`1831` by :ghuser:`agners`
- Don't check uart settings for modbus :esphomepr:`1850` by :ghuser:`jesserockz`
- I2c raw cmds with multiplexer :esphomepr:`1817` by :ghuser:`mmakaay`
- Update fingerprint count after enroll :esphomepr:`1811` by :ghuser:`rwagnervm`
- teleinfo: use text_sensor and sensor. :esphomepr:`1403` by :ghuser:`0hax` (breaking-change)
- Copy missing BLE client characteristic read data :esphomepr:`1818` by :ghuser:`buxtronix`
- Added support for Xiaomi CGDK2 :esphomepr:`1451` by :ghuser:`zaluthar` (new-integration)
- Fix ble client esp_gatt_if comparison :esphomepr:`1852` by :ghuser:`jesserockz`
- Add optional lambda to BLESensor for raw data parsing :esphomepr:`1851` by :ghuser:`torfbolt`
- Support Tuya light color temperature control :esphomepr:`1412` by :ghuser:`rmounce`
- Tuya improvements :esphomepr:`1491` by :ghuser:`trvrnrth`
- Use size_t for length parameter :esphomepr:`1799` by :ghuser:`misery`
- Added vol +/- control to dfplayer :esphomepr:`1856` by :ghuser:`foxsam21`
- Support raw datapoints for tuya components :esphomepr:`1669` by :ghuser:`kroimon`
- Add support for Sensor state class :esphomepr:`1835` by :ghuser:`frenck`
- make crc16 function accessible :esphomepr:`1857` by :ghuser:`ssieb`
- Add preset, custom_preset and custom_fan_mode support to climate :esphomepr:`1471` by :ghuser:`Lumpusz`
- Avoid unnecessary waits to stabilize the VOC algorithm :esphomepr:`1834` by :ghuser:`agners`
- Fix SCD30 configuration on ESP32 :esphomepr:`1830` by :ghuser:`agners`
- Bump Docker base version to 3.1.0 :esphomepr:`1864` by :ghuser:`agners`
- CLI user experience improvements :esphomepr:`1805` by :ghuser:`oxan` (breaking-change) (notable-change)
- Improv - BLE WiFi provisioning :esphomepr:`1807` by :ghuser:`jesserockz` (new-integration) (notable-change)
- Implement versioning for esphome/esphome-lint docker images :esphomepr:`1877` by :ghuser:`OttoWinter`
- Bump base image to 3.4.0 :esphomepr:`1879` by :ghuser:`OttoWinter`
- Use Clang 11 :esphomepr:`1846` by :ghuser:`agners`
- Remove explain changes section from PR template :esphomepr:`1876` by :ghuser:`OttoWinter`
- Fixes for BLE/improv :esphomepr:`1878` by :ghuser:`jesserockz`
- Fix Clang 11 finds :esphomepr:`1880` by :ghuser:`agners`
- Allow setting creator project name and version into code :esphomepr:`1872` by :ghuser:`jesserockz`
- Add platform and board to mdns response when API is used :esphomepr:`1871` by :ghuser:`jesserockz`
- Update total_pulses at every detected pulse :esphomepr:`1875` by :ghuser:`rklomp`
- Simplify LightCall validation :esphomepr:`1874` by :ghuser:`oxan` (cherry-picked)
- BLE loop use :esphomepr:`1882` by :ghuser:`jesserockz` (cherry-picked)
- Add support for waveshare_epaper 1.54v2 :esphomepr:`1843` by :ghuser:`geoffdavis` (cherry-picked)
- Update ambiguous command :esphomepr:`1889` by :ghuser:`jesserockz`
- Configure clang-format for consistent pointer alignment :esphomepr:`1890` by :ghuser:`OttoWinter`
- Activate some clang-tidy checks :esphomepr:`1884` by :ghuser:`OttoWinter`
- Avoid non-const globals and enable clang-tidy check :esphomepr:`1892` by :ghuser:`agners`
- Convert st7735.cpp to use Unix line separators :esphomepr:`1894` by :ghuser:`oxan`
- Ensure wifi is in at least station mode before starting improv :esphomepr:`1899` by :ghuser:`jesserockz` (cherry-picked)
- Move esp32_ble_server to its own component :esphomepr:`1898` by :ghuser:`jesserockz` (breaking-change) (cherry-picked) (new-integration)
- Add new wizard + allow installing firmware over webserial :esphomepr:`1887` by :ghuser:`balloob` (cherry-picked)
- Split files in light component :esphomepr:`1893` by :ghuser:`oxan`
- Fix CI by avoiding non-const global :esphomepr:`1907` by :ghuser:`oxan`
- Adds support cpp to vscode :esphomepr:`1828` by :ghuser:`dentra`
- Allow no networks or AP to be set. :esphomepr:`1908` by :ghuser:`jesserockz` (cherry-picked)
- Validate that either networks, ap, or improv is set up :esphomepr:`1910` by :ghuser:`jesserockz` (cherry-picked)
- Support ESP8266 Arduino 3.0.0 :esphomepr:`1897` by :ghuser:`agners`
- Bump frontend to 20210614.0 :esphomepr:`1912` by :ghuser:`balloob` (cherry-picked)
- Run script/setup in devcontainer instead of pip install :esphomepr:`1913` by :ghuser:`OttoWinter`
- fixes compatibility with esphome cfg vscode :esphomepr:`1911` by :ghuser:`glmnet` (cherry-picked)
- Bump dashboard to 20210615.0 :esphomepr:`1918` by :ghuser:`balloob` (cherry-picked)
- Shorten the ble name to prevent crash with long device names :esphomepr:`1920` by :ghuser:`jesserockz` (cherry-picked)
- Fix update-all from dashboard :esphomepr:`1924` by :ghuser:`frenck`
Past Changelogs
---------------
.. toctree::
:maxdepth: 1
v1.18.0
v1.17.0
v1.16.0
v1.15.0
v1.14.0
v1.13.0
v1.12.0
v1.11.0
v1.10.0
v1.9.0
v1.8.0
v1.7.0

View File

@ -16,11 +16,25 @@ states from your Home Assistant instance using the :doc:`native API </components
name: "Input Boolean From Home Assistant"
entity_id: input_boolean.state_home
With Home Assistant 2021.6 or newer, entity state attributes can also be imported.
.. code-block:: yaml
# Example configuration entry
binary_sensor:
- platform: homeassistant
id: muted
entity_id: media_player.mega_speakers
attribute: is_volume_muted
Configuration variables:
------------------------
- **name** (**Required**, string): The name of the binary sensor.
- **entity_id** (**Required**, string): The entity ID to import from Home Assistant.
- **attribute** (*Optional*, string): The name of the state attribute to import from the
specified entity. The entity state is used when this option is omitted.
Requires Home Assistant 2021.6 or newer.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -78,6 +78,13 @@ of these entries matters!)
- delayed_on: 100ms
- delayed_off: 100ms
- delayed_on_off: 100ms
- autorepeat:
- delay: 1s
time_off: 100ms
time_on: 900ms
- delay: 5s
time_off: 100ms
time_on: 400ms
- lambda: |-
if (id(other_binary_sensor).state) {
return x;
@ -113,6 +120,28 @@ Only send an OFF value if the binary sensor has stayed OFF for at least the spec
for at least the specified time period.
**Useful for debouncing binary switches**.
``autorepeat``
**************
A filter implementing the autorepeat behavior. The filter is parametrized by a list of timing descriptions.
When a signal ON is received it is passed to the output and the first ``delay`` is started. When this
interval expires the output is turned OFF and toggles using the ``time_off`` and ``time_on`` durations
for the OFF and ON state respectively. At the same time the ``delay`` of the second timing description
is started and the process is repeated until the list is exhausted, in which case the timing of the
last description remains in use. Receiving an OFF signal stops the whole process and immediately outputs OFF.
The example thus waits one second with the output being ON, toggles it once per second for five seconds,
then toggles twice per second until OFF is received.
An ``autorepeat`` filter with no timing description is equivalent to one timing with all the parameters
set to default values.
Configuration variables:
- **delay** (*Optional*, :ref:`config-time`): Delay to proceed to the next timing. Defaults to ``1s``.
- **time_off** (*Optional*, :ref:`config-time`): Interval to hold the output at OFF. Defaults to ``100ms``.
- **time_on** (*Optional*, :ref:`config-time`): Interval to hold the output at ON. Defaults to ``900ms``.
``lambda``
**********

View File

@ -59,6 +59,8 @@ Configuration variables:
If a device is not found within this time window, it will be marked as not present. Defaults to 1s.
- **on_tag** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when a tag is read. See :ref:`pn532-on_tag`.
- **on_tag_removed** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when a tag is removed. See :ref:`pn532-on_tag_removed`.
- **spi_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`SPI Component <spi>` if you want
to use multiple SPI buses.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID for this component.
@ -155,6 +157,27 @@ Alternatively you could also send the value directly to Home Assistant via a
name: "RFID Tag"
id: rfid_tag
.. _pn532-on_tag_removed:
``on_tag_removed``
------------------
This automation will be triggered when the PN532 module responds with no tag. This will only be triggered
if the tag goes away for one cycle of ``update_interval``.
The parameter ``x`` this trigger provides is of type ``std::string`` and is the removed tag UID in the format
``74-10-37-94``. The configuration below will for example publish the removed tag ID on the MQTT topic ``pn532/tag_removed``.
.. code-block:: yaml
pn532:
# ...
on_tag_removed:
then:
- mqtt.publish:
topic: pn532/tag_removed
payload: !lambda 'return x;'
.. _pn532-tag:
``pn532`` Binary Sensor

View File

@ -0,0 +1,276 @@
XPT2046 Touch Screen Controller
==================================
.. seo::
:description: Instructions for setting up XPT2046 touch screen controller with ESPHome
:image: xpt2046.jpg
:keywords: XPT2046
.. _xpt2046-component:
Component/Hub
-------------
The ``xpt2046`` component allows using the touch screen controllers
based on the XPT2046 chip
(`datasheet <https://datasheetspdf.com/pdf-file/746665/XPTEK/XPT2046/1>`__,
`AZ-Delivery`_) with ESPHome. Many cheap LCD displays contain this controller.
The :ref:`SPI <spi>` is required to be set up in your configuration for this sensor to work.
.. figure:: images/xpt2046-full.jpg
:align: center
:width: 50.0%
XPT2046 Touch Screen Controller
.. _AZ-Delivery: https://www.az-delivery.de/en/products/2-4-tft-lcd-touch-display
.. code-block:: yaml
# Example configuration entry
xpt2046:
id: touchscreen
cs_pin: 17
irq_pin: 16
update_interval: 50ms
report_interval: 1s
threshold: 400
dimension_x: 240
dimension_y: 320
calibration_x_min: 3860
calibration_x_max: 280
calibration_y_min: 340
calibration_y_max: 3860
swap_x_y: False
binary_sensor:
- platform: xpt2046
xpt2046_id: touchscreen
id: touch_key0
x_min: 80
x_max: 160
y_min: 106
y_max: 212
on_state:
- lambda: 'ESP_LOGI("main", "key0: %s", (x ? "touch" : "release"));'
Configuration variables:
------------------------
The configuration is made up of two parts: The touch screen component, and optional individual binary sensors.
Base Configuration:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor.
- **cs_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The chip select pin.
Often marked ``T_CS`` on the board.
- **irq_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The touch detection pin.
Often marked ``T_IRQ`` on the board. If not specified the component will use polling
via SPI.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. If ``irq_pin`` is specified the touch will be detected nearly instantaneously and this setting
will be used only for the release detection. Defaults to ``50ms``.
- **report_interval** (*Optional*, :ref:`config-time`): The interval to periodically
report the coordinates while the touch screen is touched. Defaults to ``never``.
- **threshold** (*Optional*, integer): The value to detect the touch or release. Defaults to ``400``.
- **dimension_x** (*Optional*, integer): The dimension of the display in the horizontal
direction. Usually in pixels but a percentage can be useful as well. Defaults to ``100``.
- **dimension_y** (*Optional*, integer): The dimension of the display in the vertical
direction. Usually in pixels but a percentage can be useful as well. Defaults to ``100``.
- **calibration_x_min** (*Optional*, integer): The raw value corresponding to the left
(or top if ``swap_x_y`` is specified) edge of the display. See :ref:`xpt2046-calibration`
for the process to calibrate the touch screen. Defaults to ``0``.
- **calibration_x_max** (*Optional*, integer): The raw value corresponding to the right
(or bottom if ``swap_x_y`` is specified) edge of the display. Defaults to ``4095``.
- **calibration_y_min** (*Optional*, integer): The raw value corresponding to the top
(or left if ``swap_x_y`` is specified) edge of the display. Defaults to ``0``.
- **calibration_y_max** (*Optional*, integer): The raw value corresponding to the bottom
(or right if ``swap_x_y`` is specified) edge of the display. Defaults to ``4095``.
- **swap_x_y** (*Optional*, boolean): If true the x and y axes are swapped. Defaults to ``false``.
- **on_state** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when the touch screen is pressed or released. See :ref:`xpt2046-on_state`.
.. _xpt2046-on_state:
``on_state`` Action
-------------------
This automation will be triggered when the XPT2046 touch screen detects a touch, a release
or periodically each ``report_interval`` while touched.
This trigger provides three arguments: ``x`` and ``y`` are of the type int and specify the
coordinates of the touch and a bool ``touched`` specifying whether a touch or release was
detected.
Additionally to the coordinates, the touch status and the raw values needed for the calibration
can be accessed as member variables.
The following code
.. code-block:: yaml
xpt2046:
on_state:
- lambda: |-
ESP_LOGI("main", "args x=%d, y=%d, touched=%s", x, y, (touched ? "touch" : "release"));
ESP_LOGI("main", "member x=%d, y=%d, touched=%d, x_raw=%d, y_raw=%d, z_raw=%d",
id(touchscreen).x,
id(touchscreen).y,
(int) id(touchscreen).touched,
id(touchscreen).x_raw,
id(touchscreen).y_raw,
id(touchscreen).z_raw
);
produces
.. code-block:: none
[20:17:37][I][main:065]: args x=145, y=261, touched=touch
[20:17:37][I][main:073]: member x=145, y=261, touched=1, x_raw=1686, y_raw=3218, z_raw=424
[20:17:37][I][main:065]: args x=145, y=261, touched=release
[20:17:37][I][main:073]: member x=145, y=261, touched=0, x_raw=0, y_raw=0, z_raw=0
Binary Sensor
-------------
The ``xpt2046`` binary sensor allows you to setup areas on the touch screen as virtual
buttons. First, setup a :ref:`xpt2046-component` and then use this binary sensor platform
to create individual binary sensors for each virtual button.
- **name** (*Optional*, string): The name for the binary sensor.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **xpt2046_id** (*Optional*, :ref:`config-id`): Specify the ID of the component the sensor is part of. Useful when you have more than one touch screen.
- **x_min** (*Required*, integer): Left coordinate of the screen area to be detected as the virtual button.
- **x_max** (*Required*, integer): Right coordinate of the screen area to be detected as the virtual button.
- **y_min** (*Required*, integer): Top coordinate of the screen area to be detected as the virtual button.
- **y_max** (*Required*, integer): Bottom coordinate of the screen area to be detected as the virtual button.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.
.. _xpt2046-calibration:
Calibration
-----------
To match the point of the touch to the display coordinates the touch screen has to be calibrated.
The XPT2046 component returns raw values in the 0 to 4095 range. Those raw values are available
as the ``x_raw`` and ``y_raw`` member variables and for example write them out as in the example
:ref:`xpt2046-on_state`. The goal of the calibration is to identify the raw values corresponding
to the edges of the screen.
The calibration assumes a display oriented in a way that you will be using it, i.e. your
:ref:`display-engine` component has to have the [0,0] logical coordinate at the top left.
Set the dimensions as ``dimension_x`` and ``dimension_y`` and do not set any calibration
values nor ``swap_x_y``.
.. code-block:: yaml
# Touchscreen
xpt2046:
id: touchscreen
cs_pin: 17
irq_pin: 16
dimension_x: 240
dimension_y: 320
on_state:
- lambda: |-
if (touched)
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%d",
id(touchscreen).x,
id(touchscreen).y,
id(touchscreen).x_raw,
id(touchscreen).y_raw,
);
Get a stylus or a similar object, run the project and touch the corners of the screen at
the edge pixels. Repeat several times and note minimum and maximum x and y raw values.
.. code-block:: none
... top left ...
[21:07:48][I][cal:071]: x=217, y=34, x_raw=3718, y_raw=445
[21:07:49][I][cal:071]: x=222, y=32, x_raw=3804, y_raw=419
... top right ...
[21:07:52][I][cal:071]: x=19, y=36, x_raw=334, y_raw=370
[21:07:52][I][cal:071]: x=22, y=35, x_raw=386, y_raw=347
... bottom left ...
[21:08:00][I][cal:071]: x=224, y=299, x_raw=3836, y_raw=3835
[21:08:00][I][cal:071]: x=225, y=303, x_raw=3848, y_raw=3878
[21:08:01][I][cal:071]: x=223, y=299, x_raw=3807, y_raw=3829
... bottom right ...
[21:08:11][I][cal:071]: x=16, y=299, x_raw=281, y_raw=3839
[21:08:12][I][cal:071]: x=19, y=302, x_raw=328, y_raw=3866
[21:08:13][I][cal:071]: x=20, y=296, x_raw=358, y_raw=3799
That means that the minimum raw x is 281, maximum 3848, minimum y 347 and maximum 3878.
Identify which raw value is the display's x direction and what the y one. In our case
moving right decreases the x raw value and going down increases the y one so the axes
match and we *don't* need to use ``swap_x_y``. If the raw x is the display's y,
use ``swap_x_y = True``.
If one of the coordinates goes in the "wrong" direction it needs to be inverted.
The inversion is performed by swapping the minimum and maximum values. In our
case the horizontal direction represented by the raw x (no swap) is inverted
so the ``calibration_x_min`` needs to be larger than ``calibration_x_max``.
The vertical direction is fine. The configuration would thus be
.. code-block:: yaml
xpt2046:
calibration_x_min: 3848
calibration_x_max: 281
calibration_y_min: 347
calibration_y_max: 3878
Compile, run and click on the edges again. The x and y should now match the coordinates
of the display.
.. code-block:: none
[21:32:34][I][cal:071]: x=7, y=6, x_raw=3755, y_raw=407
[21:32:37][I][cal:071]: x=237, y=4, x_raw=313, y_raw=385
[21:32:43][I][cal:071]: x=239, y=318, x_raw=284, y_raw=3845
[21:33:05][I][cal:071]: x=2, y=313, x_raw=3821, y_raw=3793
Note that the touch screen is not extremely precise and there might be nonlinearities
or similar errors so don't expect a pixel-perfect precision. You can verify the touchpoint
using a display lambda similar to the following.
.. code-block:: none
display:
- platform: ili9341
lambda: |-
it.fill(BLACK);
if (id(touchscreen).touched)
it.filled_circle(id(touchscreen).x, id(touchscreen).y, 10, RED);
To be exact, the component does the following
- reads the raw x and y and normalizes it using (non-inverted) min and max values
- swaps x and y if needed
- inverts if needed
- scales to the display dimensions
See Also
--------
- :ref:`Binary Sensor Filters <binary_sensor-filters>`
- :apiref:`xpt2046/xpt2046.h`
- `XPT2046 Library <https://platformio.org/lib/show/542/XPT2046_Touchscreen>`__ by `Paul Stoffregen <https://github.com/PaulStoffregen>`__
- :ghedit:`Edit`

View File

@ -44,8 +44,8 @@ client devices.
Configuration variables:
------------------------
- **mac_address** (*Required*, MAC Address): The MAC address of the BLE device to connect to.
- **id** (*Required*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
- **mac_address** (**Required**, MAC Address): The MAC address of the BLE device to connect to.
- **id** (**Required**, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
Automations:
@ -139,14 +139,14 @@ Once the connection is established, referencing each
service/characteristic/descriptor by the full UUID would take a
considerable portion of the small (~23 byte) packet. So the
characteristics and descriptors also provide a small 2-byte
*handle* (alias) to maximise available data space.
*handle* (alias) to maximize available data space.
Setting Up Devices
------------------
Whilst the component can connect to most BLE devices (that do not
require authentication/pin), useful functionality is only obtained
through dependent components, such as :doc:`/components/sensor/ble_sensor`.
through dependent components, such as :doc:`/components/sensor/ble_client`.
See the documentation for these components for details on setting up
specific devices.
@ -203,12 +203,12 @@ display them in the log:
The discovered services can then be used to enable and configure other
ESPHome components, for example Service UUID 0xFFE0 is used for iTag style
keychain button events, used by the :doc:`/components/sensor/ble_sensor` component.
keychain button events, used by the :doc:`/components/sensor/ble_client` component.
See Also
--------
- :doc:`/components/sensor/ble_sensor`
- :doc:`/components/sensor/ble_client`
- :ref:`Automation <automation>`
- :apiref:`ble_client/ble_client.h`
- :ghedit:`Edit`

View File

@ -81,10 +81,17 @@ Configuration variables:
higher target temperature of a climate device with a two-point target temperature.
- **away** (*Optional*, boolean, :ref:`templatable <config-templatable>`): Set the away mode
of the climate device.
- **fan_mode** (*Optional*, boolean, :ref:`templatable <config-templatable>`): Set the fan mode
- **preset** (*Optional*, string, :ref:`templatable <config-templatable>`): Set the preset
of the climate device. One of ``ECO``, ``AWAY``, ``BOOST``, ``COMFORT``, ``HOME``, ``SLEEP``,
``ACTIVITY``.
- **custom_preset** (*Optional*, string, :ref:`templatable <config-templatable>`): Set one of the
supported custom_presets of the climate device.
- **fan_mode** (*Optional*, string, :ref:`templatable <config-templatable>`): Set the fan mode
of the climate device. One of ``ON``, ``OFF``, ``AUTO``, ``LOW``, ``MEDIUM``, ``HIGH``, ``MIDDLE``,
``FOCUS``, ``DIFFUSE``.
- **swing_mode** (*Optional*, boolean, :ref:`templatable <config-templatable>`): Set the swing mode
- **custom_fan_mode** (*Optional*, string, :ref:`templatable <config-templatable>`): Set one of the
supported custom_fan_modes of the climate device.
- **swing_mode** (*Optional*, string, :ref:`templatable <config-templatable>`): Set the swing mode
of the climate device. One of ``OFF``, ``BOTH``, ``VERTICAL``, ``HORIZONTAL``.
.. _climate-lambda_calls:

View File

@ -50,6 +50,14 @@ This component requires a auto-loaded ``midea-dongle`` component, that use hardw
max_temperature: 25 °C
temperature_step: 0.1 °C
beeper: true
custom_fan_modes:
- SILENT
- TURBO
preset_eco: true
preset_sleep: true
preset_boost: true
custom_presets:
- FREEZE_PROTECTION
swing_horizontal: true
swing_both: true
outdoor_temperature:
@ -84,6 +92,11 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **beeper** (*Optional*, boolean): Beeper feedback on command. Defaults to ``False``.
- **custom_fan_modes** (*Optional*, list): List of supported custom fan modes. Possible values are: SILENT, TURBO.
- **preset_eco** (*Optional*, boolean): ECO preset support. Defaults to ``False``.
- **preset_sleep** (*Optional*, boolean): SLEEP preset support. Defaults to ``False``.
- **preset_boost** (*Optional*, boolean): BOOST preset support. Defaults to ``False``.
- **custom_presets** (*Optional*, list): List of supported custom presets. Possible values are: FREEZE_PROTECTION.
- **swing_horizontal** (*Optional*, boolean): Enable **swing horizontal** option. Defaults to ``False``.
- **swing_both** (*Optional*, boolean): Enable **swing both** option. Defaults to ``False``.
- All other options from :ref:`Climate <config-climate>`.

View File

@ -45,14 +45,21 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the climate device.
- **supports_heat** (*Optional*, boolean): Specifies if the device has a heating mode. Defaults to ``True``.
- **supports_cool** (*Optional*, boolean): Specifies if the device has a cooling mode. Defaults to ``False``.
- **switch_datapoint** (**Required**, int): The datapoint id number of the climate switch.
- **active_state_datapoint** (*Optional*, int): The datapoint id number of the active state.
- **active_state_heating_value** (*Optional*, int): The active state datapoint value the device reports when heating. Defaults to ``1``.
- **active_state_cooling_value** (*Optional*, int): The active state datapoint value the device reports when cooling.
- **target_temperature_datapoint** (**Required**, int): The datapoint id number of the target temperature.
- **current_temperature_datapoint** (**Required**, int): The datapoint id number of the current temperature.
- **temperature_multiplier** (*Optional*, float): A multiplier to modify the incoming and outgoing temperature values - :ref:`see below <temperature-multiplier>`.
If the device has different multipliers for current and target temperatures, **temperature_multiplier** can be replaced with both of:
- **current_temperature_multiplier** (*Optional*, float): A multiplier to modify the current temperature value.
- **target_temperature_multiplier** (*Optional*, float): A multiplier to modify the target temperature value.
If the device has different multipliers for current and target temperatures, **temperature_multiplier** can be replaced with both of:
- **current_temperature_multiplier** (*Optional*, float): A multiplier to modify the current temperature value.
- **target_temperature_multiplier** (*Optional*, float): A multiplier to modify the target temperature value.
- All other options from :ref:`Climate <config-climate>`.
.. _temperature-multiplier:

View File

@ -88,7 +88,7 @@ This action makes the given deep sleep component enter deep sleep immediately.
Configuration options:
- **sleep_duration** (*Optional*, :ref:`config-time`): The time duration to stay in deep sleep mode.
- **sleep_duration** (*Optional*, :ref:`templatable <config-templatable>`, :ref:`config-time`): The time duration to stay in deep sleep mode.
.. _deep_sleep-prevent_action:

View File

@ -180,6 +180,28 @@ Configuration options:
- **volume** (**Required**, int, :ref:`templatable <config-templatable>`): The volume value.
Valid values goes from ``0`` to ``30``.
``dfplayer.volume_up`` Action
-----------------------------
Turn volume up.
.. code-block:: yaml
on_...:
then:
- dfplayer.volume_up
``dfplayer.volume_down`` Action
-------------------------------
Turn volume down.
.. code-block:: yaml
on_...:
then:
- dfplayer.volume_down
``dfplayer.set_eq`` Action
--------------------------
@ -392,6 +414,14 @@ Sample code
then:
- dfplayer.random
- service: dfplayer_volume_up
then:
- dfplayer.volume_up
- service: dfplayer_volume_down
then:
- dfplayer.volume_down
See Also
--------

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" version="1"><g stroke="#000"><path d="M190.797 72.5L175.585 88h-59l-15.517-15.5L116.585 57h59l15.212 15.5zM190.797 154l-15.212 15.5h-59L101.068 154l15.517-15.5h59l15.212 15.5zM98 75.385l15.5 15.212v45L98 151.115l-15.5-15.518v-45L98 75.385zM194 75.385l15.5 15.212v45L194 151.115l-15.5-15.518v-45L194 75.385z" fill="red" fill-rule="evenodd"/><path d="M190.797 236.057l-15.212 15.5h-59l-15.517-15.5 15.517-15.5h59l15.212 15.5zM98 157.443l15.5 15.212v45L98 233.172l-15.5-15.517v-45L98 157.443z" fill="none"/><path d="M194 157.443l15.5 15.212v45L194 233.172l-15.5-15.517v-45l15.5-15.212z" fill="red" fill-rule="evenodd"/><path d="M237.5 239.25a12.25 12.25 0 1 1-24.5 0 12.25 12.25 0 1 1 24.5 0z" fill="none" stroke-linecap="round"/></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" version="1"><g stroke="#000"><path d="M190.797 72.5L175.585 88h-59l-15.517-15.5L116.585 57h59l15.212 15.5z" fill="red" fill-rule="evenodd"/><path d="M190.797 154l-15.212 15.5h-59L101.068 154l15.517-15.5h59l15.212 15.5zM98 75.385l15.5 15.212v45L98 151.115l-15.5-15.518v-45L98 75.385zM194 75.385l15.5 15.212v45L194 151.115l-15.5-15.518v-45L194 75.385z" fill="red"/><path d="M190.797 236.057l-15.212 15.5h-59l-15.517-15.5 15.517-15.5h59l15.212 15.5z" fill="red" fill-rule="evenodd"/><path d="M98 157.443l15.5 15.212v45L98 233.172l-15.5-15.517v-45L98 157.443z" fill="none"/><path d="M194 157.443l15.5 15.212v45L194 233.172l-15.5-15.517v-45l15.5-15.212z" fill="red" fill-rule="evenodd"/><path d="M237.5 239.25a12.25 12.25 0 1 1-24.5 0 12.25 12.25 0 1 1 24.5 0z" fill="none" stroke-linecap="round"/></g></svg>

Before

Width:  |  Height:  |  Size: 802 B

After

Width:  |  Height:  |  Size: 868 B

View File

@ -8,7 +8,7 @@ Waveshare E-Paper Display
The ``waveshare_epaper`` display platform allows you to use
some E-Paper displays sold by `Waveshare <https://www.waveshare.com/product/displays/e-paper.htm>`__
with ESPHome. The 2.13" `TTGO module <https://github.com/lewisxhe/TTGO-EPaper-Series>`__ with an ESP32 on the board is supported as well.
Depending on your specific revision of the board you might need to try out the `-b73` or `-b1` version (see below).
Depending on your specific revision of the board you might need to try out the ``-b73`` or ``-b1`` version (see below).
Similar modules sold by other vendors might also work but not have been tested yet. Currently only
single-color E-Ink displays are implemented and of those only a few modules.
@ -53,7 +53,7 @@ configuration.
- file: 'fonts/Comic Sans MS.ttf'
id: font1
size: 8
spi:
clk_pin: D0
mosi_pin: D1
@ -77,6 +77,7 @@ Configuration variables:
- **model** (**Required**): The model of the E-Paper display. Options are:
- ``1.54in``
- ``1.54inv2``
- ``2.13in`` (not tested)
- ``2.13in-ttgo`` (T5_V2.3 tested. Also works for Wemos D1 Mini ePaper Shield 2.13 1.0.0 "LOLIN")
- ``2.13in-ttgo-b73`` (T5_V2.3 with B73 display tested)
@ -98,9 +99,9 @@ Configuration variables:
- **full_update_every** (*Optional*, int): E-Paper displays have two modes of switching to the next image: A partial
update that only changes the pixels that have changed and a full update mode that first clears the entire display
and then re-draws the image. The former is much quicker and nicer, but every so often a full update needs to happen
because artifacts accumulate. On the ``1.54in``, ``2.13in``, ``2.90in``, and ``2.90inv2`` models you have the option
to switch only do a full-redraw every x-th time using this option. Defaults to ``30`` on the described models and a
full update for all other models.
because artifacts accumulate. On the ``1.54in``, ``1.54inv2``, ``2.13in``, ``2.90in`` and ``2.90inv2`` models you have the option to switch only
do a full-redraw every x-th time using this option. Defaults to ``30`` on the described models and a full update for
all other models.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for rendering the content on the display.
See :ref:`display-engine` for more information.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``10s``, use ``never`` to only manually update the screen via ``component.update``.

26
components/esp32_ble.rst Normal file
View File

@ -0,0 +1,26 @@
BLE Component
=============
.. seo::
:description: Instructions for setting up Bluetooth LE in ESPHome.
:image: bluetooth.svg
The ``esp32_ble`` component in ESPHome sets up the Bluetooth LE stack on the device so that a :doc:`esp32_ble_server`
can run.
.. code-block:: yaml
# Example configuration
esp32_ble:
No configuration variables.
See Also
--------
- :doc:`esp32_ble_server`
- :doc:`esp32_improv`
- :apiref:`esp32_ble/ble.h`
- :ghedit:`Edit`

View File

@ -0,0 +1,32 @@
BLE Server
==========
.. seo::
:description: Instructions for setting up Bluetooth LE GATT Server in ESPHome.
:image: bluetooth.svg
The ``esp32_ble_server`` component in ESPHome sets up a simple BLE GATT server that exposes the device name,
manufacturer and board. This component allows other components to create their own services to expose
data and control.
.. code-block:: yaml
# Example configuration
esp32_ble_server:
Configuration variables:
------------------------
- **manufacturer** (*Optional*, string): The name of the manufacturer/firmware creator. Defaults to ``ESPHome``.
- **model** (*Optional*, string): The model name of the device. Defaults to the friendly name of the ``board`` chosen
in the :ref:`core configuration <esphome-configuration_variables>`.
See Also
--------
- :doc:`esp32_ble`
- :doc:`esp32_improv`
- :apiref:`esp32_ble/ble.h`
- :ghedit:`Edit`

View File

@ -67,7 +67,6 @@ Frame Settings:
resolutions require more memory, if there's not enough memory you will see an error during startup.
- ``160x120`` (QQVGA)
- ``128x160`` (QQVGA2)
- ``176x144`` (QCIF)
- ``240x176`` (HQVGA)
- ``320x240`` (QVGA)

View File

@ -0,0 +1,41 @@
Improv
======
.. seo::
:description: Instructions for setting up Improv WiFi in ESPHome.
:image: improv-social.png
The ``esp32_improv`` component in ESPHome implements the open `Improv standard <https://www.improv-wifi.com/>`__
for configuring Wi-Fi on an ESP32 device by using Bluetooth Low Energy to receive the credentials.
The ``esp32_improv`` component will automatically set up the :doc:`BLE Server <esp32_ble>`.
.. code-block:: yaml
# Example configuration entry
wifi:
# ...
esp32_improv:
authorizer: binary_sensor_id
Configuration variables:
------------------------
- **authorizer** (**Required**, :ref:`config-id`): A :doc:`binary sensor <binary_sensor/index>` to authorize with.
Also accepts ``none``/``false`` to skip authorization.
- **authorized_duration** (*Optional*, :ref:`config-time`): The amount of time until authorization times out and needs
to be re-authorized. Defaults to ``1min``.
- **status_indicator** (*Optional*, :ref:`config-id`): An :doc:`output <output/index>` to display feedback to the user.
- **identify_duration** (*Optional*, :ref:`config-time`): The amount of time to identify for. Defaults to ``10s``.
See Also
--------
- :doc:`wifi`
- :doc:`captive_portal`
- `Improv Wi-Fi <https://www.improv-wifi.com/>`__
- :apiref:`esp32_improv/esp32_improv_component.h`
- :ghedit:`Edit`

View File

@ -19,6 +19,8 @@ where you specify the **name** of the node, the **platform** and
platform: ESP32
board: nodemcu-32s
.. _esphome-configuration_variables:
Configuration variables:
------------------------
@ -50,9 +52,14 @@ Advanced options:
to include in the project. See `platformio lib install <https://docs.platformio.org/en/latest/userguide/lib/cmd_install.html>`__.
- **comment** (*Optional*, string): Additional text information about this node. Only for display in UI.
- **name_add_mac_suffix** (*Optional*, boolean): Appends the last 6 bytes of the mac address of the device to
the name in the form `<name>-aabbcc`. Defaults to ``False``.
the name in the form ``<name>-aabbcc``. Defaults to ``False``.
See :ref:`esphome-mac_suffix`.
- **project** (*Optional*): ESPHome Creator's Project information. See :ref:`esphome-creators_project`.
- **name** (**Required**, string): Name of the project
- **version** (**Required**, string): Version of the project
ESP8266 Options:
- **esp8266_restore_from_flash** (*Optional*, boolean): Whether to save & restore data from flash on ESP8266s.
@ -98,7 +105,9 @@ option you can tell ESPHome which Arduino framework to use for compiling.
For the ESP8266, you currently can manually pin the Arduino version to these values (see the full
list of Arduino frameworks `here <https://github.com/esp8266/Arduino/releases>`__):
* `2.7.2 <https://github.com/esp8266/Arduino/releases/tag/2.7.2>`__ (default)
* `2.7.4 <https://github.com/esp8266/Arduino/releases/tag/2.7.4>`__ (default)
* `2.7.3 <https://github.com/esp8266/Arduino/releases/tag/2.7.3>`__
* `2.7.2 <https://github.com/esp8266/Arduino/releases/tag/2.7.2>`__
* `2.7.1 <https://github.com/esp8266/Arduino/releases/tag/2.7.1>`__
* `2.7.0 <https://github.com/esp8266/Arduino/releases/tag/2.7.0>`__
* `2.6.3 <https://github.com/esp8266/Arduino/releases/tag/2.6.3>`__
@ -114,7 +123,9 @@ list of Arduino frameworks `here <https://github.com/esp8266/Arduino/releases>`_
For the ESP32, there are these Arduino `framework versions <https://github.com/espressif/arduino-esp32/releases>`__:
- `1.0.4 <https://github.com/espressif/arduino-esp32/releases/tag/1.0.4>`__ (default)
- `1.0.6 <https://github.com/espressif/arduino-esp32/releases/tag/1.0.6>`__ (default)
- `1.0.5 <https://github.com/espressif/arduino-esp32/releases/tag/1.0.5>`__
- `1.0.4 <https://github.com/espressif/arduino-esp32/releases/tag/1.0.4>`__
- `1.0.3 <https://github.com/espressif/arduino-esp32/releases/tag/1.0.3>`__
- `1.0.2 <https://github.com/espressif/arduino-esp32/releases/tag/1.0.2>`__
- `1.0.1 <https://github.com/espressif/arduino-esp32/releases/tag/1.0.1>`__
@ -311,6 +322,26 @@ many of the same device and they will all have unique names/hostnames.
Note that you will still need to create an individual YAML config file if you want to
OTA update the devices in the future.
.. _esphome-creators_project:
Project information
-------------------
This allows creators to add the project name and version to the compiled code. It is currently only
exposed via the logger, mDNS and the device_info response via the native API. The format of the name
should be ``author_name.project_name``.
.. code-block:: yaml
# Example configuration
esphome:
...
project:
name: "jesse.leds_party"
version: "1.0.0"
See Also
--------

View File

@ -45,6 +45,13 @@ MQTT options:
speed commands on.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
Automation triggers:
- **on_turn_on** (*Optional*, :ref:`Action <config-action>`): An automation to perform
when the fan is turned on. See :ref:`fan-on_turn_on_off_trigger`.
- **on_turn_off** (*Optional*, :ref:`Action <config-action>`): An automation to perform
when the fan is turned off. See :ref:`fan-on_turn_on_off_trigger`.
.. _fan-toggle_action:
``fan.toggle`` Action
@ -95,6 +102,24 @@ Configuration options:
- **speed** (*Optional*, int, :ref:`templatable <config-templatable>`):
Set the speed level of the fan. Can be a number between 1 and the maximum speed level of the fan.
.. _fan-on_turn_on_off_trigger:
``fan.on_turn_on`` / ``fan.on_turn_off`` Trigger
****************************************************
This trigger is activated each time the fan is turned on or off. It does not fire
if a command to turn the fan on or off already matches the current state.
.. code-block:: yaml
fan:
- platform: speed # or any other platform
# ...
on_turn_on:
- logger.log: "Fan Turned On!"
on_turn_off:
- logger.log: "Fan Turned Off!"
Full Fan Index
--------------

View File

@ -55,7 +55,7 @@ Configuration variables:
- **switch_datapoint** (**Required**, int): The datapoint id number of the fan switch.
- **oscillation_datapoint** (*Optional*, int): The datapoint id number of the oscillation
switch. Probably not supported on any Tuya controllers currently, but it's there if need be.
- **direction_datapoint** (**Optional**, int): The datapoint id number of the direction
- **direction_datapoint** (*Optional*, int): The datapoint id number of the direction
switch. Supported by some ceiling fans.
- **speed_count** (*Optional*, int): Set the number of supported discrete speed levels. Defaults to ``3``.
- All other options from :ref:`Fan <config-fan>`.

View File

@ -19,8 +19,9 @@ The ``fingerprint_grow`` component allows you to use your R307, R503, ZFM-20, ..
R503 Capacitive Fingerprint Reader with Bi-Color Aura LED (`datasheet <https://cdn-shop.adafruit.com/product-files/4651/4651_R503+fingerprint+module+user+manual.pdf>`__, `Adafruit <https://www.adafruit.com/product/4651>`__). Image by `Adafruit <https://www.adafruit.com/product/4651>`__.
Overview
--------
Component/Hub
-------------
The reader can be powered by the 3.3V output of an NodeMCU. As the communication with the reader is done using UART (default baud rate is 57600), you need to have an :ref:`UART bus <uart>` in your configuration with the ``rx_pin`` connected to the reader's ``TX`` and the ``tx_pin`` connected to the reader's ``RX``.
@ -60,25 +61,25 @@ If available on your reader model, it's recommended to connect 3.3VT (touch indu
- text_sensor.template.publish:
id: fingerprint_state
state: "Failed to enroll fingerprint"
# Optional template text sensor for visual feedback
text_sensor:
- platform: template
id: fingerprint_state
name: "Fingerprint State"
# Optional component (GPIO switch, lock etc.) to control in on_finger_scan_matched trigger
switch:
- platform: gpio
pin: GPIO14
id: gate
# Optional sensors
binary_sensor:
- platform: fingerprint_grow
id: fingerprint_enrolling
name: "Fingerprint Enrolling"
sensor:
- platform: fingerprint_grow
fingerprint_count:
@ -96,7 +97,6 @@ If available on your reader model, it's recommended to connect 3.3VT (touch indu
Configuration variables:
------------------------
The configuration is made up of three parts: The central component, optional individual sensors, and the optional enrolling binary sensor.
@ -113,7 +113,10 @@ Base Configuration:
- **on_enrollment_done** (*Optional*, :ref:`Automation <automation>`): An action to be performed when a fingerprint is enrolled. See :ref:`fingerprint_grow-on_enrollment_done`.
- **on_enrollment_failed** (*Optional*, :ref:`Automation <automation>`): An action to be performed when a fingerprint enrollment failed. See :ref:`fingerprint_grow-on_enrollment_failed`.
Optional Binary Sensor Configuration:
Binary Sensor
-------------
Configuration variables:
- **name** (**Required**, string): The name for the enrolling binary sensor.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
@ -121,7 +124,8 @@ Optional Binary Sensor Configuration:
Optional Sensor Configuration:
Available sensors:
Sensor
------
- **fingerprint_count**: The number of enrolled fingerprints stored on the reader.

View File

@ -38,6 +38,8 @@ Configuration variables:
- ``RESTORE_DEFAULT_OFF`` (Default) - Attempt to restore state and default to OFF if not possible to restore.
- ``RESTORE_DEFAULT_ON`` - Attempt to restore state and default to ON.
- ``RESTORE_INVERTED_OFF`` - Attempt to restore state inverted from the previous state and default to OFF.
- ``RESTORE_INVERTED_ON`` - Attempt to restore state inverted from the previous state and default to ON.
- ``ALWAYS_OFF`` - Always initialize the light as OFF on bootup.
- ``ALWAYS_ON`` - Always initialize the light as ON on bootup.

View File

@ -88,6 +88,7 @@ Configuration variables:
- **from** (**Required**, int): The first LED to address in the segment. Counting starts with 0,
so first LED is 0.
- **to** (**Required**, int): The index of the last LED to address in this segment.
- **reversed** (**Required**, int): Whether to reverse the LEDs in this segment.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **effects** (*Optional*, list): A list of :ref:`light effects <light-effects>` to use for this light.

View File

@ -79,10 +79,18 @@ Configuration variables:
- **switch_datapoint** (*Optional*, int): The datapoint id number of the power switch. My dimmer
required this to be able to turn the light on and off. Without this you would only be able to
change the brightness and would have to toggle the light using the physical buttons.
- **color_temperature_datapoint** (*Optional*, int): The datapoint id number of the color
temperature value.
- **min_value** (*Optional*, int, default 0): The lowest dimmer value allowed. My dimmer had a
minimum of 25 and wouldn't even accept anything lower, but this option is available if necessary.
- **max_value** (*Optional*, int, default 255): The highest dimmer value allowed. Most dimmers have a
maximum of 255, but dimmers with a maximum of 1000 can also be found. Try what works best.
- **color_temperature_max_value** (*Optional*, int, default 255): The highest color temperature
value allowed. Some ceiling fans have a value of 100 (also for `max_value`).
- **cold_white_color_temperature** (**Optional**, float): The color temperate (in `mireds
<https://en.wikipedia.org/wiki/Mired>`__ or Kelvin) of the cold white channel.
- **warm_white_color_temperature** (**Optional**, float): The color temperate (in `mireds
<https://en.wikipedia.org/wiki/Mired>`__ or Kelvin) of the warm white channel.
- All other options from :ref:`Light <config-light>`.
- At least one of *dimmer_datapoint* or *switch_datapoint* must be provided.

35
components/modbus.rst Normal file
View File

@ -0,0 +1,35 @@
.. _modbus:
Modbus Component
================
.. seo::
:description: Instructions for setting up Modbus in ESPHome.
:keywords: Modbus
The Modbus protocol is used by many consumer and industrial devices for communication.
This component allows components in ESPHome to communicate to those devices.
Modbus requires a :ref:`UART Bus <uart>` to communicate.
.. code-block:: yaml
# Example configuration entry
uart:
...
modbus:
Configuration variables:
------------------------
- **flow_control_pin** (*Optional*, :ref:`config-pin`): The pin used to switch flow control.
This is useful for RS485 transeivers that do not have automatic flow control switching,
like the common MAX485.
See Also
--------
- :ref:`uart`
- :apiref:`modbus/modbus.h`
- :ghedit:`Edit`

View File

@ -149,7 +149,7 @@ With Docker:
.. code-block:: bash
docker run --rm -v "${PWD}":/config -it esphome/esphome configuration.yaml clean-mqtt
docker run --rm -v "${PWD}":/config -it esphome/esphome clean-mqtt configuration.yaml
This will remove all retained messages with the topic
``<DISCOVERY_PREFIX>/+/NODE_NAME/#``. If you want to purge on another

View File

@ -7,8 +7,8 @@ SM2135 LED driver
.. _sm2135-component:
Component
---------
Component/Hub
-------------
The SM2135 component represents a SM2135 LED diver chain
(`SM2135 description <https://github.com/arendst/Sonoff-Tasmota/files/3656603/SM2135E_zh-CN_en-US_translated.pdf>`__,
@ -17,7 +17,7 @@ ESPHome. Communication is done with two GPIO pins (MOSI and SCLK).
It is used in some smart light bulbs:
- Calex Smart RGB Reflector LED lamp (GU10)
- LSC Smart GU10
- LSC Smart GU10
To use the channels of this components, you first need to setup the
global ``sm2135`` hub and give it an id, and then define the
@ -65,8 +65,8 @@ Configuration variables:
.. _sm2135-output:
Driver Output
-------------
Output
------
The SM2135 output component exposes a SM2135 channel of a global
:ref:`sm2135-component` as a float output.
@ -114,7 +114,7 @@ Configuration variables:
.. note::
The white LEDs are much brighter than the color LEDs. To get uniform brightness
The white LEDs are much brighter than the color LEDs. To get uniform brightness
for both color and white you will need to limit the white led power.
.. note::

View File

@ -44,7 +44,7 @@ Configuration variables:
- **address** (*Optional*, int): Manually specify the I²C address of the sensor.
Defaults to ``0x23`` (address if address pin is pulled low). If the address pin is pulled high,
the address is ``0x5C``.
- **measurement_duration** (*Optional*, int): Manually specify the measurement time between ``31``
- **measurement_duration** (*Optional*, int): Manually specify the measurement duration between ``31``
and ``254``. Defaults to ``69``.
- **resolution** (*Optional*, string): The resolution of the sensor in lx. One of ``4.0``,
``1.0``, ``0.5``. Defaults to ``0.5`` (the maximum resolution).

View File

@ -1,11 +1,11 @@
BLE Sensor
==========
BLE Client Sensor
=================
.. seo::
:description: Fetch numeric values from BLE devices.
:image: bluetooth.svg
The ``ble_sensor`` component is a sensor platform that can
The ``ble_client`` component is a sensor platform that can
query BLE devices for specific values of service characteristics.
For more information on BLE services and characteristics, see
@ -36,6 +36,8 @@ Configuration variables:
- **characteristic_uuid** (**Required**, UUID): UUID of the service's characteristic to query.
- **descriptor_uuid** (*Optional*, UUID): UUID of the characteristic's descriptor to query.
- **id** (*Optional*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
- **lambda** (*Optional*, :ref:`config-lambda`): The lambda to use for converting a raw data
reading to a sensor value. See :ref:`ble-sensor-lambda` for more information.
- **notify** (*Optional*, boolean): Instruct the server to send notifications for this
characteristic.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to poll the device.
@ -46,6 +48,30 @@ Automations:
- **on_notify** (*Optional*, :ref:`Automation <automation>`): An automation to
perform when a notify message is received from the device. See :ref:`ble_sensor-on_notify`.
.. _ble-sensor-lambda:
Raw Data Parsing Lambda
-----------------------
By default only the first byte of each message received on the service's characteristic is used
for the sensor reading. For more complex messages, this behavior can be overridden by a custom
lambda function to parse the raw data. The received data bytes are passed to the lambda as a
variable ``x`` of type ``std::vector<uint8_t>``. The function must return a single ``float`` value.
.. code-block:: yaml
...
sensor:
- platform: ble_client
ble_client_id: t_sensor
name: "Temperature Sensor 32bit float"
...
device_class: "temperature"
lambda: |-
return *((float*)(&x[0]));
BLE Sensor Automation
---------------------

View File

@ -6,6 +6,9 @@ BME680 Temperature+Pressure+Humidity+Gas Sensor via BSEC
:image: bme680.jpg
:keywords: BME680
Component/Hub
-------------
The ``bme680_bsec`` sensor platform allows you to use your BME680
(`datasheet <https://cdn-shop.adafruit.com/product-files/3660/BME680.pdf>`__,
`Adafruit`_) temperature, pressure and humidity and gas sensors with ESPHome via the Bosch Sensortec Environmental Cluster (BSEC)
@ -58,14 +61,8 @@ The :ref:`I²C <i2c>` is required to be set up in your configuration for this se
name: "BME680 IAQ Accuracy"
Configuration variables:
------------------------
The configuration is made up of three parts: The central hub, individual sensors, and accuracy text sensor.
Hub Configuration:
- **address** (*Optional*, int): Manually specify the I^2C address of
the sensor. Defaults to ``0x76``. Another address can be ``0x77``.
- **address** (*Optional*, int): Manually specify the I^2C address of the sensor. Defaults to ``0x76``. Another address can be ``0x77``.
- **temperature_offset** (*Optional*, float): Temperature offset if device is in enclosure and reads too high.
Defaults to ``0``.
@ -75,28 +72,36 @@ Hub Configuration:
- **sample_rate** (*Optional*, string): Sample rate. Default is ``lp`` for low power consumption, sampling every 3 seconds.
Can be ``ulp`` for ultra low power, sampling every 5 minutes.
This controls the sampling rate for gas-dependant sensors and will govern the interval at which the sensor heater is operated.
By default this rate will also be used for temperature, pressure and humidity sensors but these can be overridden on a per-sensor level if required.
- **state_save_interval** (*Optional*, :ref:`config-time`): The minimum interval at which to save calibrated BSEC algorithm state to
flash so that calibration does have to start from zero on device restart. Defaults to ``6h``.
Sensor Configuration:
Sensor
------
Configuration variables:
- **temperature** (*Optional*): The information for the temperature sensor.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- **sample_rate** (*Optional*, string): Optional sample rate override for this sensor. Can be ``lp`` for low power consumption, sampling every 3 seconds or ``ulp`` for ultra low power, sampling every 5 minutes.
- All other options from :ref:`Sensor <config-sensor>`.
- **pressure** (*Optional*): The information for the pressure sensor.
- **name** (**Required**, string): The name for the pressure sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- **sample_rate** (*Optional*, string): Optional sample rate override for this sensor. Can be ``lp`` for low power consumption, sampling every 3 seconds or ``ulp`` for ultra low power, sampling every 5 minutes.
- All other options from :ref:`Sensor <config-sensor>`.
- **humidity** (*Optional*): The information for the humidity sensor.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- **sample_rate** (*Optional*, string): Optional sample rate override for this sensor. Can be ``lp`` for low power consumption, sampling every 3 seconds or ``ulp`` for ultra low power, sampling every 5 minutes.
- All other options from :ref:`Sensor <config-sensor>`.
- **gas_resistance** (*Optional*): The information for the gas sensor.
@ -129,9 +134,15 @@ Sensor Configuration:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
Text Sensor Configuration:
Text Sensor
-----------
- **iaq_accuracy** (*Optional*): The information for the IAQ accuracy sensor.
Accuracy can be reported in text format.
Configuration variables:
- **iaq_accuracy** (*Optional*): The information for the IAQ accuracy sensor. Shows: Stabilizing,
Uncertain, Calibrating, Calibrated.
- **name** (**Required**, string): The name for the IAQ accuracy sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
@ -180,7 +191,7 @@ For each sensor all other options from :ref:`Sensor <config-sensor>` and :ref:`T
# - lp (low power - samples every 3 seconds)
# - ulp (ultra low power - samples every 5 minutes)
# Default: lp
sample_rate: lp
sample_rate: ulp
# Interval at which to save BSEC state
# ------------------------------------
@ -192,16 +203,19 @@ For each sensor all other options from :ref:`Sensor <config-sensor>` and :ref:`T
temperature:
# Temperature in °C
name: "BME680 Temperature"
sample_rate: lp
filters:
- median
pressure:
# Pressure in hPa
name: "BME680 Pressure"
sample_rate: lp
filters:
- median
humidity:
# Relative humidity %
name: "BME680 Humidity"
sample_rate: lp
filters:
- median
gas_resistance:

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,154 @@
CS5460A Power Sensor
====================
.. seo::
:description: CS5460A component configuration
:image: cs5460a.png
:keywords: cs5460a
The ``cs5460a`` sensor platform allows you to use a CS5460A AC voltage, current and power meter
chip (`datasheet <https://statics.cirrus.com/pubs/proDatasheet/CS5460A_F5.pdf>`__) with ESPHome.
The chip is usually sold on a breakout board with a 4.096 MHz crystal. However it requires a few
extra components, specifically a current sensing circuit and a voltage sensing circuit.
.. figure:: ../../images/cs5460a.png
:align: center
:width: 30.0%
CS5460A Single-Phase Power/Energy IC module
.. warning::
Do not work near live mains connections and only modify existing electrical installations if
you're qualified.
Configuration:
--------------
Your device communicates with the CS5460A over SPI so you need to have an :ref:`SPI bus <spi>` in
your configuration with the pin numbers set for the ``MOSI``, ``MISO`` and ``CLK`` lines. These
connect to the ``SDI``, ``SDO`` and ``SCLK`` pins on the CS5460A respectively. The ``CS``
(chip-select) pin of the CS5460A can be driven by any GPIO you have available or wired to ground
if the CS5460A is the only device connected to your device's SPI bus. The RESET pin can also be
driven by a GPIO or wired to VCC.
.. code-block:: yaml
# Example configuration entry
spi:
clk_pin: 18
mosi_pin: 23
miso_pin: 19
sensor:
- platform: cs5460a
current:
name: "Kitchen current (RMS)"
filters:
delta: 0.1
power:
name: "Kitchen power"
filters:
delta: 5
voltage:
name: "Mains voltage (RMS)"
filters:
delta: 5
samples: 1600
current_gain: 0.01
voltage_gain: 0.000573
pulse_energy: 1 Wh
cs_pin: 33
Configuration variables:
------------------------
- **current** (*Optional*): The sensor subcomponent that will report RMS current values in Amperes.
All options from :ref:`Sensor <config-sensor>`. See note below about throttling.
- **voltage** (*Optional*): The sensor subcomponent that will report RMS voltage values in Volts.
All options from :ref:`Sensor <config-sensor>`. See note below about throttling.
- **power** (*Optional*): The sensor subcomponent that will report the power readings in Watts.
All options from :ref:`Sensor <config-sensor>`. See note below about throttling.
- **samples** (*Optional*): The number of samples that go into each reading -- determines that
update interval of the sensors and the accuracy of the readings. This is the number N from the
CS5460A datasheet, defined as the number of *conversion cycles* within a *computation cycle*. The
component reports data at the end of each *computation cycle*. With the standard 4.096MHz clock
rate, each *conversion* takes 0.25ms so setting this to 2000 means 0.5s update interval, 40000
means 10s update interval and so on, similarly for other clock-rates. It is recommended that
the interval be an integer number of the mains AC cycles, so for the 50 Hz AC frequency countries
the interval should be a multiple of 20ms, for the 60 Hz countries a multiple of 16.66 ms.
Defaults to ``4000`` (1 second at 4.096MHz). Admits values from 1 to 16777215.
- **pga_gain** (*Optional*): If set to ``10X`` (default), the differential voltage at the current
inputs must be between -250mV and +250mV. If set to ``50X`` it must be within -100mV to +100mV.
- **current_gain** (*Optional*): Set this to the ratio of the differential voltage at the current
inputs (in Volts) vs. the actual line current to be calculated (in Amperes). When using a shunt
resistor as the current sensing element, this is going to simply equal the resistance since
the differential voltage is the line current multiplied by the resistance. When using a current
transformer, the value is going to be the burden resistor's value divided by the number of turns
of the transformer winding. For a 2000 turn current transformer clamp and a 2 Ohm burden
resistor this works out to 0.001 (the default if **current_gain** is not specified).
- **voltage_gain** (*Optional*): Set this to the ratio of the voltage at the voltage input pins
of CS5460A to the line voltage. When using a simple voltage divider, this is the divider's ratio.
When using a voltage transformer this is the secondary turns to primary turns ratio. When using a
current transformer (such as the ZMPT101B) this is equals
``(secondary turns * burden resistor value) / (primary turns * limiting resistor value)``, and
similarly for combiations of transfomers and voltage dividers. Defaults to ``0.001``. Must be
a positive number.
- **phase_offset** (*Optional*): This can be used to account for a phase offset between the voltage
sensing circuit and the current sensing circuit to improve power measurement accuracy. Admits
integer values between -64 to 63, which should be offset by 0.5 and multiplied by about 8.2
CS5460A clock intervals to get the resulting time offset. With the typical 4.096 MHz clocking
this scales to a range of -128 μs to 128 μs, or -2.3º to 2.3º phase offset at 50Hz and a -2.8º to
2.8º phase offset at 60Hz. Defaults to ``0`` (i.e. time offset of 4.1 MCLK cycles). An easy way
to find the correct value is to plug in a resisitve load such as an incandescent light-bulb and
find the ``phase_offset`` value that results in the highest power reported by the sensor.
- **pulse_energy** (*Optional*): Sets the energy (in Watt-hours) per individual pulse on the
CS5460A's EOUT pin that can be used to driver external counters / meters or a LED. The allowed
range depends on the gain parameters, defaults to ``10 Wh``.
- **current_hpf** (*Optional*): Enables and disables the High-pass Filter on the current processing
path in the CS5460A. Defaults to ``true`` (enabled).
- **voltage_hpf** (*Optional*): Enables and disables the High-pass Filter on the voltage processing
path in the CS5460A. Defaults to ``true`` (enabled).
.. note:: Negative values
Since the current and voltage values reported are the RMS values, they're absolute numbers
and are always positive. However the power measurement is signed depending on the direction
in which energy is being transmitted through the shunt resistor or the current transformer.
In other words if the sensor is installed between two circuits (e.g. the power grid and a
household) the sign informs which side is producing and which side is consuming energy in
the last *computation cycle*. If the power values are inverted compared to what you expect
to see, set a negative ``current_gain`` value.
.. note:: Throttling sensors
If ``samples`` is set to a low value, e.g. in the range of a few seconds per sample or
shorter, consider :ref:`filtering <sensor-filters>` the measurements if you have a Home
Assistant instance to avoid filling the logs with too much data. The ``throttle`` and
``sliding_window_moving_average`` filters are some options. Additionally the ``delta``
filter is almost always a good idea for all numeric sensors regardless of Home Assistant.
.. _cs5460a-restart_action:
``cs5460a.restart`` Action
---------------------------------
This action can be used in automations to interrupt the current *computation cycle* and start a
new one. This is useful if you're measuring multiple current/power values using a single
CS5460A chip and a signal multiplexer. As an example you can measure the power usage on up to
wall sockets in a house by using one voltage transformer and 16 current transformers, each on
the cable leading to the corresponding wall socket. One side of all the current transformers
connects directly to your CS5460A current input terminal (plus any filtering and protection
circuitry as recommended in the datasheet), while the other side each connects to one channel
of a CD74HC4067 analog multiplexer. The multiplexer's single signal pin then connects to the
CS5460A's second current input terminal. Every time the CS5460A sensor publishes a new power
value, an automation can switch the multiplexer to the next channel but it needs to interrupt
the *computation cycle* automatically started when the previous one ended, and start a new
cycle that uses current samples only from the new CD74HC4067 multiplexer channel.
See Also
--------
- :ref:`sensor-filters`
- :apiref:`cs5460a/cs5460a.h`
- :ghedit:`Edit`

View File

@ -16,6 +16,17 @@ states from your Home Assistant instance using the :doc:`native API </components
name: "Temperature Sensor From Home Assistant"
entity_id: sensor.temperature_sensor
With Home Assistant 2021.6 or newer, entity state attributes can also be imported.
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: homeassistant
id: current_temperature
entity_id: climate.living_room
attribute: current_temperature
.. note::
This component is only for numeral states. If you want to import arbitrary text states
@ -25,14 +36,14 @@ states from your Home Assistant instance using the :doc:`native API </components
in Home Assistant, this component still requires you to register the node under Home Assistant. See:
:doc:`Getting started with Home Assistant </guides/getting_started_hassio>`
Importing attributes is currently not supported, but you can create template sensors in Home Assistant
that return the attribute of a sensor and then import the template sensor here.
Configuration variables:
------------------------
- **name** (**Required**, string): The name of the sensor.
- **entity_id** (**Required**, string): The entity ID to import from Home Assistant.
- **attribute** (*Optional*, string): The name of the state attribute to import from the
specified entity. The entity state is used when this option is omitted.
Requires Home Assistant 2021.6 or newer.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Sensor <config-sensor>`.

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -28,6 +28,7 @@ override them if you want to.
unit_of_measurement: "°C"
icon: "mdi:water-percent"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 1
expire_after: 30s
filters:
@ -44,6 +45,9 @@ Configuration variables:
- **device_class** (*Optional*, string): The device class for the
sensor. See https://www.home-assistant.io/integrations/sensor/#device-class
for a list of available options. Set to ``""`` to remove the default device class of a sensor.
- **state_class** (*Optional*, string): The state class for the
sensor. See https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes
for a list of available options. Set to ``""`` to remove the default state class of a sensor.
- **icon** (*Optional*, icon): Manually set the icon to use for the sensor in the frontend. The icon set here
is ignored by Home Assistant, if a device class is already set.
- **accuracy_decimals** (*Optional*, int): Manually set the accuracy of decimals to use when reporting values.

View File

@ -5,7 +5,7 @@ Pulse Meter Sensor
:description: Instructions for setting up pulse meter sensors.
:image: pulse.png
The pulse meter sensor allows you to count the number and frequency of pulses on any pin. It is intended to be a drop-in replacement
The pulse meter sensor allows you to count the number and frequency of pulses on any pin. It is intended to be a drop-in replacement
for :doc:`integration sensor </components/sensor/pulse_counter>`, but offering better resolution.
It measures the time between rising edges on a pin, for each pulse it outputs the frequency in pulses/min.
@ -35,7 +35,7 @@ Converting units
The sensor defaults to units of “pulses/min”. You can change this by using :ref:`sensor-filters`.
For example, if youre using the pulse meter with a photodiode to
count the light pulses on a power meter that outputs 1000 pulses per kWh,
count the light pulses on a power meter that outputs 1000 pulses per kWh,
you can use the following to output instantaneous usage in kW:
.. code-block:: yaml
@ -52,9 +52,9 @@ you can use the following to output instantaneous usage in kW:
Counting total pulses
---------------------
When the total sensor is configured, pulse_meter also reports the total
number of pulses measured. When used on a power meter, this can be used to
measure the total consumed energy in kWh.
When the total sensor is configured, pulse_meter also reports the total
number of pulses measured. When used on a power meter, this can be used to
measure the total consumed energy in kWh.
.. code-block:: yaml
@ -73,6 +73,27 @@ measure the total consumed energy in kWh.
filters:
- multiply: 0.001
(Re)Setting the total pulse count
---------------------------------
Using this action, you are able to reset/set the total pulse count. This can be useful
if you would like the ``total`` sensor to match what you see on your meter you are
trying to match.
.. code-block:: yaml
on_...:
then:
- pulse_meter.set_total_pulses:
id: pulse_meter_id
value: 12345
.. note::
This value is the raw count of pulses, and not the value you see after the filters
are applied.
See Also
--------

View File

@ -0,0 +1,110 @@
Eastron SDM Energy Monitor
==========================
.. seo::
:description: Instructions for setting up SDM power monitors.
:image: images/sdm220m-full.png
:keywords: SDM220M, SDM220, SDM630
The ``sdm_meter`` sensor platform allows you to use Eastron SDM modbus energy monitors
(`website <http://www.eastrongroup.com/product_detail.php?id=170&menu1=&menu2=>`__)
with ESPHome.
.. figure:: images/sdm220m-full.png
:align: center
:width: 50.0%
SDM220M Energy Monitor.
The communication with this integration is done over a :ref:`UART bus <uart>` using :ref:`Modbus <modbus>`.
You must therefore have a ``uart:`` entry in your configuration with both the TX and RX pins set
to some pins on your board and the baud rate set to 9600.
.. code-block:: yaml
# Example configuration entry
uart:
rx_pin: D1
tx_pin: D2
baud_rate: 9600
stop_bits: 1
sensor:
- platform: sdm_meter
phase_a:
current:
name: "SDM220M Current"
voltage:
name: "SDM220M Voltage"
active_power:
name: "SDM220M Power"
power_factor:
name: "SDM220M Power Factor"
apparent_power:
name: "SDM220M Apparent Power"
reactive_power:
name: "SDM220M Reactive Power"
phase_angle:
name: "SDM220M Phase Angle"
frequency:
name: "SDM220M Frequency"
import_active_energy:
name: "SDM220M Import Active Energy"
export_active_energy:
name: "SDM220M Export Active Energy"
import_reactive_energy:
name: "SDM220M Import Reactive Energy"
export_reactive_energy:
name: "SDM220M Export Reactive Energy"
update_interval: 60s
Configuration variables:
------------------------
- **phase_a** (*Optional*): The group of exposed sensors for Phase A/1.
- **current** (*Optional*): Use the current value of the sensor in amperes. All options from
:ref:`Sensor <config-sensor>`.
- **voltage** (*Optional*): Use the voltage value of the sensor in volts.
All options from :ref:`Sensor <config-sensor>`.
- **active_power** (*Optional*): Use the (active) power value of the sensor in watts. All options
from :ref:`Sensor <config-sensor>`.
- **power_factor** (*Optional*): Use the power factor value of the sensor.
All options from :ref:`Sensor <config-sensor>`.
- **apparent_power** (*Optional*): Use the apparent power value of the sensor in VA. All
options from :ref:`Sensor <config-sensor>`.
- **reactive_power** (*Optional*): Use the reactive power value of the sensor in VAR. All
options from :ref:`Sensor <config-sensor>`.
- **phase_angle** (*Optional*): Use the phase angle value of the sensor in degree. All options
from :ref:`Sensor <config-sensor>`.
- **phase_b** (*Optional*): The group of exposed sensors for Phase B/2 on applicable meters. eg: SDM630
- All options from **phase_a**
- **phase_c** (*Optional*): The group of exposed sensors for Phase C/3 on applicable meters. eg: SDM630
- All options from **phase_a**
- **frequency** (*Optional*): Use the frequency value of the sensor in hertz.
All options from :ref:`Sensor <config-sensor>`.
- **import_active_energy** (*Optional*): Use the import active energy value of the sensor in watt
hours. All options from :ref:`Sensor <config-sensor>`.
- **export_active_energy** (*Optional*): Use the export active energy value of the sensor in watt
hours. All options from :ref:`Sensor <config-sensor>`.
- **import_reactive_energy** (*Optional*): Use the import reactive energy value of the sensor in
volt amps reactive hours. All options from :ref:`Sensor <config-sensor>`.
- **export_reactive_energy** (*Optional*): Use the export reactive energy value of the sensor in
volt amps reactive hours. All options from :ref:`Sensor <config-sensor>`.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
- **address** (*Optional*, int): The address of the sensor if multiple sensors are attached to
the same UART bus. You will need to set the address of each device manually. Defaults to ``1``.
See Also
--------
- :ref:`sensor-filters`
- :apiref:`sdm220m/sdm220m.h`
- :ghedit:`Edit`

View File

@ -1,5 +1,5 @@
SHT4X Temperature and Humidity Sensor
==================================================
=====================================
.. seo::
:description: Instructions for setting up SHT4X temperature and humidity sensor
@ -28,15 +28,24 @@ The :ref:`I²C Bus <i2c>` is required to be set up in your configuration for thi
Configuration variables:
------------------------
- **temperature** (**Optional**): Temperature. All other options from :ref:`Sensor <config-sensor>`.
- **humidity** (**Optional**): Relative Humidity. All other options from :ref:`Sensor <config-sensor>`.
- **temperature** (*Optional*): Temperature.
- **precision** (**Optional**, string): The measurement precision, either ``"High"``, ``"Med"`` or ``"Low"``. Default is ``"High"``.
- **heater_max_duty** (**Optional**, float): The maximum duty cycle of the heater (limited to ``0.05``). Default is ``0.0`` i.e. heater off.
- **heater_power** (**Optional**, string): The heater power, either ``"High"``, ``"Med"`` or ``"Low"``. Default is ``"High"``.
- **heater_time** (**Optional**, string): The length of time to run the heater, either ``"Long"`` (``1000ms``) or ``"Short"`` (``100ms``). Default is ``"Long"``.
- **address** (**Optional**, int): Manually specify the I²C address of the sensor. Default is ``0x44``.
- **update_interval** (**Optional**, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``.
- **name** (**Required**, string): The name of the sensor.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Sensor <config-sensor>`.
- **humidity** (*Optional*): Relative Humidity.
- **name** (**Required**, string): The name of the sensor.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Sensor <config-sensor>`.
- **precision** (*Optional*, string): The measurement precision, either ``High``, ``Med`` or ``Low``. Default is ``High``.
- **heater_max_duty** (*Optional*, float): The maximum duty cycle of the heater (limited to ``0.05``). Default is ``0.0``, i.e. heater off.
- **heater_power** (*Optional*, string): The heater power, either ``High``, ``Med`` or ``Low``. Default is ``High``.
- **heater_time** (*Optional*, string): The length of time to run the heater, either ``Long`` (1000ms) or ``Short`` (100ms). Default is ``Long``.
- **address** (*Optional*, int): Manually specify the I²C address of the sensor. Default is ``0x44``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``.
Heater Configuration:
---------------------

View File

@ -57,35 +57,42 @@ simply press -/+ buttons on the counter and look for `Standard mode` or
parity: EVEN
data_bits: 7
teleinfo:
id: myteleinfo
update_interval: 60s
historical_mode: true
sensor:
- platform: teleinfo
tags:
- name: "HCHC"
sensor:
name: "hchc"
unit_of_measurement: "Wh"
icon: mdi:flash
- name: "HCHP"
sensor:
name: "hchp"
unit_of_measurement: "Wh"
icon: mdi:flash
- name: "PAPP"
sensor:
name: "papp"
unit_of_measurement: "VA"
icon: mdi:flash
update_interval: 60s
historical_mode: true
tag_name: "HCHC"
name: "hchc"
unit_of_measurement: "Wh"
icon: mdi:flash
teleinfo_id: myteleinfo
- platform: teleinfo
tag_name: "HCHP"
name: "hchp"
unit_of_measurement: "Wh"
icon: mdi:flash
teleinfo_id: myteleinfo
- platform: teleinfo
tag_name: "PAPP"
name: "papp"
unit_of_measurement: "VA"
icon: mdi:flash
teleinfo_id: myteleinfo
text_sensor:
- platform: teleinfo
tag_name: "OPTARIF"
name: "optarif"
teleinfo_id: myteleinfo
Configuration variables:
------------------------
- **tags** (**Required**): Specify the tag you want to retrieve from the Teleinformation and select with what name to transmit it.
- **name** (**Required**, string): The name of the tag corresponding to what the electrical counter send.
- **sensor** (**Required**, :ref:`Sensor <config-sensor>`): Associate a sensor with the tag. See options from :ref:`Sensor <config-sensor>`.
In teleinfo platform:
- **historical_mode** (*Optional*): Wether to use historical mode or standard mode.
With historical mode, baudrate of 1200 must be used whereas 9600 must be used in
@ -97,6 +104,21 @@ Configuration variables:
- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component <uart>` if you want
to use multiple UART buses.
Sensor
******
- **tag_name** (**Required**, string): Specify the tag you want to retrieve from the Teleinformation.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Sensor <config-sensor>`.
Text Sensor
***********
- **tag_name** (**Required**, string): Specify the tag you want to retrieve from the Teleinformation.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Text Sensor <config-text_sensor>`.
See Also
--------

View File

@ -267,6 +267,31 @@ Configuration example:
battery_level:
name: "CGD1 Battery Level"
CGDK2
*****
Cleargrass (Qingping) Temp & RH Lite, round body, segment LCD, encrypted, broadcasts temperature, humidity and battery status. Requires a bindkey in order to decrypt the received data (see :ref:`obtaining_the_bindkey`).
The measurements are broadcast every 10-15 minutes.
.. figure:: images/xiaomi_cgdk2.jpg
:align: center
:width: 30.0%
Configuration example:
.. code-block:: yaml
sensor:
- platform: xiaomi_cgdk2
mac_address: "58:2D:34:11:34:B7"
bindkey: "fe39106baeedb7c801e3d63c4396f97e"
temperature:
name: "CGDK2 Temperature"
humidity:
name: "CGDK2 Humidity"
battery_level:
name: "CGDK2 Battery Level"
JQJCY01YM
*********
@ -422,6 +447,13 @@ If the LYWSD03MMC sensor is operated with the Xiaomi stock firmware, you can use
The new bind key will work with ESPHome, but the Mi Home app will not recognise the sensor anymore once the device has been activated by the TeLink flasher application. To use the sensor again with the Xiaomi Mi Home app, the device needs to be removed and then re-added inside the Mi Home app.
CGDK2
*****
The method to obtain a new bind key for the CGDK2 sensor is similar to the method for the LYWSD03MMC sensor, except a modified version of the flasher application is used.
For this, you load the `application <https://zaluthar.github.io/TelinkFlasher.html>`__ with a `supported browser <https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md>`__ and connect the device by pressing "Connect". After the connection is established, you press the "Do Activation" button and the new key will be shown in the "Mi Bind Key" field. The key can be copied directly into the sensor YAML configuration.
Other encrypted devices
***********************
@ -452,5 +484,6 @@ See Also
- Xiaomi LYWSD03MMC passive sensor readout `<https://github.com/ahpohl/xiaomi_lywsd03mmc>`__ by `@ahpohl <https://github.com/ahpohl>`__
- Custom firmware for the Xiaomi Thermometer LYWSD03MMC `<https://github.com/atc1441/ATC_MiThermometer>`__
- TeLink flasher application `<https://atc1441.github.io/TelinkFlasher.html>`__
- TeLink flasher application modified for CGDK2 `<https://zaluthar.github.io/TelinkFlasher.html>`__
- :ghedit:`Edit`

View File

@ -1,12 +1,12 @@
BLE Switch
==========
BLE Client Switch
=================
.. seo::
:description: Control the state of BLE clients.
:image: bluetooth.svg
The ``ble_switch`` component is a switch platform that is used to enable
and disable a ``ble_client``. This has several uses, such as minimising
The ``ble_client`` component is a switch platform that is used to enable
and disable a ``ble_client``. This has several uses, such as minimizing
battery usage or for allowing other clients (Eg phone apps) to connect to
the device.
@ -30,7 +30,7 @@ Configuration variables:
------------------------
- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client.
- **id** (**Optional**, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
- **id** (*Optional*, :ref:`config-id`): The ID to use for code generation, and for reference by dependent components.
- All other options from :ref:`Switch <config-switch>`.
See Also

View File

@ -34,6 +34,8 @@ Configuration variables:
- ``RESTORE_DEFAULT_OFF`` (Default) - Attempt to restore state and default to OFF if not possible to restore.
- ``RESTORE_DEFAULT_ON`` - Attempt to restore state and default to ON.
- ``RESTORE_INVERTED_OFF`` - Attempt to restore state inverted from the previous state and default to OFF.
- ``RESTORE_INVERTED_ON`` - Attempt to restore state inverted from the previous state and default to ON.
- ``ALWAYS_OFF`` - Always initialize the pin as OFF on bootup.
- ``ALWAYS_ON`` - Always initialize the pin as ON on bootup.

View File

@ -16,11 +16,25 @@ states from your Home Assistant instance using the :doc:`native API </components
name: "Weather Forecast From Home Assistant"
entity_id: sensor.weather_forecast
With Home Assistant 2021.6 or newer, entity state attributes can also be imported.
.. code-block:: yaml
# Example configuration entry
text_sensor:
- platform: homeassistant
id: effect
entity_id: light.led_strip
attribute: effect
Configuration variables:
------------------------
- **name** (**Required**, string): The name of the text sensor.
- **entity_id** (**Required**, string): The entity ID to import from Home Assistant.
- **attribute** (*Optional*, string): The name of the state attribute to import from the
specified entity. The entity state is used when this option is omitted.
Requires Home Assistant 2021.6 or newer.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Text Sensor <config-text_sensor>`.

View File

@ -67,9 +67,9 @@ author = "Otto Winter"
# built documents.
#
# The short X.Y version.
version = "1.18"
version = "1.19"
# The full version, including alpha/beta/rc tags.
release = "1.18.0"
release = "1.19.0"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -110,5 +110,5 @@ See Also
--------
- :doc:`/components/ble_client`
- :doc:`/components/sensor/ble_sensor`
- :doc:`/components/sensor/ble_client`
- :ghedit:`Edit`

0
devices/images/sonoff_t1_uk_3g_backplate_v1.1.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 296 KiB

After

Width:  |  Height:  |  Size: 296 KiB

0
devices/images/sonoff_t1_uk_3g_touchpads_v1.1.jpg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 426 KiB

After

Width:  |  Height:  |  Size: 426 KiB

View File

@ -375,6 +375,7 @@ All Actions
- :ref:`rf_bridge.send_code <rf_bridge-send_code_action>`
- :ref:`rf_bridge.learn <rf_bridge-learn_action>`
- :ref:`ds1307.read_time <ds1307-read_time_action>` / :ref:`ds1307.write_time <ds1307-write_time_action>`
- :ref:`cs5460a.restart <cs5460a-restart_action>`
.. _config-condition:

View File

@ -11,16 +11,16 @@ ESPHome's command line interface always has the following format
.. code-block:: console
esphome [OPTIONS] <CONFIGURATION...> <COMMAND> [ARGUMENTS]
esphome [OPTIONS] <COMMAND> <CONFIGURATION...> [ARGUMENTS]
.. note::
You can specify multiple configuration files in the command line interface,
just list all files in front of the <COMMAND> like so:
You can specify multiple configuration files in the command line interface for some commands,
just list all files after the <COMMAND> like so:
.. code-block:: console
esphome livingroom.yaml kitchen.yaml run
esphome run livingroom.yaml kitchen.yaml
``--help`` Option
--------------------
@ -61,7 +61,7 @@ Please see :ref:`command line substitutions <command-line-substitutions>` for de
``run`` Command
---------------
The ``esphome <CONFIG> run`` command is the most common command for ESPHome. It
The ``esphome run <CONFIG>`` command is the most common command for ESPHome. It
* Validates the configuration
* Compiles a firmware
@ -70,9 +70,10 @@ The ``esphome <CONFIG> run`` command is the most common command for ESPHome. It
.. program:: esphome run
.. option:: --upload-port UPLOAD_PORT
.. option:: --device UPLOAD_PORT
Manually specify the upload port/ip to use. For example ``/dev/cu.SLAB_USBtoUART``.
Manually specify the upload port/IP to use. For example ``/dev/cu.SLAB_USBtoUART``, or ``192.168.1.176``
to perform an OTA.
.. option:: --no-logs
@ -103,7 +104,7 @@ The ``esphome <CONFIG> run`` command is the most common command for ESPHome. It
.. program:: esphome config
The ``esphome <CONFIG> config`` validates the configuration and displays the validation result.
The ``esphome config <CONFIG>`` validates the configuration and displays the validation result.
``compile`` Command
@ -111,7 +112,7 @@ The ``esphome <CONFIG> config`` validates the configuration and displays the val
.. program:: esphome compile
The ``esphome <CONFIG> compile`` validates the configuration and compiles the firmware.
The ``esphome compile <CONFIG>`` validates the configuration and compiles the firmware.
.. option:: --only-generate
@ -122,11 +123,12 @@ The ``esphome <CONFIG> compile`` validates the configuration and compiles the fi
.. program:: esphome upload
The ``esphome <CONFIG> upload`` validates the configuration and uploads the most recent firmware build.
The ``esphome upload <CONFIG>`` validates the configuration and uploads the most recent firmware build.
.. option:: --upload-port UPLOAD_PORT
.. option:: --device UPLOAD_PORT
Manually specify the upload port/IP to use. For example ``/dev/cu.SLAB_USBtoUART``.
Manually specify the upload port/IP address to use. For example ``/dev/cu.SLAB_USBtoUART``, or ``192.168.1.176``
to perform an OTA.
.. option:: --host-port HOST_PORT
@ -137,7 +139,7 @@ The ``esphome <CONFIG> upload`` validates the configuration and uploads the most
.. program:: esphome clean-mqtt
The ``esphome <CONFIG> clean-mqtt`` cleans retained MQTT discovery messages from the MQTT broker.
The ``esphome clean-mqtt <CONFIG>`` cleans retained MQTT discovery messages from the MQTT broker.
See :ref:`mqtt-using_with_home_assistant`.
.. option:: --topic TOPIC
@ -162,14 +164,14 @@ See :ref:`mqtt-using_with_home_assistant`.
.. program:: esphome wizard
The ``esphome <CONFIG> wizard`` command starts the ESPHome configuration creation wizard.
The ``esphome wizard <CONFIG>`` command starts the ESPHome configuration creation wizard.
``mqtt-fingerprint`` Command
----------------------------
.. program:: esphome mqtt-fingerprint
The ``esphome <CONFIG> mqtt-fingerprint`` command shows the MQTT SSL fingerprints of the remote used
The ``esphome mqtt-fingerprint <CONFIG>`` command shows the MQTT SSL fingerprints of the remote used
for SSL MQTT connections. See :ref:`mqtt-ssl_fingerprints`.
``version`` Command
@ -177,30 +179,23 @@ for SSL MQTT connections. See :ref:`mqtt-ssl_fingerprints`.
.. program:: esphome version
The ``esphome <CONFIG> version`` command shows the current ESPHome version and exits.
The ``esphome version`` command shows the current ESPHome version and exits.
``clean`` Command
-----------------
.. program:: esphome clean
The ``esphome <CONFIG> clean`` command cleans all build files and can help with some build issues.
``hass-config`` Command
-----------------------
.. program:: esphome hass-config
The ``esphome <CONFIG> hass-config`` command shows an auto-generated Home Assistant configuration for the ESPHome
node configuration file. This is useful if you're not using MQTT discovery.
The ``esphome clean <CONFIG>`` command cleans all build files and can help with some build issues.
``dashboard`` Command
---------------------
.. program:: esphome dashboard
The ``esphome <CONFIG> dashboard`` command starts the ESPHome dashboard server for using ESPHome
through a graphical user interface.
The ``esphome dashboard <CONFIG>`` command starts the ESPHome dashboard server for using ESPHome
through a graphical user interface. This command accepts a configuration directory instead of a
single configuration file.
.. option:: --port PORT
@ -223,7 +218,7 @@ through a graphical user interface.
.. program:: esphome logs
The ``esphome <CONFIG> logs`` command validates the configuration and shows all logs.
The ``esphome logs <CONFIG>`` command validates the configuration and shows all logs.
.. option:: --topic TOPIC
@ -241,7 +236,7 @@ The ``esphome <CONFIG> logs`` command validates the configuration and shows all
Manually set the client id.
.. option:: --serial-port SERIAL_PORT
.. option:: --device SERIAL_PORT
Manually specify a serial port to use. For example ``/dev/cu.SLAB_USBtoUART``.
Manually specify a serial port/IP to use. For example ``/dev/cu.SLAB_USBtoUART``.

57
guides/creators.rst Normal file
View File

@ -0,0 +1,57 @@
Using ESPHome for your Project
==============================
.. seo::
:description: Information for creators when using ESPHome firmware.
We have added configuration options to ESPHome to make it easier for creators
to create, configure, install and distribute devices running ESPHome.
Example configuration
---------------------
.. code-block:: yaml
esphome:
...
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true
# This will allow for (future) project identification,
# configuration and updates.
project:
name: jesse.temperature_monitor
version: "1.0"
wifi:
# Set up a wifi access point
ap:
ssid: jesses_temperature_monitor
password: 12345678
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:
# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none
Relevant Documentation
----------------------
- ``name_add_mac_suffix`` - :ref:`esphome-mac_suffix`
- ``project`` - :ref:`esphome-creators_project`
- ``esp32_improv`` - :doc:`/components/esp32_improv`
- ``captive_portal`` - :doc:`/components/captive_portal`
- ``wifi`` -> ``networks: []`` allows you to flash a device that will not contain any
credentials and they must be set by the user via either the ``ap`` + ``captive_portal`` or
the ``esp32_improv`` components.
See Also
--------
- :ghedit:`Edit`

View File

@ -19,13 +19,13 @@ Tips for using ESPHome
.. code-block:: bash
esphome livingroom.yaml config
esphome config livingroom.yaml
3. To view the logs from your node without uploading, run
.. code-block:: bash
esphome livingroom.yaml logs
esphome logs livingroom.yaml
4. You can always find the source ESPHome generates under ``<NODE_NAME>/src/``.
@ -143,7 +143,7 @@ by installing the tested beta:
pip3 install --pre -U esphome
# For docker-based installs
docker run [...] -it esphome/esphome:beta livingroom.yaml run
docker run [...] -it esphome/esphome:beta run livingroom.yaml
For Home Assistant supervised installs add the community addons beta repository by
adding
@ -260,13 +260,13 @@ Command reference:
.. code-block:: bash
# Start a new file wizard for file livingroom.yaml
docker run --rm -v "${PWD}":/config -it esphome/esphome livingroom.yaml wizard
docker run --rm -v "${PWD}":/config -it esphome/esphome wizard livingroom.yaml
# Compile and upload livingroom.yaml
docker run --rm -v "${PWD}":/config -it esphome/esphome livingroom.yaml run
docker run --rm -v "${PWD}":/config -it esphome/esphome run livingroom.yaml
# View logs
docker run --rm -v "${PWD}":/config -it esphome/esphome livingroom.yaml logs
docker run --rm -v "${PWD}":/config -it esphome/esphome logs livingroom.yaml
# Map /dev/ttyUSB0 into container
docker run --rm -v "${PWD}":/config --device=/dev/ttyUSB0 -it esphome/esphome ...

View File

@ -40,7 +40,7 @@ file called ``livingroom.yaml``:
esphome livingroom.yaml wizard
# On Docker:
docker run --rm -v "${PWD}":/config -it esphome/esphome livingroom.yaml wizard
docker run --rm -v "${PWD}":/config -it esphome/esphome wizard livingroom.yaml
At the end of this step, you will have your first YAML configuration
file ready. It doesn't do much yet and only makes your device connect to
@ -80,7 +80,7 @@ the device via USB and type the following command (replacing
.. code-block:: bash
esphome livingroom.yaml run
esphome run livingroom.yaml
You should see ESPHome validating the configuration and telling you
about potential problems. Then ESPHome will proceed to compile and
@ -93,7 +93,7 @@ to your docker command to map a local USB device.
.. code-block:: bash
docker run --rm -v "${PWD}":/config --device=/dev/ttyUSB0 -it esphome/esphome livingroom.yaml run
docker run --rm -v "${PWD}":/config --device=/dev/ttyUSB0 -it esphome/esphome run livingroom.yaml
Now when you go to the Home Assistant "Integrations" screen (under "Configuration" panel), you
should see the ESPHome device show up in the discovered section (although this can take up to 5 minutes).
@ -137,7 +137,7 @@ for docker you need to supply an additional parameter:
esphome livingroom.yaml run
# On docker
docker run --rm -v "${PWD}":/config -it esphome/esphome livingroom.yaml run
docker run --rm -v "${PWD}":/config -it esphome/esphome run livingroom.yaml
.. figure:: /components/binary_sensor/images/gpio-ui.png
@ -170,7 +170,7 @@ To start the ESPHome dashboard, simply start ESPHome with the following command
# Install dashboard dependencies
pip install tornado esptool
esphome config/ dashboard
esphome dashboard config/
# On Docker, host networking mode is required for online status indicators
docker run --rm --net=host -v "${PWD}":/config -it esphome/esphome

View File

@ -2,36 +2,26 @@ Getting Started with ESPHome and Home Assistant
===============================================
.. seo::
:description: Getting Started guide for installing ESPHome as a Home Assistant add-on and creating a basic configuration.
:description: Getting Started guide for installing ESPHome Dashboard as a Home Assistant add-on and creating a basic configuration.
:image: home-assistant.png
ESPHome is the perfect solution for creating custom firmware for
your ESP8266/ESP32 boards. In this guide well go through how to setup a
basic "node" by use of the Home Assistant add-on.
basic "node" using the ESPHome Dashboard, installed as a Home Assistant add-on.
But first, here's a very quick introduction to how ESPHome works:
ESPHome is a *tool* which reads in a YAML configuration file (just like Home Assistant)
and creates a custom firmware binary. The tool also has many helpers that simplify flashing devices (uploading the new binary file)
and aim to make managing your ESP boards as simple as possible. Once you have added devices
or sensors in ESPHome's configuration, they will even automatically show up in Home
Assistant's UI.
ESPHome is a *tool* which aims to make managing your ESP boards as simple as possible. It reads in a YAML configuration file (just like Home Assistant) and creates custom firmware which it installs on your ESP device. Devices or sensors added in ESPHome's configuration will automatically show up in Home Assistant's UI.
Installation
------------
Installing ESPHome Dashboard
----------------------------
Installing the ESPHome Home Assistant add-on is easy. Navigate to the Supervisor
panel in your Home Assistant frontend, then enter ``ESPHome`` in the searchbar of the "Add-on Store"
tab.
The ESPHome Dashboard can be installed as a Home Assistant add-on, which you can find in the add-on store in the Supervisor panel. Open it using the following button then click on INSTALL:
.. figure:: images/hassio_repo.png
.. raw:: html
Click on ESPHome, then INSTALL.
<a href="https://my.home-assistant.io/redirect/supervisor_addon/?addon=a0d7b954_esphome" target="_blank"><img src="https://my.home-assistant.io/badges/supervisor_addon.svg" alt="Open your Home Assistant instance and show the dashboard of a Supervisor add-on." /></a>
.. figure:: images/hassio_addons_section.png
After that, wait a bit until the add-on is installed (this can take a while) and
go to the add-on page. Start the add-on and then click "Open Web UI". If you see "502: Bad Gateway" the
addon is currently starting, and you can refresh the page after a couple of seconds.
After that, wait a bit until it is installed (this can take a while). Click "Start" and then click "Open Web UI". If you see "502: Bad Gateway" it is currently starting, and you can refresh the page after a couple of seconds.
.. figure:: images/hassio_addon.png
:align: center
@ -44,11 +34,32 @@ creating your first configuration.
: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.
.. raw:: html
<a name='webserial'></a>
.. 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.
If you use `Microsoft Edge <https://www.microsoft.com/edge>`_ or `Google Chrome <https://www.google.com/chrome>`_, you will be able to install the initial configuration by connecting your ESP device to the computer that you're using to view the ESPHome Dashboard.
*You need to access the ESPHome Dashboard over HTTPS for this to work. This is a requirement of browsers to access your ESP device to ensure that we write the correct data.*
If you use another browser, you will have to connect the ESP devices to the machine running the ESPHome Dashboard and Home Assistant.
If the serial port is not showing up, you might not have the required drivers installed. These drivers work for most ESP devices:
* CP2102 (square chip): `driver <https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers>`__
* CH341: `driver <https://github.com/nodemcu/nodemcu-devkit/tree/master/Drivers>`__
Dashboard Interface
-------------------
Assuming you created your first configuration file with the wizard, let's take a quick
tour of the ESPHome dashboard interface.
tour of the ESPHome Dashboard interface.
.. figure:: images/dashboard.png
:align: center
@ -57,34 +68,19 @@ tour of the ESPHome dashboard interface.
On the front page you will see all configurations for nodes you created. For each file,
there are three basic actions you can perform:
- **UPLOAD**: This compiles the firmware for your node and uploads it using any connected
USB device or, if no USB devices are connected, over-the-air using the :doc:`/components/ota`.
.. warning::
The Home Assistant add-on is currently not capable of discovering new USB ports after the
add-on has started due to some docker restrictions. Please go to the add-on details page
and restart the add-on if a new USB device is not automatically found. If the USB device
is still not found, try changing the USB cable and restarting the add-on.
- **INSTALL**: This compiles the firmware for your node and installs it. Installation happens wirelessy if you have enabled the :doc:`/components/ota` in your configuration. Alternatively you can install it from your browser or via a device connected to the machine running the ESPHome Dashboard.
- **SHOW LOGS**: With this command you can view all the logs the node is outputting. If a USB device is
connected, it will attempt to use the serial connection. Otherwise it will use the built-in OTA logs.
- **COMPILE**: This command compiles the firmware and gives you the option of downloading the generated
binary so that you can upload it yourself from your computer.
.. note::
If you're having problems with flashing over USB, you can always download the firmware using the
``COMPILE`` button and flash the firmware using :ref:`ESPHome-flasher <esphome-flasher>`.
binary so that you can install it yourself from your computer using :ref:`ESPHome-flasher <esphome-flasher>`.
The configuration files for ESPHome can be found and edited under ``<HOME_ASSISTANT_CONFIG>/esphome/``.
For example the configuration for the node in the picture above can be found
in ``/config/esphome/livingroom.yaml``.
Now go ahead and use one of the :ref:`devices guides <devices>` to extend your configuration for the device you
intend to flash an ESPHome firmware onto. Then proceed with uploading the first firmware using the
upload button.
Now go ahead and use one of the :ref:`devices guides <devices>` to extend your configuration.
Adding some (basic) features
----------------------------
@ -106,8 +102,12 @@ anything really, for example lights) and is connected to the pin ``GPIO5``.
Connecting your device to Home Assistant
----------------------------------------
Now when you go to the Home Assistant "Integrations" screen (under "Configuration" panel), you
should see the ESPHome device show up in the discovered section (although this can take up to 5 minutes).
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 by clicking "CONFIGURE" on the ESPHome integration
and entering "<NODE_NAME>.local" as the host.
@ -115,9 +115,8 @@ and entering "<NODE_NAME>.local" as the host.
:align: center
:width: 75.0%
After the first upload, you will probably never need to use the USB
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.
No more opening hidden boxes stowed in places hard to reach. Yay!
Adding A Binary Sensor
----------------------
@ -136,12 +135,8 @@ Sensor </components/binary_sensor/gpio>`.
inverted: True
mode: INPUT_PULLUP
This is an advanced feature of ESPHome, almost all pins can
optionally have a more complicated configuration schema with options for
inversion and pinMode - the :ref:`Pin Schema <config-pin_schema>`.
This time when uploading, you dont need to have the device plugged in
through USB again. The upload will magically happen :doc:`"over the air" </components/ota>`.
This time when installing, you dont need to have the device plugged in
through USB again. The upload will happen wirelessly (:doc:`"over the air" </components/ota>`).
.. figure:: /components/binary_sensor/images/gpio-ui.png
:align: center
@ -151,7 +146,7 @@ Where To Go Next
----------------
Great 🎉! Youve now successfully setup your first ESPHome project
and uploaded your first ESPHome custom firmware to your node. Youve
and installed your first ESPHome custom firmware to your node. Youve
also learned how to enable some basic components via the configuration
file.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@ -40,6 +40,7 @@ Contributors
- `Andrej Komelj (@akomelj) <https://github.com/akomelj>`__
- `Alex Konradi (@akonradi) <https://github.com/akonradi>`__
- `Alone (@al-one) <https://github.com/al-one>`__
- `Albin Kauffmann (@albinou) <https://github.com/albinou>`__
- `Alex (@alex-richards) <https://github.com/alex-richards>`__
- `Alexander Leisentritt (@Alex9779) <https://github.com/Alex9779>`__
- `Alexandre Danault (@AlexDanault) <https://github.com/AlexDanault>`__
@ -130,6 +131,7 @@ Contributors
- `Christiaan Blom (@Deinara) <https://github.com/Deinara>`__
- `Rsan (@deltazerorsan) <https://github.com/deltazerorsan>`__
- `Mickaël Le Baillif (@demikl) <https://github.com/demikl>`__
- `dentra (@dentra) <https://github.com/dentra>`__
- `dependabot[bot] (@dependabot[bot]) <https://github.com/dependabot[bot]>`__
- `Destix (@Destix) <https://github.com/Destix>`__
- `Dezorian (@Dezorian) <https://github.com/Dezorian>`__
@ -168,6 +170,7 @@ Contributors
- `Emory Dunn (@emorydunn) <https://github.com/emorydunn>`__
- `Eric Muehlstein (@emuehlstein) <https://github.com/emuehlstein>`__
- `Anders Persson (@emwap) <https://github.com/emwap>`__
- `Bert (@Engelbert) <https://github.com/Engelbert>`__
- `Nico Weichbrodt (@envy) <https://github.com/envy>`__
- `Evan Petousis (@epetousis) <https://github.com/epetousis>`__
- `Wilhelm Erasmus (@erasmuswill) <https://github.com/erasmuswill>`__
@ -199,6 +202,7 @@ Contributors
- `Gabe Cook (@gabe565) <https://github.com/gabe565>`__
- `Gareth Cooper (@gaco79) <https://github.com/gaco79>`__
- `galagaking (@galagaking) <https://github.com/galagaking>`__
- `GeekVisit (@GeekVisit) <https://github.com/GeekVisit>`__
- `Geoff Davis (@geoffdavis) <https://github.com/geoffdavis>`__
- `Gerard (@gerard33) <https://github.com/gerard33>`__
- `Giovanni (@Gio-dot) <https://github.com/Gio-dot>`__
@ -210,6 +214,7 @@ Contributors
- `Jelle Raaijmakers (@GMTA) <https://github.com/GMTA>`__
- `gordon-zhao (@gordon-zhao) <https://github.com/gordon-zhao>`__
- `Antoine GRÉA (@grea09) <https://github.com/grea09>`__
- `Andrea (@Guglio95) <https://github.com/Guglio95>`__
- `Guillaume DELVIT (@guiguid) <https://github.com/guiguid>`__
- `guptamp (@guptamp) <https://github.com/guptamp>`__
- `Guyohms (@Guyohms) <https://github.com/Guyohms>`__
@ -223,12 +228,14 @@ Contributors
- `HepoH3 (@HepoH3) <https://github.com/HepoH3>`__
- `Hamish Moffatt (@hmoffatt) <https://github.com/hmoffatt>`__
- `MoA (@honomoa) <https://github.com/honomoa>`__
- `Petr Urbánek (@HyperReap) <https://github.com/HyperReap>`__
- `Adrián Panella (@ianchi) <https://github.com/ianchi>`__
- `Ian Leeder (@ianleeder) <https://github.com/ianleeder>`__
- `icarome (@icarome) <https://github.com/icarome>`__
- `igg (@igg) <https://github.com/igg>`__
- `ikatkov (@ikatkov) <https://github.com/ikatkov>`__
- `Michael (@imeekle) <https://github.com/imeekle>`__
- `imgbot[bot] (@imgbot[bot]) <https://github.com/imgbot[bot]>`__
- `Lorenzo Ortiz (@Infinitte) <https://github.com/Infinitte>`__
- `Ivan Shvedunov (@ivan4th) <https://github.com/ivan4th>`__
- `Ivan Kravets (@ivankravets) <https://github.com/ivankravets>`__
@ -245,6 +252,7 @@ Contributors
- `jeff-h (@jeff-h) <https://github.com/jeff-h>`__
- `Jeff Rescignano (@JeffResc) <https://github.com/JeffResc>`__
- `Jesse Hills (@jesserockz) <https://github.com/jesserockz>`__
- `Jim Bauwens (@jimbauwens) <https://github.com/jimbauwens>`__
- `Jérémy JOURDIN (@JJK801) <https://github.com/JJK801>`__
- `Jonathan Jefferies (@jjok) <https://github.com/jjok>`__
- `Justin Maxwell (@jkmaxwell) <https://github.com/jkmaxwell>`__
@ -343,6 +351,7 @@ Contributors
- `Pauline Middelink (@middelink) <https://github.com/middelink>`__
- `mikosoft83 (@mikosoft83) <https://github.com/mikosoft83>`__
- `Minideezel (@minideezel) <https://github.com/minideezel>`__
- `mipa87 (@mipa87) <https://github.com/mipa87>`__
- `André Klitzing (@misery) <https://github.com/misery>`__
- `Matthew Edwards (@mje-nz) <https://github.com/mje-nz>`__
- `Maarten (@mjkl-gh) <https://github.com/mjkl-gh>`__
@ -385,6 +394,7 @@ Contributors
- `Nuno Sousa (@nunofgs) <https://github.com/nunofgs>`__
- `Chris Nussbaum (@nuttytree) <https://github.com/nuttytree>`__
- `obrain17 (@obrain17) <https://github.com/obrain17>`__
- `Ockert Marais (@OckertM) <https://github.com/OckertM>`__
- `Dave Walker (@oddsockmachine) <https://github.com/oddsockmachine>`__
- `Olivér Falvai (@ofalvai) <https://github.com/ofalvai>`__
- `Omar Ghader (@omarghader) <https://github.com/omarghader>`__
@ -393,6 +403,7 @@ Contributors
- `Oscar Bolmsten (@oscar-b) <https://github.com/oscar-b>`__
- `Otamay (@Otamay) <https://github.com/Otamay>`__
- `Otto Winter (@OttoWinter) <https://github.com/OttoWinter>`__
- `Oxan van Leeuwen (@oxan) <https://github.com/oxan>`__
- `Pack3tL0ss (@Pack3tL0ss) <https://github.com/Pack3tL0ss>`__
- `Panuruj Khambanonda (PK) (@panuruj) <https://github.com/panuruj>`__
- `Paul Deen (@PaulAntonDeen) <https://github.com/PaulAntonDeen>`__
@ -411,6 +422,7 @@ Contributors
- `Plácido Revilla (@placidorevilla) <https://github.com/placidorevilla>`__
- `Marcus Kempe (@plopp) <https://github.com/plopp>`__
- `DK (@poldim) <https://github.com/poldim>`__
- `polyfaces (@polyfaces) <https://github.com/polyfaces>`__
- `Iván Povedano (@pove) <https://github.com/pove>`__
- `Peter Stuifzand (@pstuifzand) <https://github.com/pstuifzand>`__
- `Peter Tatrai (@ptatrai) <https://github.com/ptatrai>`__
@ -434,6 +446,7 @@ Contributors
- `Richard Lewis (@richrd) <https://github.com/richrd>`__
- `Rico van Genugten (@ricovangenugten) <https://github.com/ricovangenugten>`__
- `rjmurph2241 (@rjmurph2241) <https://github.com/rjmurph2241>`__
- `René Klomp (@rklomp) <https://github.com/rklomp>`__
- `rlowens (@rlowens) <https://github.com/rlowens>`__
- `LMR (@rmooreID) <https://github.com/rmooreID>`__
- `Ryan Mounce (@rmounce) <https://github.com/rmounce>`__
@ -452,6 +465,7 @@ Contributors
- `Rubén G. (@rubengargar) <https://github.com/rubengargar>`__
- `RubyBailey (@RubyBailey) <https://github.com/RubyBailey>`__
- `rudgr (@rudgr) <https://github.com/rudgr>`__
- `Roberto Wagner (@rwagnervm) <https://github.com/rwagnervm>`__
- `ryanalden (@ryanalden) <https://github.com/ryanalden>`__
- `Ryan Nazaretian (@ryannazaretian) <https://github.com/ryannazaretian>`__
- `samnewman86 (@samnewman86) <https://github.com/samnewman86>`__
@ -474,6 +488,7 @@ Contributors
- `Derek Hageman (@Sizurka) <https://github.com/Sizurka>`__
- `Stephen Tierney (@sjtrny) <https://github.com/sjtrny>`__
- `Niklas Wagner (@Skaronator) <https://github.com/Skaronator>`__
- `Luca Zimmermann (@soundstorm) <https://github.com/soundstorm>`__
- `Philip Allgaier (@spacegaier) <https://github.com/spacegaier>`__
- `spattinson (@spattinson) <https://github.com/spattinson>`__
- `spilin (@spilin) <https://github.com/spilin>`__
@ -482,6 +497,7 @@ Contributors
- `sredfern (@sredfern) <https://github.com/sredfern>`__
- `srg74 (@srg74) <https://github.com/srg74>`__
- `Samuel Sieb (@ssieb) <https://github.com/ssieb>`__
- `starwolf73 (@starwolf73) <https://github.com/starwolf73>`__
- `Steve Baxter (@stevebaxter) <https://github.com/stevebaxter>`__
- `stubs12 (@stubs12) <https://github.com/stubs12>`__
- `Jordan Vohwinkel (@sublime93) <https://github.com/sublime93>`__
@ -508,6 +524,7 @@ Contributors
- `Simon (@theOzzieRat) <https://github.com/theOzzieRat>`__
- `Florian Gareis (@TheZoker) <https://github.com/TheZoker>`__
- `Thomas Klingbeil (@thomasklingbeil) <https://github.com/thomasklingbeil>`__
- `Thomas Dietrich (@ThomDietrich) <https://github.com/ThomDietrich>`__
- `Andrew Thompson (@thompsa) <https://github.com/thompsa>`__
- `thubot (@thubot) <https://github.com/thubot>`__
- `tiagofreire-pt (@tiagofreire-pt) <https://github.com/tiagofreire-pt>`__
@ -521,6 +538,7 @@ Contributors
- `Tommy Kihlstrøm (@tomludd) <https://github.com/tomludd>`__
- `tomlut (@tomlut) <https://github.com/tomlut>`__
- `Tom Price (@tomtom5152) <https://github.com/tomtom5152>`__
- `David Kiliani (@torfbolt) <https://github.com/torfbolt>`__
- `Torwag (@torwag) <https://github.com/torwag>`__
- `Felix Eckhofer (@tribut) <https://github.com/tribut>`__
- `Troon (@Troon) <https://github.com/Troon>`__
@ -565,7 +583,8 @@ Contributors
- `YuanL.Lee (@yuanl) <https://github.com/yuanl>`__
- `Yuval Aboulafia (@yuvalabou) <https://github.com/yuvalabou>`__
- `ZabojnikM (@ZabojnikM) <https://github.com/ZabojnikM>`__
- `zaluthar (@zaluthar) <https://github.com/zaluthar>`__
- `San (@zhujunsan) <https://github.com/zhujunsan>`__
- `Christian Zufferey (@zuzu59) <https://github.com/zuzu59>`__
*This page was last updated May 19, 2021.*
*This page was last updated June 17, 2021.*

BIN
images/cs5460a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
images/improv-social.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

1
images/improv.svg Normal file
View File

@ -0,0 +1 @@
<svg width="103" height="39" viewBox="0 0 103 39" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M91.9054 9.93591C94.2195 11.9374 95.9238 14.5495 96.8236 17.4738C96.8562 17.5864 96.8661 17.7044 96.8526 17.8209C96.8391 17.9374 96.8026 18.0501 96.7451 18.1523C96.6877 18.2546 96.6104 18.3443 96.5179 18.4164C96.4254 18.4885 96.3195 18.5414 96.2063 18.5721L96.0925 18.6052C95.8773 18.6654 95.6472 18.6406 95.4498 18.5361C95.2523 18.4315 95.1025 18.2551 95.0314 18.0433C94.2366 15.444 92.7244 13.1217 90.6686 11.3436C88.6127 9.56547 86.0968 8.40366 83.4101 7.99177C83.1903 7.95187 82.9941 7.82907 82.8622 7.64873C82.7302 7.4684 82.6726 7.24428 82.7011 7.02266L82.7175 6.90532C82.7337 6.78842 82.7732 6.67596 82.8336 6.57457C82.894 6.47319 82.9741 6.38493 83.0692 6.31502C83.1643 6.24511 83.2724 6.19495 83.3872 6.16752C83.502 6.14008 83.6211 6.13592 83.7376 6.15528C86.7609 6.62431 89.5914 7.93442 91.9054 9.93591ZM87.0042 17.7343C87.3824 17.2789 87.3211 16.6021 86.8673 16.2226C86.4135 15.8432 85.739 15.9047 85.3609 16.3601L75.415 28.3366L69.8258 22.728L68.3132 24.2458L74.7306 30.6856C74.9431 30.8988 75.2352 31.0125 75.5354 30.9988C75.8356 30.9852 76.1162 30.8454 76.3086 30.6137L87.0042 17.7343ZM92.7606 18.6474C92.0919 16.5061 90.8387 14.5941 89.142 13.1266C87.4453 11.6591 85.3726 10.6945 83.1574 10.3413C83.0416 10.3238 82.9236 10.3295 82.8101 10.358C82.6966 10.3865 82.5899 10.4373 82.4962 10.5073C82.4025 10.5774 82.3236 10.6654 82.2642 10.7662C82.2047 10.867 82.1659 10.9787 82.15 11.0946L82.1336 11.2119C82.1051 11.4336 82.1627 11.6577 82.2947 11.838C82.4266 12.0183 82.6227 12.1411 82.8426 12.181C84.7174 12.4785 86.4718 13.2942 87.9075 14.536C89.3433 15.7778 90.4032 17.3963 90.9677 19.2087C91.0389 19.4205 91.1887 19.5969 91.3861 19.7015C91.5836 19.806 91.8137 19.8308 92.0289 19.7706L92.1426 19.7375C92.255 19.7068 92.3601 19.6542 92.4521 19.5827C92.544 19.5112 92.6209 19.4223 92.6783 19.321C92.7357 19.2197 92.7726 19.108 92.7867 18.9924C92.8008 18.8768 92.7919 18.7596 92.7606 18.6474ZM8.39453 31H6.14453V13.9375H8.39453V31ZM14.2188 18.3203L14.2773 19.7265C15.207 18.6328 16.4609 18.0859 18.0391 18.0859C19.8125 18.0859 21.0195 18.7656 21.6602 20.125C22.082 19.5156 22.6289 19.0234 23.3008 18.6484C23.9805 18.2734 24.7812 18.0859 25.7031 18.0859C28.4844 18.0859 29.8984 19.5586 29.9453 22.5039V31H27.7773V22.6328C27.7773 21.7265 27.5703 21.0507 27.1562 20.6054C26.7422 20.1523 26.0469 19.9257 25.0703 19.9257C24.2656 19.9257 23.5977 20.1679 23.0664 20.6523C22.5352 21.1289 22.2266 21.7734 22.1406 22.5859V31H19.9609V22.6914C19.9609 20.8476 19.0586 19.9257 17.2539 19.9257C15.832 19.9257 14.8594 20.5312 14.3359 21.7421V31H12.168V18.3203H14.2188ZM42.6133 29.4648C43.4961 28.2851 43.9375 26.7304 43.9375 24.8007V24.6015C43.9375 22.5546 43.4922 20.957 42.6016 19.8086C41.7188 18.6601 40.5156 18.0859 38.9922 18.0859C37.4219 18.0859 36.1953 18.6328 35.3125 19.7265L35.207 18.3203H33.2266V35.875H35.3945V29.7695C36.2773 30.7461 37.4883 31.2343 39.0273 31.2343C40.5352 31.2343 41.7305 30.6445 42.6133 29.4648ZM40.8555 21.1679C41.4648 21.9961 41.7695 23.125 41.7695 24.5546C41.7695 26.1796 41.4609 27.4062 40.8438 28.2343C40.2344 29.0546 39.4102 29.4648 38.3711 29.4648C37.0352 29.4648 36.043 28.8867 35.3945 27.7304V21.6718C36.0508 20.5078 37.0352 19.9257 38.3477 19.9257C39.4102 19.9257 40.2461 20.3398 40.8555 21.1679ZM52.832 20.2656C52.5039 20.2109 52.1484 20.1836 51.7656 20.1836C50.3438 20.1836 49.3789 20.789 48.8711 22V31H46.7031V18.3203H48.8125L48.8477 19.7851C49.5586 18.6523 50.5664 18.0859 51.8711 18.0859C52.293 18.0859 52.6133 18.1406 52.832 18.25V20.2656ZM54.7539 21.1914C54.2695 22.1836 54.0273 23.3007 54.0273 24.5429V24.6953C54.0273 26.664 54.5586 28.2461 55.6211 29.4414C56.6914 30.6367 58.0859 31.2343 59.8047 31.2343C60.9453 31.2343 61.9531 30.9609 62.8281 30.414C63.7109 29.8671 64.3867 29.1054 64.8555 28.1289C65.332 27.1445 65.5703 26.0351 65.5703 24.8007V24.6484C65.5703 22.664 65.0352 21.0742 63.9648 19.8789C62.9023 18.6836 61.5078 18.0859 59.7812 18.0859C58.6641 18.0859 57.668 18.3554 56.793 18.8945C55.9258 19.4336 55.2461 20.1992 54.7539 21.1914ZM57.1797 28.1875C56.5312 27.3359 56.207 26.207 56.207 24.8007C56.207 23.2148 56.5352 21.9961 57.1914 21.1445C57.8477 20.2929 58.7109 19.8671 59.7812 19.8671C60.875 19.8671 61.75 20.3007 62.4062 21.1679C63.0703 22.0273 63.4023 23.1523 63.4023 24.5429C63.4023 26.0976 63.0781 27.3086 62.4297 28.1757C61.7812 29.0351 60.9062 29.4648 59.8047 29.4648C58.7109 29.4648 57.8359 29.039 57.1797 28.1875Z" fill="#212121"/></svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
images/sdm220m.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" id="svg10" width="260" height="61.333" version="1.1"><metadata id="metadata16"/><path id="path2" d="M20.456 1.6h219.3c10.31 0 18.667 8.357 18.667 18.667v20.666c0 10.31-8.358 18.667-18.667 18.667h-219.3c-10.31 0-18.667-8.357-18.667-18.667V20.267C1.79 9.957 10.146 1.6 20.456 1.6z"/><path id="path4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.333" d="M20.456 1.6h219.3c10.31 0 18.667 8.357 18.667 18.667v20.666c0 10.31-8.358 18.667-18.667 18.667h-219.3c-10.31 0-18.667-8.357-18.667-18.667V20.267C1.79 9.957 10.146 1.6 20.456 1.6z"/><text style="font-style:normal;font-weight:400;font-size:49.4582px;line-height:1.25;font-family:sans-serif;fill:#fff;fill-opacity:1;stroke:none;stroke-width:1.23645" id="text24" x="35.867" y="46.914" transform="scale(0.95547305,1.046602)" xml:space="preserve"><tspan id="tspan22" x="35.867" y="46.914" style="fill:#fff;stroke-width:1.23645">SM2135</tspan></text></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" id="svg10" width="260" height="61.333" version="1.1"><metadata id="metadata16"/><path id="path2" d="M20.456 1.6h219.3c10.31 0 18.667 8.357 18.667 18.667v20.666c0 10.31-8.358 18.667-18.667 18.667h-219.3c-10.31 0-18.667-8.357-18.667-18.667V20.267C1.79 9.957 10.146 1.6 20.456 1.6z"/><path id="path4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.333" d="M20.456 1.6h219.3c10.31 0 18.667 8.357 18.667 18.667v20.666c0 10.31-8.358 18.667-18.667 18.667h-219.3c-10.31 0-18.667-8.357-18.667-18.667V20.267C1.79 9.957 10.146 1.6 20.456 1.6z"/><text style="font-style:normal;font-weight:400;font-size:49.4582px;line-height:1.25;font-family:sans-serif;fill:#fff;fill-opacity:1;stroke:none;stroke-width:1.23645" id="text24" x="35.867" y="46.914" transform="scale(0.95547305,1.046602)" xml:space="preserve"><tspan id="tspan22" x="35.867" y="46.914" style="fill:#fff;stroke-width:1.23645">SM2135</tspan></text></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
images/xpt2046.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -152,7 +152,7 @@ Sensor Components
BH1750, components/sensor/bh1750, bh1750.jpg
Binary Sensor Map, components/sensor/binary_sensor_map, binary_sensor_map.jpg
BLE RSSI, components/sensor/ble_rssi, bluetooth.svg
BLE Sensor, components/sensor/ble_sensor, bluetooth.svg
BLE Client Sensor, components/sensor/ble_client, bluetooth.svg
BME280, components/sensor/bme280, bme280.jpg
BME680, components/sensor/bme680, bme680.jpg
BME680 via BSEC, components/sensor/bme680_bsec, bme680.jpg
@ -161,6 +161,7 @@ Sensor Components
b-parasite, components/sensor/b_parasite, b_parasite.jpg
CCS811, components/sensor/ccs811, ccs811.jpg
CSE7766, components/sensor/cse7766, cse7766.svg
CS5460A, components/sensor/cs5460a, cs5460a.png
CT Clamp, components/sensor/ct_clamp, ct_clamp.jpg
Dallas, components/sensor/dallas, dallas.jpg
DHT, components/sensor/dht, dht.jpg
@ -204,6 +205,7 @@ Sensor Components
RuuviTag, components/sensor/ruuvitag, ruuvitag.jpg
SenseAir, components/sensor/senseair, senseair_s8.jpg
SDS011 Sensor, components/sensor/sds011, sds011.jpg
SDM Meter, components/sensor/sdm_meter, sdm220m.png
SCD30, components/sensor/scd30, scd30.jpg
SHTCx, components/sensor/shtcx, shtc3.jpg
SHT3X-D, components/sensor/sht3xd, sht3xd.jpg
@ -257,6 +259,7 @@ Binary Sensor Components
RDM6300, components/binary_sensor/rdm6300, rdm6300.jpg
TTP229, components/binary_sensor/ttp229, ttp229.jpg
Tuya Binary Sensor, components/binary_sensor/tuya, tuya.png
XPT2046, components/binary_sensor/xpt2046, xpt2046.jpg
Custom Binary Sensor, components/binary_sensor/custom, language-cpp.svg
Output Components
@ -320,7 +323,7 @@ Switch Components
UART Switch, components/switch/uart, uart.svg
Custom Switch, components/switch/custom, language-cpp.svg
Tuya Switch, components/switch/tuya, tuya.png
BLE Switch, components/switch/ble, bluetooth.svg
BLE Client Switch, components/switch/ble_client, bluetooth.svg
Fan Components
--------------
@ -428,6 +431,7 @@ Misc Components
SIM800L, components/sim800l, sim800l.jpg
DFPlayer, components/dfplayer, dfplayer.svg
Captive Portal, components/captive_portal, wifi-strength-alert-outline.svg
Improv, components/esp32_improv, improv.svg
Debug Component, components/debug, bug-report.svg
TM1651 Battery Display, components/tm1651, tm1651_battery_display.jpg
RF Bridge, components/rf_bridge, rf_bridge.jpg

View File

@ -481,7 +481,8 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
c = self.json_base_config or self.json_component
if c:
trigger_schema = self.find_props(c).get(key)
self.props = self.find_props(trigger_schema)
if trigger_schema is not None:
self.props = self.find_props(trigger_schema)
self.props_section_title = title_text
if title_text == PIN_CONFIGURATION_VARIABLES:
@ -545,6 +546,8 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
def find_registry_prop(self, registry_name, key, description):
registry = self.app.jschema["definitions"][registry_name]["anyOf"]
for item in registry:
if "$ref" in item:
item = self.get_ref(item)
if key in item["properties"]:
item["properties"][key]["markdownDescription"] = description
self.props = self.find_props(item["properties"][key])
@ -641,15 +644,33 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
ref = self.get_ref(prop["anyOf"][0])
self.prop_stack.append(self.props)
self.props = self.find_props(ref)
# nowhere put this props info...
# otherwise inner bullet list will be interpreted as property list
if self.props_level > 1:
else:
# TODO: if the list items are formated like:
# - ``value`` <optional description>
# - ``other value`` <optional description>
# then we could ensure these are enum values (or populate enum values double check.)
# Currently some enum values are also in the **value** format.
if (
# most likely an enum, the values are most likely retrieved from ESPHome validation schema
"enum" in prop
# or custom components has list of sensors/binary sensors, etc.
or (
prop.get("markdownDescription", "").startswith("**list**")
and self.docname.endswith("/custom")
)
):
raise nodes.SkipChildren
# nowhere put this props info...
# otherwise inner bullet list will be interpreted as property list
logger = logging.getLogger(__name__)
logger.info(
f"In {self.docname} / {self.previous_title_text} property {self.current_prop} a unknown info sub bullet list."
)
raise nodes.SkipChildren
else:
# nowhere put this props info...
# otherwise inner bullet list will be interpreted as property list
if self.props_level > 1:
raise nodes.SkipChildren
raise nodes.SkipChildren
if not self.props and self.multi_component is None:
raise nodes.SkipChildren
@ -914,6 +935,8 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor):
prop_set = ref.get("anyOf")
if isinstance(prop_set, list):
for k in prop_set:
if "$ref" in k:
k = self.visitor.get_ref(k)
if key in k["properties"]:
self.store = k["properties"]
return self.store[key]