diff --git a/Dockerfile b/Dockerfile index 78290dcf3..a99ffa478 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-slim +FROM python:3.12-slim RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ @@ -9,10 +9,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ software-properties-common \ && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* -COPY requirements.txt . +RUN useradd -ms /bin/bash esphome + +USER esphome + +WORKDIR /workspaces/esphome-docs +ENV PATH="${PATH}:/home/esphome/.local/bin" + +COPY requirements.txt ./ RUN pip3 install --no-cache-dir --no-binary :all: -r requirements.txt EXPOSE 8000 -WORKDIR /data/esphomedocs CMD ["make", "live-html"] + +LABEL \ + org.opencontainers.image.title="esphome-docs" \ + org.opencontainers.image.description="An image to help with ESPHomes documentation development" \ + org.opencontainers.image.vendor="ESPHome" \ + org.opencontainers.image.licenses="CC BY-NC-SA 4.0" \ + org.opencontainers.image.url="https://esphome.io" \ + org.opencontainers.image.source="https://github.com/esphome/esphome-docs" \ + org.opencontainers.image.documentation="https://github.com/esphome/esphome-docs/blob/current/README.md" diff --git a/Doxygen b/Doxygen index fadce402f..149e4876c 100644 --- a/Doxygen +++ b/Doxygen @@ -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 = 2024.5.0-dev +PROJECT_NUMBER = 2024.4.2 # 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 diff --git a/Makefile b/Makefile index 299496721..5251aa29e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ESPHOME_PATH = ../esphome -ESPHOME_REF = dev +ESPHOME_REF = 2024.4.2 .PHONY: html html-strict cleanhtml deploy help live-html Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify diff --git a/_static/changelog-2024.4.0.png b/_static/changelog-2024.4.0.png new file mode 100644 index 000000000..96c8a876e Binary files /dev/null and b/_static/changelog-2024.4.0.png differ diff --git a/_static/custom.css b/_static/custom.css index 451d5cb4b..182ffa4ab 100644 --- a/_static/custom.css +++ b/_static/custom.css @@ -240,6 +240,11 @@ a:hover code { background: none; } +/* don't underline links that contain an image and nothing else */ +a:has(> img:only-child) { + border-bottom: none; +} + div.body p, div.body dd, div.body li, div.body blockquote { hyphens: none; } diff --git a/_static/version b/_static/version index 1b2c5450f..af96240eb 100644 --- a/_static/version +++ b/_static/version @@ -1 +1 @@ -2024.5.0-dev \ No newline at end of file +2024.4.2 \ No newline at end of file diff --git a/_templates/layout.html b/_templates/layout.html index c2d52b8ff..b11da1a47 100644 --- a/_templates/layout.html +++ b/_templates/layout.html @@ -16,6 +16,7 @@ + diff --git a/changelog/2023.12.0.rst b/changelog/2023.12.0.rst index 58ff62091..499288e89 100644 --- a/changelog/2023.12.0.rst +++ b/changelog/2023.12.0.rst @@ -14,7 +14,7 @@ ESPHome 2023.12.0 - 20th December 2023 GT911, components/touchscreen/gt911, esp32_s3_box_3.png Pylontech Batteries, components/pylontech, pylontech.jpg HE60R Cover, components/cover/he60r, he60r.jpg - Graphical Display Menu, components/display_menu/graphical_display_menu, graphical_display_menu.jpg + Graphical Display Menu, components/display_menu/graphical_display_menu, graphical_display_menu.png FT63X6, components/touchscreen/ft63x6, wt32-sc01.png A02YYUW, components/sensor/a02yyuw, a02yyuw.jpg PN7150, components/binary_sensor/pn7150, pn7150.jpg diff --git a/changelog/2024.4.0.rst b/changelog/2024.4.0.rst new file mode 100644 index 000000000..ed0b3af4c --- /dev/null +++ b/changelog/2024.4.0.rst @@ -0,0 +1,231 @@ +ESPHome 2024.4.0 - 17th April 2024 +================================== + +.. seo:: + :description: Changelog for ESPHome 2024.4.0. + :image: /_static/changelog-2024.4.0.png + :author: Jesse Hills + :author_twitter: @jesserockz + +.. imgtable:: + :columns: 4 + + Template Datetime Time, components/datetime/template, description.svg, dark-invert + SUN-GTIL2 inverter, components/sun_gtil2, sun_1000g2.png + AT581X, components/at581x, at581x.png + JSN-SR04T, components/sensor/jsn_sr04t, jsn-sr04t-v3.jpg + + Daikin ARC, components/climate/climate_ir, air-conditioner-ir.svg, dark-invert + HHCCJCY10 (MiFlora Pink), components/sensor/xiaomi_hhccjcy10, xiaomi_hhccjcy10.jpg + TLC5971, components/output/tlc5971, tlc5971.jpg + Dooya, components/remote_transmitter, remote.svg + + +Time Entities +------------- + +ESPHome now has support for ``time`` entities that can be set from the frontend (like Home Assistant). THis allows you to set a timer to execute future automations on device. + +ESPHome Dates require Home Assistant 2024.4 or later. + + +Voice Assistant Audio +--------------------- + +This release adds support for sending and receiving audio to/from voice assistants via the API. Currently ESPHome sends and receives the Voice Assistant audio bytes +via a UDP socket which can be unreliable and insecure. Beginning with Home Assistant 2024.5, both sides will automatically recognise that they both support API Audio and will +use that route instead. This is more reliable because the ESPHome API uses a TCP socket, so packet order and delivery is guaranteed, and if you use API Encryption, +your audio will also be encrypted in transit. + + +Release 2024.4.1 - April 23 +--------------------------- + +- [Tuya Climate] Fix compilation error caused by codegen :esphomepr:`6568` by :ghuser:`zry98` +- wifi: fix reconnect issue due to enablement of fast connect :esphomepr:`6598` by :ghuser:`jpeletier` +- Calibrate Beken internal temperature :esphomepr:`6599` by :ghuser:`Mat931` +- fix streaming logs from MQTT for ESP32 devices using TLS :esphomepr:`6605` by :ghuser:`ccutrer` +- Disallow variant/family override for known boards :esphomepr:`6512` by :ghuser:`clydebarrow` +- esp32_ble: Consider ESP_BT_STATUS_DONE a successful state :esphomepr:`6493` by :ghuser:`polyfloyd` +- Fix or filter :esphomepr:`6574` by :ghuser:`swoboda1337` + + +Release 2024.4.2 - April 30 +--------------------------- + +- Fix SHT3xd fails sometimes in 2024.4.0 :esphomepr:`6592` by :ghuser:`mrtoy-me` +- allow defaults with no include vars :esphomepr:`6613` by :ghuser:`ssieb` +- Revert #6458 :esphomepr:`6650` by :ghuser:`tronikos` +- [i2s_audio.microphone] Fixing adc bug :esphomepr:`6654` by :ghuser:`jesserockz` + + +Full list of changes +-------------------- + +New Components +^^^^^^^^^^^^^^ + +- Add sun_gtil2 component (for SUN-1000G2 / SUN-2000G2 grid tie inverters) :esphomepr:`4958` by :ghuser:`Mat931` (new-integration) +- Add support for AT581x component :esphomepr:`6297` by :ghuser:`X-Ryl669` (new-integration) +- Add new Component: Ultrasonic Distance Sensor JSN-SR04T :esphomepr:`6023` by :ghuser:`Mafus1` (new-integration) +- feat: Add Daikin ARC (tested on Daikin ARC472A62) :esphomepr:`6429` by :ghuser:`magicbear` (new-integration) +- add support for Tuya pink version of miflora :esphomepr:`5402` by :ghuser:`fariouche` (new-integration) +- Implemented support for the TLC5971 as an output component :esphomepr:`6494` by :ghuser:`IJIJI` (new-integration) + +Breaking Changes +^^^^^^^^^^^^^^^^ + +- Add support for new modes in Tuya Climate :esphomepr:`5159` by :ghuser:`moriahmorgan` (breaking-change) +- IPv6 string representation follows RFC5952 :esphomepr:`6449` by :ghuser:`HeMan` (breaking-change) + +Beta Changes +^^^^^^^^^^^^ + +- Add dooya remote transmitter test :esphomepr:`6508` by :ghuser:`jesserockz` +- ads1115: remove auto-load and split sensor into platform folder :esphomepr:`5981` by :ghuser:`jesserockz` (new-platform) +- Bump esphome-dashboard to 20240412.0 :esphomepr:`6517` by :ghuser:`jesserockz` +- Fix missing ifdefs in voice assistant :esphomepr:`6520` by :ghuser:`jesserockz` +- Fix project version longer than 30 characters breaking compilation :esphomepr:`6535` by :ghuser:`jesserockz` +- Fix no-release bug on ft6x36 :esphomepr:`6527` by :ghuser:`clydebarrow` + +All changes +^^^^^^^^^^^ + +- Bump docker/login-action from 3.0.0 to 3.1.0 :esphomepr:`6367` by :ghuser:`dependabot[bot]` +- Bump peter-evans/create-pull-request from 6.0.1 to 6.0.2 :esphomepr:`6361` by :ghuser:`dependabot[bot]` +- Bump docker/build-push-action from 5.2.0 to 5.3.0 in /.github/actions/build-image :esphomepr:`6373` by :ghuser:`dependabot[bot]` +- Bump docker/setup-buildx-action from 3.1.0 to 3.2.0 :esphomepr:`6372` by :ghuser:`dependabot[bot]` +- Fix deep_sleep for ESP32-C6 :esphomepr:`6377` by :ghuser:`ferrets6` +- Fix keeloq for IDF 5+ :esphomepr:`6382` by :ghuser:`kbx81` +- Fix Nextion set_component_picture call :esphomepr:`6378` by :ghuser:`edwardtfn` +- Add line_at_angle method to Display component :esphomepr:`6381` by :ghuser:`deisterhold` +- Check generated proto files are as expected if any are modified in PRs :esphomepr:`6254` by :ghuser:`jesserockz` +- ld2420: fix energy mode documentation :esphomepr:`6225` by :ghuser:`andresv` +- Add actions for component tests A, B and C :esphomepr:`6256` by :ghuser:`kbx81` +- Add some components to the new testing framework (V) :esphomepr:`6231` by :ghuser:`kbx81` +- Add some components to the new testing framework (X,Y,Z) :esphomepr:`6233` by :ghuser:`kbx81` +- Add some components to the new testing framework (E) :esphomepr:`6176` by :ghuser:`kbx81` +- Make SPI compile with IDF >= 5.0 :esphomepr:`6383` by :ghuser:`HeMan` +- Fix esp32-camera test yaml :esphomepr:`6398` by :ghuser:`kbx81` +- Bump pytest-asyncio from 0.23.5.post1 to 0.23.6 :esphomepr:`6402` by :ghuser:`dependabot[bot]` +- Bump actions/cache from 4.0.1 to 4.0.2 in /.github/actions/restore-python :esphomepr:`6403` by :ghuser:`dependabot[bot]` +- Bump actions/cache from 4.0.1 to 4.0.2 :esphomepr:`6404` by :ghuser:`dependabot[bot]` +- Bump ESP8266 Arduino versions :esphomepr:`5359` by :ghuser:`HeMan` +- Allow accept/reject delta to be specified. :esphomepr:`5060` by :ghuser:`cvwillegen` +- Allow setting htop for ledc :esphomepr:`6340` by :ghuser:`Gagootron` +- sm2135: add separate_modes option to support different chip variants :esphomepr:`6152` by :ghuser:`jasperro` +- AHT10: fix temperature-only operation; add warning/error messages :esphomepr:`6405` by :ghuser:`clydebarrow` +- Add support for new modes in Tuya Climate :esphomepr:`5159` by :ghuser:`moriahmorgan` (breaking-change) +- Add sun_gtil2 component (for SUN-1000G2 / SUN-2000G2 grid tie inverters) :esphomepr:`4958` by :ghuser:`Mat931` (new-integration) +- SPI: Make some validation failures give more useful messages. :esphomepr:`6413` by :ghuser:`clydebarrow` +- Bump aioesphomeapi from 23.1.1 to 23.2.0 :esphomepr:`6412` by :ghuser:`dependabot[bot]` +- Add check for use of GPIOXX in config :esphomepr:`6419` by :ghuser:`clydebarrow` +- WireGuard for esp8266 :esphomepr:`6365` by :ghuser:`droscy` +- setup.cfg: drop duplicate, underintended trove classifier :esphomepr:`6421` by :ghuser:`mweinelt` +- Store preferences in disk file on host platform :esphomepr:`6428` by :ghuser:`clydebarrow` +- Add support for AT581x component :esphomepr:`6297` by :ghuser:`X-Ryl669` (new-integration) +- Add some components to the new testing framework (F) :esphomepr:`6177` by :ghuser:`kbx81` +- Add get_contrast() and get_brightness() to SSD1306 class to get protected variables :esphomepr:`6435` by :ghuser:`benediktkr` +- Add new Component: Ultrasonic Distance Sensor JSN-SR04T :esphomepr:`6023` by :ghuser:`Mafus1` (new-integration) +- Add some components to the new testing framework (G) :esphomepr:`6178` by :ghuser:`kbx81` +- Add some components to the new testing framework (K) :esphomepr:`6186` by :ghuser:`kbx81` +- Add some components to the new testing framework (N) :esphomepr:`6210` by :ghuser:`kbx81` +- Add some components to the new testing framework (Q) :esphomepr:`6218` by :ghuser:`kbx81` +- Add some components to the new testing framework (U) :esphomepr:`6230` by :ghuser:`kbx81` +- Fix spacing in new test yaml :esphomepr:`6441` by :ghuser:`kbx81` +- Add some components to the new testing framework (W) :esphomepr:`6232` by :ghuser:`kbx81` +- Add some components to the new testing framework (L) :esphomepr:`6195` by :ghuser:`kbx81` +- feat: Add Daikin ARC (tested on Daikin ARC472A62) :esphomepr:`6429` by :ghuser:`magicbear` (new-integration) +- Disable truthy yamllint rule :esphomepr:`6442` by :ghuser:`jesserockz` +- Add get_size method to QR Code header :esphomepr:`6430` by :ghuser:`deisterhold` +- Minor change to support sht85 sensor :esphomepr:`6415` by :ghuser:`mrtoy-me` +- IPv6 string representation follows RFC5952 :esphomepr:`6449` by :ghuser:`HeMan` (breaking-change) +- Bump actions/setup-python from 5.0.0 to 5.1.0 :esphomepr:`6437` by :ghuser:`dependabot[bot]` +- Bump actions/setup-python from 5.0.0 to 5.1.0 in /.github/actions/restore-python :esphomepr:`6438` by :ghuser:`dependabot[bot]` +- Optimize QMC5883L: Read registers only for enabled sensors :esphomepr:`6458` by :ghuser:`tronikos` +- minor refactor to allow commit hash as ref value. :esphomepr:`6446` by :ghuser:`LelandSindt` +- TMP117 fix polling period config :esphomepr:`6452` by :ghuser:`mrtoy-me` +- Bump Arduino Pico Framework to 3.7.2 and Platform to 1.12.0 :esphomepr:`6386` by :ghuser:`HeMan` +- Display menu: Allow "left" key to exit current menu if not editing :esphomepr:`6460` by :ghuser:`jesserockz` +- Fix NOLINT on inclusive-language check :esphomepr:`6464` by :ghuser:`jesserockz` +- Add yamllint to dev requirements :esphomepr:`6466` by :ghuser:`jesserockz` +- Add temperature for QMC5883L :esphomepr:`6456` by :ghuser:`tronikos` +- web_server: Return early if no clients connected :esphomepr:`6467` by :ghuser:`jesserockz` +- ESP32 Arduino WiFi: misc bug fixes :esphomepr:`6470` by :ghuser:`paravoid` +- Replace std::regex with sscanf calls :esphomepr:`6468` by :ghuser:`jesserockz` +- Include "Failed" status in config log. :esphomepr:`6482` by :ghuser:`clydebarrow` +- Fix Microphone IsCapturingCondition :esphomepr:`6490` by :ghuser:`RaymiiOrg` +- Remove misleading tag/line in messages :esphomepr:`6495` by :ghuser:`clydebarrow` +- Send/Receive Voice Assistant audio via API :esphomepr:`6471` by :ghuser:`jesserockz` +- Datetime date initial value fix :esphomepr:`6483` by :ghuser:`RFDarter` +- If the loop() took more than the required time, don't delay further :esphomepr:`6496` by :ghuser:`clydebarrow` +- Bump LibreTiny version to 1.5.1 :esphomepr:`6500` by :ghuser:`kuba2k2` +- Internal temperature: Support Beken platform :esphomepr:`6491` by :ghuser:`Mat931` +- Bump docker/setup-buildx-action from 3.2.0 to 3.3.0 :esphomepr:`6502` by :ghuser:`dependabot[bot]` +- add support for Tuya pink version of miflora :esphomepr:`5402` by :ghuser:`fariouche` (new-integration) +- Add MAC address to WiFi config reply :esphomepr:`6489` by :ghuser:`cvwillegen` +- Adds i2c timeout config :esphomepr:`4614` by :ghuser:`tracestep` +- Add ABB-Welcome / Busch-Welcome Door Intercom Protocol :esphomepr:`4689` by :ghuser:`Mat931` +- Add support for time entities :esphomepr:`6399` by :ghuser:`jesserockz` +- Fix Match by IRK :esphomepr:`6499` by :ghuser:`MRemy2` +- Add rmt_channel to remote_transmitter and remote_receiver :esphomepr:`6497` by :ghuser:`jesserockz` (new-integration) +- Rework tlc5947 to remove AUTO_LOAD :esphomepr:`6503` by :ghuser:`jesserockz` +- UART: ignore require_tx/rx if not a native uart implementation :esphomepr:`6504` by :ghuser:`jesserockz` +- esp32_rmt_led_strip bugfixes :esphomepr:`6506` by :ghuser:`Mat931` +- Implemented support for the TLC5971 as an output component :esphomepr:`6494` by :ghuser:`IJIJI` (new-integration) +- Add Dooya protocol to remote_base :esphomepr:`6488` by :ghuser:`bukureckid` +- Only give error for connected sensors at startup :esphomepr:`6474` by :ghuser:`leejoow` +- Webserver float to string fix :esphomepr:`6507` by :ghuser:`RFDarter` +- Add dooya remote transmitter test :esphomepr:`6508` by :ghuser:`jesserockz` +- ads1115: remove auto-load and split sensor into platform folder :esphomepr:`5981` by :ghuser:`jesserockz` (new-platform) +- Bump esphome-dashboard to 20240412.0 :esphomepr:`6517` by :ghuser:`jesserockz` +- Fix missing ifdefs in voice assistant :esphomepr:`6520` by :ghuser:`jesserockz` +- Fix project version longer than 30 characters breaking compilation :esphomepr:`6535` by :ghuser:`jesserockz` +- Fix no-release bug on ft6x36 :esphomepr:`6527` by :ghuser:`clydebarrow` + +Past Changelogs +--------------- + +- :doc:`2024.3.0` +- :doc:`2024.2.0` +- :doc:`2023.12.0` +- :doc:`2023.11.0` +- :doc:`2023.10.0` +- :doc:`2023.9.0` +- :doc:`2023.8.0` +- :doc:`2023.7.0` +- :doc:`2023.6.0` +- :doc:`2023.5.0` +- :doc:`2023.4.0` +- :doc:`2023.3.0` +- :doc:`2023.2.0` +- :doc:`2022.12.0` +- :doc:`2022.11.0` +- :doc:`2022.10.0` +- :doc:`2022.9.0` +- :doc:`2022.8.0` +- :doc:`2022.6.0` +- :doc:`2022.5.0` +- :doc:`2022.4.0` +- :doc:`2022.3.0` +- :doc:`2022.2.0` +- :doc:`2022.1.0` +- :doc:`2021.12.0` +- :doc:`2021.11.0` +- :doc:`2021.10.0` +- :doc:`2021.9.0` +- :doc:`2021.8.0` +- :doc:`v1.20.0` +- :doc:`v1.19.0` +- :doc:`v1.18.0` +- :doc:`v1.17.0` +- :doc:`v1.16.0` +- :doc:`v1.15.0` +- :doc:`v1.14.0` +- :doc:`v1.13.0` +- :doc:`v1.12.0` +- :doc:`v1.11.0` +- :doc:`v1.10.0` +- :doc:`v1.9.0` +- :doc:`v1.8.0` +- :doc:`v1.7.0` diff --git a/changelog/index.rst b/changelog/index.rst index b69188536..5c6ee1940 100644 --- a/changelog/index.rst +++ b/changelog/index.rst @@ -2,7 +2,7 @@ Changelog ========= .. redirect:: - :url: /changelog/2024.3.0.html + :url: /changelog/2024.4.0.html .. toctree:: :glob: diff --git a/changelog/v1.9.0.rst b/changelog/v1.9.0.rst index 0ba225260..1c91a47d6 100644 --- a/changelog/v1.9.0.rst +++ b/changelog/v1.9.0.rst @@ -30,7 +30,7 @@ awesome things with DIY hardware! The features I'm particularly excited about are: -* :ref:`esphomeflasher ` - Experiencing problems flashing esphomelib firmwares using esphomeyaml? +* ``esphomeflasher`` - Experiencing problems flashing esphomelib firmwares using esphomeyaml? No problem, esphomeflasher is a tool designed to make that super easy. Just let esphomeyaml generate the binary and flash from your PC. * :doc:`Over-the-Air Updates ` have been completely re-written to make them a lot more @@ -76,7 +76,7 @@ New Features - esphomelib now has a new tool: `esphomeflasher `__ to simplify flashing on Windows/MacOS machines **without having to install esphomeyaml**. So if esphomeyaml for some reason - can't find your USB port, you now can use the esphomeflasher app. See :ref:`esphome-flasher`. + can't find your USB port, you now can use the esphomeflasher app. See ``esphomeflasher``. - ESP8266s now save the states of lights/switches/... internally and restores them on boot. Additionally, esphomelib can now operate in fully offline mode if your WiFi network goes down diff --git a/components/alarm_control_panel/template.rst b/components/alarm_control_panel/template.rst index 91796ff95..35f80ad5c 100644 --- a/components/alarm_control_panel/template.rst +++ b/components/alarm_control_panel/template.rst @@ -27,8 +27,8 @@ Configuration variables: - **codes** (*Optional*, list of string): A list of codes for disarming the alarm, if *requires_code_to_arm* set to true then for arming the alarm too. - **requires_code_to_arm** (*Optional*, boolean): Code required for arming the alarm, *codes* must be provided. - **arming_away_time** (*Optional*, :ref:`config-time`): The exit delay before the alarm is armed to away mode. Defaults to ``0s``. -- **arming_home_time** (*Optional*, :ref:`config-time`): The exit delay before the alarm is armed to home mode. -- **arming_night_time** (*Optional*, :ref:`config-time`): The exit delay before the alarm is armed to night mode. +- **arming_home_time** (*Optional*, :ref:`config-time`): The exit delay before the alarm is armed to home mode. +- **arming_night_time** (*Optional*, :ref:`config-time`): The exit delay before the alarm is armed to night mode. - **pending_time** (*Optional*, :ref:`config-time`): The entry delay before the alarm is triggered. Defaults to ``0s``. - **trigger_time** (*Optional*, :ref:`config-time`): The time after a triggered alarm before resetting to previous state if the sensors are cleared/off. Defaults to ``0s``. - **binary_sensors** (*Optional*, *list*): A list of binary sensors the panel should use. Each consists of: @@ -169,7 +169,7 @@ Example: name: Zone 1 device_class: door pin: - number: D1 + number: GPIOXX mode: INPUT_PULLUP inverted: True - platform: gpio @@ -177,7 +177,7 @@ Example: name: Zone 2 device_class: door pin: - number: D2 + number: GPIOXX mode: INPUT_PULLUP inverted: True - platform: gpio @@ -185,7 +185,7 @@ Example: name: Zone 3 device_class: motion pin: - number: D3 + number: GPIOXX mode: INPUT_PULLUP inverted: True - platform: gpio @@ -193,7 +193,7 @@ Example: name: Zone 4 device_class: door pin: - number: D4 + number: GPIOXX mode: INPUT_PULLUP inverted: True - platform: homeassistant @@ -206,7 +206,7 @@ Example: id: siren name: Siren icon: mdi:alarm-bell - pin: D7 + pin: GPIOXX See Also diff --git a/components/api.rst b/components/api.rst index cb1a48116..a6386a845 100644 --- a/components/api.rst +++ b/components/api.rst @@ -75,20 +75,35 @@ Configuration variables: .. _api-actions: -.. note:: - - Before a newly added ESPHome device can interact with the Home Assistant API it needs to be allowed to communicate - with it. This setting can be found in the ESPHome integration (NOT in the Add-On) by clicking "CONFIGURE" for - that device and enabling the "Allow device to make service calls" option. - Actions ------- +Before using any of the actions below, you'll need to tell Home Assistant to allow your device to +make service calls. + +Open the ESPHome integration page on your Home Assistant instance: + +.. raw:: html + + Open your Home Assistant instance and show an integration. + +Then: + +#. Fnd your device in the device list +#. Click the "configure" button next to it +#. Check the "Allow the device to make Home Assistant service calls" box +#. Then click "submit". + .. _api-homeassistant_event_action: ``homeassistant.event`` Action ****************************** +.. note:: + + Be sure to :ref:`follow the instructions above ` to tell Home Assistant to allow + your device to make service calls. + When using the native API with Home Assistant, you can create events in the Home Assistant event bus straight from ESPHome :ref:`Automations `. @@ -117,6 +132,11 @@ Configuration variables: ``homeassistant.service`` Action ******************************** +.. note:: + + Be sure to :ref:`follow the instructions above ` to tell Home Assistant to allow + your device to make service calls. + When using the native API with Home Assistant, you can create Home Assistant service calls straight from ESPHome :ref:`Automations `. @@ -189,6 +209,11 @@ Then, in ESPHome: ``homeassistant.tag_scanned`` Action ************************************ +.. note:: + + Be sure to :ref:`follow the instructions above ` to tell Home Assistant to allow + your device to make service calls. + When using the native API with Home Assistant, you can push tag_scanned to Home Assistant straight from ESPHome :ref:`Automations `. diff --git a/components/at581x.rst b/components/at581x.rst index 06b33c213..9513112a2 100644 --- a/components/at581x.rst +++ b/components/at581x.rst @@ -32,17 +32,6 @@ a :doc:`/components/i2c` component (and its requisite GPIO pins) is required in id: "Radar" i2c_id: bus_a - binary_sensor: - - platform: gpio - pin: GPIO21 - name: "Radar motion" - - switch: - # Switch to turn on/off RF emission - - platform: at581x - at581x_id: "Radar" - name: "Enable Radar" - .. _at581x-component: Component/Hub @@ -87,7 +76,7 @@ The state of the radar detection is available via its GPIO pin. It's required to binary_sensor: - platform: gpio name: "Human in front" - pin: GPIO21 + pin: GPIOXX Configuration variables: ************************ @@ -127,8 +116,8 @@ Actions .. warning:: - The hardware frontend reset option is only required to reset the frontend in case it is struck, before sending the - new configuration. However, a frontend reset is always performed after changing the settings. + The hardware frontend reset option is only required to reset the frontend in case it is struck, before sending the + new configuration. However, a frontend reset is always performed after changing the settings. The radar has several settings which can be changed. These settings are not saved in non-volatile memory and need to be set on each boot. diff --git a/components/binary_sensor/cap1188.rst b/components/binary_sensor/cap1188.rst index 0cc7a5113..016720311 100644 --- a/components/binary_sensor/cap1188.rst +++ b/components/binary_sensor/cap1188.rst @@ -30,7 +30,7 @@ required to be set up in your configuration for this sensor to work. cap1188: id: cap1188_component address: 0x29 - reset_pin: 14 + reset_pin: GPIOXX touch_threshold: 0x40 allow_multiple_touches: true diff --git a/components/binary_sensor/custom.rst b/components/binary_sensor/custom.rst index d2ee55fdc..f983584cb 100644 --- a/components/binary_sensor/custom.rst +++ b/components/binary_sensor/custom.rst @@ -1,22 +1,28 @@ Custom Binary Sensor ==================== +.. seo:: + :description: Instructions for setting up Custom C++ binary sensors with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create custom binary sensors in ESPHome -using the C++ (Arduino) API. +.. warning:: -Please first read :doc:`/components/sensor/custom` guide, -the same principles apply here and binary sensors are very similar -to sensors internally. + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + +This component can be used to create custom binary sensors in ESPHome using the C++ (Arduino) API. + +Please first read :doc:`/components/sensor/custom` guide, the same principles apply here and binary +sensors are very similar to sensors internally. The example below is an example of a custom binary sensor; this custom sensor is essentially the same as the gpio binary sensor. diff --git a/components/binary_sensor/esp32_touch.rst b/components/binary_sensor/esp32_touch.rst index 5b9363fc2..7c6bc25f3 100644 --- a/components/binary_sensor/esp32_touch.rst +++ b/components/binary_sensor/esp32_touch.rst @@ -130,8 +130,8 @@ an ``OFF`` state. binary_sensor: - platform: esp32_touch - name: "ESP32 Touch Pad GPIO27" - pin: GPIO27 + name: "ESP32 Touch Pad" + pin: GPIOXX threshold: 1000 Configuration variables: @@ -164,7 +164,7 @@ If access to the raw values is required, a template sensor can be created that p binary_sensor: - platform: esp32_touch id: esp32_touch_pad - pin: GPIO4 + pin: GPIOXX threshold: 0 sensor: @@ -174,8 +174,8 @@ If access to the raw values is required, a template sensor can be created that p return id(esp32_touch_pad).get_value(); update_interval: 3s -One example of use is a wide area pressure sensor that integrates a number of smaller sensors in an area. Make two strips -of aluminium foil that sandwich paper, and connect one wire to a touch pin and the other to ground. Set up several sensors +One example of use is a wide area pressure sensor that integrates a number of smaller sensors in an area. Make two strips +of aluminium foil that sandwich paper, and connect one wire to a touch pin and the other to ground. Set up several sensors under a flexible object like a plastic mat, add the raw values, and apply a threshold. .. _esp32-touch-pad-pins: diff --git a/components/binary_sensor/haier.rst b/components/binary_sensor/haier.rst index 29e5445f5..69a581bde 100644 --- a/components/binary_sensor/haier.rst +++ b/components/binary_sensor/haier.rst @@ -17,17 +17,17 @@ Additional sensors for Haier Climate device. **These sensors are supported only # Example configuration entry uart: baud_rate: 9600 - tx_pin: 17 - rx_pin: 16 + tx_pin: GPIOXX + rx_pin: GPIOXX id: ac_port - + climate: - platform: haier id: haier_ac protocol: hOn name: Haier AC uart_id: ac_port - + binary_sensor: - platform: haier haier_id: haier_ac @@ -56,9 +56,9 @@ Configuration variables: All options from :ref:`Binary Sensor `. - **indoor_electric_heating_status** (*Optional*): A binary sensor that indicates electrical heating system activity. All options from :ref:`Binary Sensor `. -- **indoor_fan_status** (*Optional*): A binary sensor that indicates indoor fan activity. +- **indoor_fan_status** (*Optional*): A binary sensor that indicates indoor fan activity. All options from :ref:`Binary Sensor `. -- **outdoor_fan_status** (*Optional*): A binary sensor that indicates outdoor fan activity. +- **outdoor_fan_status** (*Optional*): A binary sensor that indicates outdoor fan activity. All options from :ref:`Binary Sensor `. See Also diff --git a/components/binary_sensor/homeassistant.rst b/components/binary_sensor/homeassistant.rst index f98924abd..2628c5d58 100644 --- a/components/binary_sensor/homeassistant.rst +++ b/components/binary_sensor/homeassistant.rst @@ -34,7 +34,6 @@ Configuration variables: - **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 `. diff --git a/components/binary_sensor/hydreon_rgxx.rst b/components/binary_sensor/hydreon_rgxx.rst index 844b9a0ca..47a5b7dba 100644 --- a/components/binary_sensor/hydreon_rgxx.rst +++ b/components/binary_sensor/hydreon_rgxx.rst @@ -12,12 +12,6 @@ For this sensor to work, a :doc:`/components/sensor/hydreon_rgxx` must be set up .. code-block:: yaml # Example RG-9 entry - - uart: - rx_pin: GPIO16 - tx_pin: GPIO17 - baud_rate: 9600 - sensor: - platform: hydreon_rgxx model: "RG_9" diff --git a/components/binary_sensor/index.rst b/components/binary_sensor/index.rst index 0573e2f42..7cab5120d 100644 --- a/components/binary_sensor/index.rst +++ b/components/binary_sensor/index.rst @@ -66,12 +66,12 @@ Advanced options: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **publish_initial_state** (*Optional*, boolean): If true, then the sensor will publish its initial state at boot or when HA first connects, depending on the platform. This means that any applicable triggers will be run. Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. - If MQTT enabled, all other options from :ref:`MQTT Component `. diff --git a/components/binary_sensor/rc522.rst b/components/binary_sensor/rc522.rst index 48e60e643..1c89732b1 100644 --- a/components/binary_sensor/rc522.rst +++ b/components/binary_sensor/rc522.rst @@ -42,7 +42,7 @@ you can then create individual binary sensors that track if an NFC/RFID tag is c spi: rc522_spi: - cs_pin: GPIO15 + cs_pin: GPIOXX binary_sensor: - platform: rc522 diff --git a/components/bluetooth_proxy.rst b/components/bluetooth_proxy.rst index b976d10be..10c38bb32 100644 --- a/components/bluetooth_proxy.rst +++ b/components/bluetooth_proxy.rst @@ -32,7 +32,7 @@ our `Bluetooth Proxy installer `__ The :doc:`web_server` component should be disabled as the device is likely to run out of memory and will malfunction when both components are enabled simultaneously. - + Not all devices are supported and ESPHome does not decode or keep a list. To find out if your device is supported, please search for it in the `Home Assistant Integrations `__ list. @@ -43,15 +43,11 @@ Configuration: bluetooth_proxy: -- **active** (*Optional*, boolean): Enables proxying active connections. Defaults to ``false``. Requires Home Assistant 2022.10 or later. +- **active** (*Optional*, boolean): Enables proxying active connections. Defaults to ``false``. - **cache_services** (*Optional*, boolean): Enables caching GATT services in NVS flash storage which significantly speeds up active connections. Defaults to ``true`` when using the ESP-IDF framework. The Bluetooth proxy depends on :doc:`esp32_ble_tracker` so make sure to add that to your configuration. -.. note:: - - Bluetooth proxy requires Home Assistant 2022.9 or later. ESPHome 2022.12.0 and Home Assistant 2022.12.6 or later is recommended. - Improving reception performance ------------------------------- diff --git a/components/button/output.rst b/components/button/output.rst index 9e83019a1..d037730fc 100644 --- a/components/button/output.rst +++ b/components/button/output.rst @@ -17,7 +17,7 @@ momentarily set a GPIO pin using a button. # Example configuration entry output: - platform: gpio - pin: 25 + pin: GPIOXX id: output1 button: diff --git a/components/button/uart.rst b/components/button/uart.rst index 5799e5b8d..565e42af2 100644 --- a/components/button/uart.rst +++ b/components/button/uart.rst @@ -11,10 +11,6 @@ The ``uart`` button platform allows you to send a pre-defined sequence of bytes .. code-block:: yaml # Example configuration entry - uart: - baud_rate: 9600 - tx_pin: D0 - button: - platform: uart name: "UART String Output" diff --git a/components/canbus.rst b/components/canbus.rst index 8656ab0e4..8c562f626 100644 --- a/components/canbus.rst +++ b/components/canbus.rst @@ -69,7 +69,7 @@ Configuration variables: - ``12K5BPS`` - Support by ``esp32_can`` depends on ESP32 variant - ``16KBPS`` - Support by ``esp32_can`` depends on ESP32 variant - ``20KBPS`` - Support by ``esp32_can`` depends on ESP32 variant - - ``25KBPS`` + - ``25KBPS`` - ``31K25BPS`` - Not supported by ``esp32_can`` - ``33KBPS`` - Not supported by ``esp32_can`` - ``40KBPS`` - Not supported by ``esp32_can`` @@ -197,8 +197,8 @@ You only need to specify the RX and TX pins. Any GPIO will work. # Example configuration entry canbus: - platform: esp32_can - tx_pin: GPIO5 - rx_pin: GPIO4 + tx_pin: GPIOXX + rx_pin: GPIOXX can_id: 4 bit_rate: 50kbps on_frame: @@ -209,28 +209,28 @@ You only need to specify the RX and TX pins. Any GPIO will work. The table lists the specific bit rates supported by the component for ESP32 variants: =================== ======= ========== ========== ========== ========== ========== - bit_rate ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6 ESP32-H2 + bit_rate ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6 ESP32-H2 =================== ======= ========== ========== ========== ========== ========== - 1KBPS x x x x x - 5KBPS x x x x x - 10KBPS x x x x x - 12K5BPS x x x x x - 16KBPS x x x x x - 20KBPS x x x x x - 25KBPS x x x x x x - 31K25BPS - 33KBPS - 40KBPS - 50KBPS x x x x x x - 80KBPS - 83K38BPS - 95KBPS - 100KBPS x x x x x x - 125KBPS (Default) x x x x x x - 250KBPS x x x x x x - 500KBPS x x x x x x - 800KBPS x x x x x x - 1000KBPS x x x x x x + 1KBPS x x x x x + 5KBPS x x x x x + 10KBPS x x x x x + 12K5BPS x x x x x + 16KBPS x x x x x + 20KBPS x x x x x + 25KBPS x x x x x x + 31K25BPS + 33KBPS + 40KBPS + 50KBPS x x x x x x + 80KBPS + 83K38BPS + 95KBPS + 100KBPS x x x x x x + 125KBPS (Default) x x x x x x + 250KBPS x x x x x x + 500KBPS x x x x x x + 800KBPS x x x x x x + 1000KBPS x x x x x x =================== ======= ========== ========== ========== ========== ========== @@ -273,7 +273,7 @@ For wiring up the MSP2515 please refer to the section below. # Example configuration entry canbus: - platform: mcp2515 - cs_pin: D5 + cs_pin: GPIOXX can_id: 4 bit_rate: 50kbps on_frame: @@ -359,7 +359,7 @@ Standard IDs and Extended IDs can coexist on the same segment. - platform: mcp2515 id: my_mcp2515 spi_id: McpSpi - cs_pin: GPIO14 + cs_pin: GPIOXX can_id: 0x1fff use_extended_id: true bit_rate: 125kbps @@ -385,9 +385,9 @@ Button is connected on a can node which sends an A message on ID 0x100 with payl spi: id: McpSpi - clk_pin: GPIO16 - mosi_pin: GPIO5 - miso_pin: GPIO4 + clk_pin: GPIOXX + mosi_pin: GPIOXX + miso_pin: GPIOXX binary_sensor: - platform: template @@ -398,7 +398,7 @@ Button is connected on a can node which sends an A message on ID 0x100 with payl - platform: mcp2515 id: my_mcp2515 spi_id: McpSpi - cs_pin: GPIO14 + cs_pin: GPIOXX can_id: 4 bit_rate: 125kbps on_frame: @@ -430,15 +430,15 @@ Buttons are connected on the CAN-Node and also the motor is connected via CAN. spi: id: McpSpi - clk_pin: GPIO16 - mosi_pin: GPIO5 - miso_pin: GPIO4 + clk_pin: GPIOXX + mosi_pin: GPIOXX + miso_pin: GPIOXX canbus: - platform: mcp2515 id: my_mcp2515 spi_id: McpSpi - cs_pin: GPIO14 + cs_pin: GPIOXX can_id: 4 bit_rate: 125kbps on_frame: diff --git a/components/climate/climate_ir.rst b/components/climate/climate_ir.rst index 249f181a4..9cb410abc 100644 --- a/components/climate/climate_ir.rst +++ b/components/climate/climate_ir.rst @@ -76,7 +76,7 @@ controller unit. # Example configuration entry remote_transmitter: - pin: GPIO32 + pin: GPIOXX carrier_duty_percent: 50% climate: @@ -156,7 +156,7 @@ IR receiver. remote_receiver: id: rcvr pin: - number: GPIO14 + number: GPIOXX inverted: true mode: input: true @@ -283,8 +283,8 @@ Configuration variables: - **set_fan_mode** (*Optional*, string): Select the fan modes desired or that are supported on your remote. Defaults to ``3levels`` - - Options are: ``3levels`` , ``4levels``, ``quiet_4levels``. - + - Options are: ``3levels`` , ``4levels``, ``quiet_4levels``. + - ``3levels``; Low [fan speed 1], Medium [2], High [3] - ``4levels``; Low [1], Middle [2], Medium [3], High [4] - ``quiet_4levels``; Low [1], Middle [2], Medium [3], High [4], Quiet [5] @@ -292,10 +292,10 @@ Configuration variables: - **supports_dry** (*Optional*, boolean): Enables setting dry mode for this unit. Defaults to ``false``. - **supports_fan_only** (*Optional*, boolean): Enables setting fan only mode for this unit. Confirm that mode is supported on your remote. Defaults to ``false``. -- **horizontal_default** (*Optional*, string): What to default to when the AC unit's horizontal direction is *not* set to swing. Defaults to ``middle``. +- **horizontal_default** (*Optional*, string): What to default to when the AC unit's horizontal direction is *not* set to swing. Defaults to ``middle``. - Options are: ``left``, ``middle-left``, ``middle``, ``middle-right``, ``right``, ``auto`` -- **vertical_default** (*Optional*, string): What to default to when the AC unit's vertical direction is *not* set to swing. Defaults to ``middle``. +- **vertical_default** (*Optional*, string): What to default to when the AC unit's vertical direction is *not* set to swing. Defaults to ``middle``. - Options are: ``down``, ``middle-down``, ``middle``, ``middle-up``, ``up``, ``auto`` @@ -423,8 +423,8 @@ Configuration variables: ``zhlt01`` Climate --------------------- -ZH/LT-01 is a remote control that is used with many locally branded split airconditioners. -Supported brands include: +ZH/LT-01 is a remote control that is used with many locally branded split airconditioners. +Supported brands include: - Eurom - Chigo diff --git a/components/climate/custom.rst b/components/climate/custom.rst index e4d86f19e..1544fa9f1 100644 --- a/components/climate/custom.rst +++ b/components/climate/custom.rst @@ -1,21 +1,27 @@ Custom Climate ============== +.. seo:: + :description: Instructions for setting up Custom C++ climate components with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create custom climate devices in ESPHome -using the C++ (Arduino) API. +.. warning:: -Please first read :doc:`/components/sensor/custom` guide, -the same principles apply here. + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + +This component can be used to create custom climate devices in ESPHome using the C++ (Arduino) API. + +Please first read :doc:`/components/sensor/custom` guide, the same principles apply here. The example below is an example of a custom climate device - all climate devices must override two methods (:apiclass:`Climate `): diff --git a/components/climate/haier.rst b/components/climate/haier.rst index caf04d18e..843ecfa0b 100644 --- a/components/climate/haier.rst +++ b/components/climate/haier.rst @@ -58,18 +58,11 @@ This component requires a :ref:`uart` to be setup. .. code-block:: yaml # Example configuration entry - - uart: - baud_rate: 9600 - tx_pin: 17 - rx_pin: 16 - id: ac_port - climate: - platform: haier id: haier_ac protocol: hOn - name: Haier AC + name: Haier AC uart_id: ac_port wifi_signal: true beeper: true diff --git a/components/climate/index.rst b/components/climate/index.rst index dde76b23b..263913e73 100644 --- a/components/climate/index.rst +++ b/components/climate/index.rst @@ -80,10 +80,10 @@ Advanced options: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. MQTT options: diff --git a/components/climate/midea.rst b/components/climate/midea.rst index fc560077e..cec59359c 100644 --- a/components/climate/midea.rst +++ b/components/climate/midea.rst @@ -25,17 +25,6 @@ The ``midea`` component creates a Midea air conditioner climate device. .. code-block:: yaml # Example configuration entry - - # Disable logging over UART (required) - logger: - baud_rate: 0 - - # UART settings for Midea dongle (required) - uart: - tx_pin: 1 # hardware dependant - rx_pin: 3 # hardware dependant - baud_rate: 9600 - # Main settings climate: - platform: midea diff --git a/components/copy.rst b/components/copy.rst index 93f21c6d4..5cc7191c8 100644 --- a/components/copy.rst +++ b/components/copy.rst @@ -1,11 +1,11 @@ -Copy Integration -================ +Copy Component +============== .. seo:: - :description: Instructions for setting up the copy integration in ESPHome + :description: Instructions for setting up the copy component in ESPHome :image: content-copy.svg -The ``copy`` integration can be used to copy an existing component (like a sensor, switch, etc.) +The ``copy`` component can be used to copy an existing component (like a sensor, switch, etc.) and create a duplicate mirroring the source's state and forwarding actions such as turning on to the source. For each of the supported platforms, the configuration consists of the required configuration diff --git a/components/cover/custom.rst b/components/cover/custom.rst index 4b49dbc5c..c623a54f9 100644 --- a/components/cover/custom.rst +++ b/components/cover/custom.rst @@ -1,24 +1,29 @@ Custom Cover ============ +.. seo:: + :description: Instructions for setting up Custom C++ covers with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create custom covers in ESPHome -using the C++ (Arduino) API. +.. warning:: -Please first read :doc:`/components/sensor/custom` guide, -the same principles apply here. + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. -The example below is an example of a custom cover - all covers must override -two methods: +This component can be used to create custom covers in ESPHome using the C++ (Arduino) API. + +Please first read :doc:`/components/sensor/custom` guide, the same principles apply here. + +The example below is an example of a custom cover - all covers must override two methods: - ``get_traits``: This should return a :apiclass:`CoverTraits ` object representing the capabilities of the cover. diff --git a/components/cover/index.rst b/components/cover/index.rst index abc95bec2..146f4db9e 100644 --- a/components/cover/index.rst +++ b/components/cover/index.rst @@ -46,10 +46,10 @@ Advanced options: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. MQTT options: diff --git a/components/cover/time_based.rst b/components/cover/time_based.rst index 0f5e542dd..e5a5150e9 100644 --- a/components/cover/time_based.rst +++ b/components/cover/time_based.rst @@ -77,7 +77,22 @@ Configuration variables: ``esp8266_restore_from_flash: true`` option set. See :doc:`esp8266_restore_from_flash ` for details. +Handle stop_action: +------------------------ +For some cover controllers, separate switches for UP and DOWN action are used while a stop is issued when sending a counter command. +This can be handled at the **stop_action** by using the folling lamda function: +.. code-block:: yaml + + stop_action: + - lambda: !lambda |- + if (id(cover).last_operation() == CoverOperation::COVER_OPERATION_OPENING) { + // Cover is currently opening + id(cover_button_down).press(); + } else if (id(cover).last_operation() == CoverOperation::COVER_OPERATION_CLOSING) { + // Cover is currently closing + id(cover_button_up).press(); + } See Also -------- diff --git a/components/cover/tuya.rst b/components/cover/tuya.rst index 2293cdd63..917b87545 100644 --- a/components/cover/tuya.rst +++ b/components/cover/tuya.rst @@ -45,7 +45,7 @@ Configuration variables: Supported devices ----------------- -Tuya cover devices known to be supported by this integration: +Tuya cover devices known to be supported by this component: - Tuya ``M515EGWT`` (motor for bead chain roller blinds) diff --git a/components/datetime/index.rst b/components/datetime/index.rst index 26ff54eea..c13c979a5 100644 --- a/components/datetime/index.rst +++ b/components/datetime/index.rst @@ -42,22 +42,27 @@ Configuration variables: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. +- **time_id** (**Required**, :ref:`config-id`): The ID of the time entity. Automatically set + to the ID of a time component if only a single one is defined. MQTT Options: - All other options from :ref:`MQTT Component `. -Datetime Automation -------------------- +Time and DateTime Options: -You can access the most recent state as a string of the datetime in :ref:`lambdas ` using -``id(datetime_id).state``. -You can also access it as a ``ESPTime`` object by ``id(datetime_id).state_as_time`` +- **on_time** (*Optional*, :ref:`automation`): Automation to run when the current datetime or time matches the current state. + Only valid on ``time`` or ``datetime`` types. + +Automation +---------- + +You can access the most recent state as a ``ESPTime`` object by ``id(datetime_id).state_as_esptime()`` .. _datetime-on_value: @@ -225,14 +230,94 @@ advanced stuff (see the full API Reference for more info). ESP_LOGI("main", "Value of my datetime: %0d:%02d:%02d", id(my_time).hour, id(my_time).minute, id(my_time).second); +DateTime Automation +------------------- + +.. _datetime-datetime_set_action: + +``datetime.datetime.set`` Action +******************************** + +This is an :ref:`Action ` for setting a datetime datetime state. +The ``datetime`` provided can be in one of 3 formats: + +.. code-block:: yaml + + # String datetime + - datetime.time.set: + id: my_datetime + datetime: "2024-12-31 12:34:56" + + # Individual datetime parts + - datetime.datetime.set: + id: my_datetime + datetime: + year: 2024 + month: 12 + day: 31 + hour: 12 + minute: 34 + second: 56 + + # Using a lambda + - datetime.datetime.set: + id: my_datetime + datetime: !lambda |- + // Return an ESPTime struct + return {.second: 56, .minute: 34, .hour: 12, .day_of_month: 31, .month: 12, .year: 2024}; + +Configuration variables: + +- **id** (**Required**, :ref:`config-id`): The ID of the datetime to set. +- **datetime** (**Required**, string, datetime parts, :ref:`templatable `): + The value to set the datetime to. + + +.. _datetime-datetime-lambda_calls: + +Lambda calls +************ + +For more complex use cases, several methods are available for use on datetimes from within :ref:`lambdas `. See the full API Reference for more information. + +- ``.make_call()``: Make a call for updating the datetime value. + + .. code-block:: cpp + + // Within lambda, set the datetime to 2024-12-31 12:34:56 + auto call = id(my_datetime).make_call(); + call.set_date("2024-12-31 12:34:56"); + call.perform(); + + Check the API reference for information on the methods that are available for + the ``DateTimeCall`` object. + +- ``.year``: Retrieve the current year of the ``datetime``. It will be ``0`` if no value has been set. +- ``.month``: Retrieve the current month of the ``datetime``. It will be ``0`` if no value has been set. +- ``.day``: Retrieve the current day of the ``datetime``. It will be ``0`` if no value has been set. +- ``.hour``: Retrieve the current hour of the ``datetime``. It will be ``0`` if no value has been set. +- ``.minute``: Retrieve the current minute of the ``datetime``. It will be ``0`` if no value has been set. +- ``.second``: Retrieve the current second of the ``datetime``. It will be ``0`` if no value has been set. +- ``.state_as_esptime()``: Retrieve the current value of the datetime as a :apistruct:`ESPTime` object. + + .. code-block:: cpp + + // For example, create a custom log message when a value is received: + ESP_LOGI("main", "Value of my datetime: %04d-%02d-%02d %0d:%02d:%02d", + id(my_datetime).year, id(my_datetime).month, id(my_datetime).day, + id(my_datetime).hour, id(my_datetime).minute, id(my_datetime).second); + + See Also -------- - :apiref:`DateTimeBase ` - :apiref:`DateEntity ` - :apiref:`DateCall ` -- :apiref:`TimeeEntity ` +- :apiref:`TimeEntity ` - :apiref:`TimeCall ` +- :apiref:`DateTimeEntity ` +- :apiref:`DateTimeCall ` - :ghedit:`Edit` .. toctree:: diff --git a/components/datetime/template.rst b/components/datetime/template.rst index 3619db27e..e99161908 100644 --- a/components/datetime/template.rst +++ b/components/datetime/template.rst @@ -29,6 +29,15 @@ using :ref:`lambdas `. initial_value: "12:34:56" restore_value: true + # Example DateTime + - platform: template + id: my_datetime + type: datetime + name: Pick a DateTime + optimistic: yes + initial_value: "2024-12-31 12:34:56" + restore_value: true + Configuration variables: ------------------------ @@ -72,6 +81,21 @@ Configuration variables: minute: 34 second: 56 + - For ``type: datetime``: + + - A string in the format ``%Y-%m-%d %H:%M:%S`` , eg: ``"2023-12-04 12:34:56"``. + - An object including ``year``, ``month``, ``day``, ``hour``, ``minute``, ``second``. + + .. code-block:: yaml + + initial_value: + year: 2023 + month: 12 + day: 4 + hour: 12 + minute: 34 + second: 56 + - All other options from :ref:`Datetime `. See Also diff --git a/components/demo.rst b/components/demo.rst index faccce99f..65eef4b51 100644 --- a/components/demo.rst +++ b/components/demo.rst @@ -1,12 +1,12 @@ -Demo Integration -================ +Demo Component +============== .. seo:: - :description: Instructions for setting up the demo integration in ESPHome + :description: Instructions for setting up the demo component in ESPHome :image: description.svg -The ``demo`` integration can be used for testing to generate sample instances of many -different integrations (sensors, lights, ...) +The ``demo`` component can be used for testing to generate sample instances of many +different components (sensors, lights, ...) .. figure:: images/demo-ui.png :align: center @@ -20,7 +20,7 @@ different integrations (sensors, lights, ...) Configuration variables: ------------------------ -This integration has no configuration variables +This component has no configuration variables See Also -------- diff --git a/components/dfplayer.rst b/components/dfplayer.rst index 9b2f5e655..672cc4615 100644 --- a/components/dfplayer.rst +++ b/components/dfplayer.rst @@ -2,7 +2,7 @@ DF-Player mini ============== .. seo:: - :description: Instructions for setting up DF Player Mini integration in ESPHome. + :description: Instructions for setting up DF Player Mini component in ESPHome. :image: dfplayer.svg The ``dfplayer`` (`datasheet `__), component @@ -14,8 +14,7 @@ allows you to play sound and music stored in an SD card or USB flash drive. DF-Player mini Module. -For this integration to work you need to have set up a :ref:`UART bus ` -in your configuration. +For this component to work you need to have set up a :ref:`UART bus ` in your configuration. Overview -------- @@ -31,16 +30,7 @@ will be required. .. code-block:: yaml # Example configuration entry - uart: - tx_pin: GPIO2 - rx_pin: GPIO5 - baud_rate: 9600 - - # Declare DFPlayer mini module dfplayer: - on_finished_playback: - then: - logger.log: 'Somebody press play!' Configuration variables: ------------------------ @@ -114,11 +104,11 @@ Configuration options: ``dfplayer.play_mp3`` Action ---------------------------- -Plays a track inside the folder ``mp3``. Files inside the folder must be numbered from 1 +Plays a track inside the folder ``mp3``. Files inside the folder must be numbered from 1 to 9999, like ``0001.mp3``, ``0002.mp3``, ... etc. -The folder name needs to be ``mp3``, placed under the SD card root directory, and the -mp3 file name needs to be 4 digits, for example, "0001.mp3", placed under the mp3 folder. -If you want, you can add additional text after the number in the filename, for example, +The folder name needs to be ``mp3``, placed under the SD card root directory, and the +mp3 file name needs to be 4 digits, for example, "0001.mp3", placed under the mp3 folder. +If you want, you can add additional text after the number in the filename, for example, ``0001hello.mp3``, but must always be referenced by number only in yaml. .. code-block:: bash @@ -345,8 +335,8 @@ Sample code .. code-block:: yaml uart: - tx_pin: GPIO2 - rx_pin: GPIO5 + tx_pin: GPIOXX + rx_pin: GPIOXX baud_rate: 9600 dfplayer: diff --git a/components/display/addressable_light.rst b/components/display/addressable_light.rst index 44c125b7e..8f9e39481 100644 --- a/components/display/addressable_light.rst +++ b/components/display/addressable_light.rst @@ -19,18 +19,6 @@ The display requires that an :apiclass:`AddressableLight `): A lambda that returns the integer address of the LED - given the supplied the ``x`` and ``y`` pixel coordinate. By default, a left-to-right direct pixel mapper is used. + given the supplied the ``x`` and ``y`` pixel coordinate. By default, a left-to-right direct pixel mapper is used. - **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display. ``it`` will be an instance of :apiclass:`DisplayBuffer `. - See :ref:`display-engine` for more information. + See :ref:`display-engine` for more information. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. @@ -73,7 +61,7 @@ Configuration variables: When enabled (the default, but also via ``it.set_enabled(true)``), any effect currently running on the addressable light will be disabled. When disabled (``it.set_enabled(false)``), the last configured effect will be restored. - + While the display is enabled, it is still possible to control the parent addressable light component in some limited capacity. Changing the brightness will still work, but changing the color will have no affect. It is not adivsable to enable any effects (ex: rainbow, color wipe, etc) while the display is enabled, as this will cause a diff --git a/components/display/ili9xxx.rst b/components/display/ili9xxx.rst index f734b2a13..7bd3ddecc 100644 --- a/components/display/ili9xxx.rst +++ b/components/display/ili9xxx.rst @@ -55,8 +55,8 @@ beyond the basic SPI connections, and a reasonable amount of RAM, it is not well display: - platform: ili9xxx model: ili9341 - dc_pin: 27 - reset_pin: 33 + dc_pin: GPIOXX + reset_pin: GPIOXX lambda: |- it.fill(COLOR_BLACK); it.print(0, 0, id(my_font), id(my_red), TextAlign::TOP_LEFT, "Hello World!"); @@ -180,13 +180,13 @@ To configure a dimmable backlight: # Define a PWM output on the ESP32 output: - platform: ledc - pin: 32 - id: gpio_32_backlight_pwm + pin: GPIOXX + id: backlight_pwm # Define a monochromatic, dimmable light for the backlight light: - platform: monochromatic - output: gpio_32_backlight_pwm + output: backlight_pwm name: "Display Backlight" id: back_light restore_mode: ALWAYS_ON @@ -204,8 +204,8 @@ To configure an image adaptive color pallet to show greater than 8 bit color dep display: - platform: ili9xxx model: ili9341 - dc_pin: 4 - reset_pin: 22 + dc_pin: GPIOXX + reset_pin: GPIOXX rotation: 90 id: tft_ha color_palette: IMAGE_ADAPTIVE @@ -234,7 +234,7 @@ This config rotates the display into landscape mode using the driver chip. mirror_y: true color_order: bgr data_rate: 80MHz - cs_pin: 10 + cs_pin: GPIOXX dc_pin: GPIO13 reset_pin: GPIO9 diff --git a/components/display/images/display_rendering_colors.png b/components/display/images/display_rendering_colors.png new file mode 100644 index 000000000..df5830179 Binary files /dev/null and b/components/display/images/display_rendering_colors.png differ diff --git a/components/display/images/display_rendering_graph.png b/components/display/images/display_rendering_graph.png new file mode 100644 index 000000000..9c2c30d45 Binary files /dev/null and b/components/display/images/display_rendering_graph.png differ diff --git a/components/display/images/display_rendering_line.png b/components/display/images/display_rendering_line.png new file mode 100644 index 000000000..633c0d42a Binary files /dev/null and b/components/display/images/display_rendering_line.png differ diff --git a/components/display/images/display_rendering_shapes.png b/components/display/images/display_rendering_shapes.png new file mode 100644 index 000000000..b6a034710 Binary files /dev/null and b/components/display/images/display_rendering_shapes.png differ diff --git a/components/display/images/display_rendering_text.png b/components/display/images/display_rendering_text.png new file mode 100644 index 000000000..3e5fb7834 Binary files /dev/null and b/components/display/images/display_rendering_text.png differ diff --git a/components/display/images/graph_dualtrace.png b/components/display/images/graph_dualtrace.png deleted file mode 100644 index 4beeacf91..000000000 Binary files a/components/display/images/graph_dualtrace.png and /dev/null differ diff --git a/components/display/images/graph_screen.png b/components/display/images/graph_screen.png deleted file mode 100644 index a47ed6ca5..000000000 Binary files a/components/display/images/graph_screen.png and /dev/null differ diff --git a/components/display/images/test_card.jpg b/components/display/images/test_card.jpg new file mode 100644 index 000000000..49ba2cf8a Binary files /dev/null and b/components/display/images/test_card.jpg differ diff --git a/components/display/index.rst b/components/display/index.rst index c57a85106..0dd4a1eab 100644 --- a/components/display/index.rst +++ b/components/display/index.rst @@ -2,7 +2,7 @@ Display Component ================= .. seo:: - :description: Instructions for setting up the display integration. + :description: Instructions for setting up the display component. :image: folder-open.svg The ``display`` component houses ESPHome's powerful rendering and display @@ -45,6 +45,9 @@ this behavior by setting ``auto_clear_enabled: false``. In the lambda, you can write code like in any :ref:`lambda ` in ESPHome. Display lambdas are additionally passed a variable called ``it`` which represents the rendering engine object. +.. figure:: images/display_rendering_line.png + :align: center + .. code-block:: yaml display: @@ -74,8 +77,10 @@ the rendering engine is always first specify the ``x`` coordinate and then the ` Basic Shapes ------------ -Now that you know a bit more about ESPHome's coordinate system, let's draw some basic shapes like lines, rectangles -and circles: +Now that you know a bit more about ESPHome's coordinate system, let's draw some basic shapes like lines, rectangles, circles or even polygons: + +.. figure:: images/display_rendering_shapes.png + :align: center .. code-block:: yaml @@ -85,31 +90,27 @@ and circles: lambda: |- // Draw a line from [0,0] to [100,50] it.line(0, 0, 100, 50); - // Draw an angled line from [0,0] at 45° with a length of 30 - it.line_at_angle(0, 0, 45, 30); - // Draw an angled line from [0,0] at 30° with a start radius of 10 and stop radius of 20 - it.line_at_angle(0, 0, 30, 10, 20); - // Draw the outline of a rectangle with the top left at [50,60], a width of 30 and a height of 42 - it.rectangle(50, 60, 30, 42); - // Draw the same rectangle, but this time filled. - it.filled_rectangle(50, 60, 30, 42); + // Draw the outline of a rectangle with the top left at [5,20], a width of 30 and a height of 42 + it.rectangle(5, 20, 30, 42); + // Draw the same rectangle a few pixels apart, but this time filled + it.filled_rectangle(40, 40, 30, 42); - // Circles! Let's draw one with the center at [25,25] and a radius of 10 - it.circle(25, 25, 10); + // Circles! Let's draw one with the center at [20,40] and a radius of 10 + it.circle(20, 40, 10); // ... and the same thing filled again - it.filled_circle(25, 25, 10); + it.filled_circle(20, 75, 10); // Triangles... Let's draw the outline of a triangle from the [x,y] coordinates of its three points - // [25,5], [5,25], [50,50] - it.triangle(25, 5, 5, 25, 50, 50); + // [25,5], [100,5], [80,25] + it.triangle(25, 5, 100, 5, 80, 25); // and a filled triangle ! - it.filled_triangle(125, 5, 105, 25, 150, 50); + it.filled_triangle(115, 5, 95, 25, 125, 70); - // Regular Polygons? Let's draw the outline of a pointy-topped hexagon inscribed in a circle - // centered on [x1=100,y1=100] with a radius of 50 - it.regular_polygon(100, 100, 50, EDGES_HEXAGON); - // and a filled flat-topped octagon! - it.filled_regular_polygon(200, 200, 50, EDGES_OCTAGON, VARIATION_FLAT_TOP); + // Regular Polygons? Let's draw a filled, pointy-topped hexagon inscribed in a circle + // centered on [170,45] with a radius of 20 + it.filled_regular_polygon(170, 45, 20, EDGES_HEXAGON); + // and the outline of flat-topped octagon around it! + it.regular_polygon(170, 45, 40, EDGES_OCTAGON, VARIATION_FLAT_TOP); // Need to rotate the polygon, or retrieve the coordinates of its vertices? Check the API! All the above methods can optionally also be called with an argument at the end which specifies in which @@ -121,33 +122,35 @@ color to draw. For monochrome displays, only ``COLOR_ON`` (the default if color - platform: ... # ... lambda: |- - // Turn the whole display on. + // Turn the whole display on it.fill(COLOR_ON); - // Turn the whole display off. + // Turn the whole display off it.fill(COLOR_OFF); // Turn a single pixel off at [50,60] it.draw_pixel_at(50, 60, COLOR_OFF); - // Turn off a whole display portion. - it.rectangle(50, 50, 30, 42, COLOR_OFF); - For color displays (e.g. TFT displays), you can use the Color class. +.. figure:: images/display_rendering_colors.png + :align: center + .. code-block:: yaml display: - platform: ... # ... lambda: |- + auto black = Color(0, 0, 0); auto red = Color(255, 0, 0); auto green = Color(0, 255, 0); auto blue = Color(0, 0, 255); auto white = Color(255, 255, 255); - it.rectangle(20, 50, 30, 30, white); - it.rectangle(25, 55, 30, 30, red); - it.rectangle(30, 60, 30, 30, green); - it.rectangle(35, 65, 30, 30, blue); + it.filled_circle(20, 32, 15, black); + it.filled_circle(40, 32, 15, red); + it.filled_circle(60, 32, 15, green); + it.filled_circle(80, 32, 15, blue); + it.filled_circle(100, 32, 15, white); Additionally, you have access to two helper methods which will fetch the width and height of the display: @@ -160,6 +163,8 @@ Additionally, you have access to two helper methods which will fetch the width a // Draw a circle in the middle of the display it.filled_circle(it.get_width() / 2, it.get_height() / 2, 20); + // Turn off bottom half of the screen + it.filled_rectangle(0, it.get_height()/2, it.get_width(), it.get_height()/2, COLOR_OFF); You can view the full API documentation for the rendering engine in the "API Reference" in the See Also section. @@ -222,6 +227,10 @@ In case of fonts rendered at higher bit depths, the background color has to be s // Syntax is always: it.print(, , , [color=COLOR_ON], [align], , [color=COLOR_OFF]); it.print(0, 0, id(my_font_with_icons), COLOR_ON, TextAlign::CENTER, "Just\U000f05d4here. Already\U000F02D1this.", COLOR_OFF); + +.. figure:: images/display_rendering_text.png + :align: center + .. _display-printf: Formatted Text @@ -461,13 +470,8 @@ memory at the time the sensor updates and will be lost when the device reboots. Examples: -.. figure:: images/graph_screen.png +.. figure:: images/display_rendering_graph.png :align: center - :width: 60.0% - -.. figure:: images/graph_dualtrace.png - :align: center - :width: 60.0% Graph component with options for grids, border and line-types. @@ -931,49 +935,30 @@ Additionally the old page will be given as the variable ``from`` and the new one Troubleshooting --------------- -Color Test Pattern ------------------- +Using the Color Test Card +------------------------- -If you're experiencing issues with your color display, the script below can help you to identify what might be wrong. -It will show 3 color bars in **RED**, **GREEN** and **BLUE**. To help the graphics display team determine -the best way to help you, **a picture of the result of this script is very helpful.** +If you're experiencing issues with your color display, the ``show_test_card: true`` option can help you to identify what might be wrong. + +- It will show bars for Red, Green and Blue, graduating to black and white. +- Together with that it will show the letters "**R**", "**G**" and "**B**" to validate the display geometry. +- There will be a rectangle around the corners of the display with a marker at the 0,0 corner which should be at the top left of the screen. + +.. figure:: images/test_card.jpg + :align: center + :width: 50.0% + + + +When all points above are shown correctly then the display is working as expected. +To help the graphics display team determine the best way to help you, **a picture of the result of this option is very helpful.** Should you `create an issue `__ in GitHub regarding your display, please -be sure to **include a link to where you purchased it** so that we can validate the configuration you've used. +be sure to **include a link to where you purchased the display** so that we can validate the configuration you've used. -.. code-block:: yaml +.. note:: - display: - - platform: ... - ... - lambda: |- - int shift_x = (it.get_width()-310)/2; - int shift_y = (it.get_height()-256)/2; - for(auto i = 0; i<256; i++) { - it.horizontal_line(shift_x+ 0,i+shift_y,50, my_red.fade_to_white(i)); - it.horizontal_line(shift_x+ 50,i+shift_y,50, my_red.fade_to_black(i)); - - it.horizontal_line(shift_x+105,i+shift_y,50, my_green.fade_to_white(i)); - it.horizontal_line(shift_x+155,i+shift_y,50, my_green.fade_to_black(i)); - - it.horizontal_line(shift_x+210,i+shift_y,50, my_blue.fade_to_white(i)); - it.horizontal_line(shift_x+260,i+shift_y,50, my_blue.fade_to_black(i)); - } - it.rectangle(shift_x+ 0, 0+shift_y, shift_x+ 310, 256+shift_y, my_yellow); - - color: - - id: my_blue - blue: 100% - - id: my_red - red: 100% - - id: my_green - green: 100% - - id: my_white - red: 100% - blue: 100% - green: 100% - - id: my_yellow - hex: ffff00 + For displays in 8 bit mode you will see distinct color blocks rather than a smooth gradient. See Also -------- diff --git a/components/display/lcd_display.rst b/components/display/lcd_display.rst index 005de6c4c..c1bbf04e3 100644 --- a/components/display/lcd_display.rst +++ b/components/display/lcd_display.rst @@ -2,12 +2,12 @@ Character-Based LCD Display =========================== .. seo:: - :description: Instructions for setting up character-based HD44780 LCD displays. + :description: Instructions for setting up character-based HD44780 LCDs. :image: lcd.jpg -The ``lcd_pcf8574`` and ``lcd_gpio`` display components allow you to use HD44780-compatible, character-based LCD displays -with ESPHome. This integration is only for LCD displays that display individual characters on a screen -(usually 8-40 columns and 2-4 rows), and not for LCD displays that can control each pixel individually. +The ``lcd_pcf8574`` and ``lcd_gpio`` display components allow you to use HD44780-compatible, character-based LCDs +with ESPHome. This component is only for LCDs that display individual characters on a screen +(usually 8-40 columns and 2-4 rows), and not for LCDs that can control each pixel individually. .. figure:: images/lcd-hello_world.jpg :align: center @@ -15,12 +15,12 @@ with ESPHome. This integration is only for LCD displays that display individual .. note:: - Multiple versions of the display exist, supporting different character sets: - + Multiple versions of the display exist, supporting different character sets: + - HD44780UA00 English-Japanese which includes katakana characters, some Greek letters and mathematical symbols - HD44780UA02 English-European which includes Greek, Cyrillic and Western European characters (with some diacritics) - HD44780UBxx custom, manufacturer-specific character sets - + It is also possible to add eight user-defined characters. .. _lcd-pcf8574: @@ -28,7 +28,7 @@ with ESPHome. This integration is only for LCD displays that display individual lcd_pcf8574 Component --------------------- -``lcd_pcf8574`` is for LCD displays with a PCF8574 GPIO expander module connected to all the data pins. This has the +``lcd_pcf8574`` is for LCD displays with a PCF8574 GPIO expander module connected to all the data pins. This has the benefit that you only need to connect two data wires to the ESP instead of the six or ten as with the :ref:`lcd-gpio`. The communication happens via :ref:`I²C Bus `, you need to have an ``i2c:`` section in your configuration. @@ -65,7 +65,7 @@ Configuration variables: .. note:: - If you're not seeing anything on the display, try turning the contrast potentiometer around on the + If you're not seeing anything on the display, try turning the contrast potentiometer around on the PCF8574 board. .. _lcd-gpio: @@ -74,7 +74,7 @@ lcd_gpio Component ------------------ The ``lcd_gpio`` version of this component addresses the screen directly and does not employ a GPIO expander module. -Each of the data pins of the LCD needs a dedicated GPIO pin on the ESP. Connecting the screen this way offers +Each of the data pins of the LCD needs a dedicated GPIO pin on the ESP. Connecting the screen this way offers faster refresh, especially in conjunction with an :ref:`LCD Menu `. .. figure:: images/lcd_gpio.svg @@ -90,12 +90,12 @@ faster refresh, especially in conjunction with an :ref:`LCD Menu `. - platform: lcd_gpio dimensions: 20x4 data_pins: - - GPIO32 - - GPIO33 - - GPIO5 - - GPIO17 - enable_pin: D4 - rs_pin: D5 + - GPIOXX + - GPIOXX + - GPIOXX + - GPIOXX + enable_pin: GPIOXX + rs_pin: GPIOXX lambda: |- it.print("Hello World!"); @@ -105,8 +105,8 @@ Configuration variables: - **dimensions** (**Required**, string): The dimensions of the display with ``COLUMNSxROWS``. If you're not sure, power the display on, turn contrast high up and just count them. - **data_pins** (**Required**, list of :ref:`pins `): A list of the data pins you - have hooked up to the LCD. The list can either be 4 items long (operating in 4-bit mode with - either the first 4 data pins connected or the last 4 data pins connected), or 8 items long (when you have + have hooked up to the LCD. The list can either be 4 items long (operating in 4-bit mode with + either the first 4 data pins connected or the last 4 data pins connected), or 8 items long (when you have connected all 8 data pins). - **enable_pin** (**Required**, :ref:`pin `): The pin you have ``E`` (``06``) hooked up to. - **rs_pin** (**Required**, :ref:`pin `): The pin you have ``RS`` (``04``) hooked up to. @@ -118,7 +118,7 @@ Configuration variables: .. note:: - If you're not seeing anything on the display, make sure you apply ``3.3V`` to the ``VEE`` (``03``) contrast control + If you're not seeing anything on the display, make sure you apply ``3.3V`` to the ``VEE`` (``03``) contrast control pin of the board. You can use a potentiometer to make it adjustable. @@ -177,7 +177,7 @@ The LCD display has the possibility to define up to eight user defined character ``0`` to ``7`` and mirrored at ``8`` to ``15`` (i.e. ``\x08`` can be used instead of the ``\0`` that can be problematic in strings). Each character has eight lines of five bits, with the first line on the top and the most significant bit on the left, meaning that ``0b10000`` followed by six zeros and a ``0b00001`` -defines a dot at the upper left and lower right of the character. +defines a dot at the upper left and lower right of the character. .. code-block:: yaml @@ -221,7 +221,7 @@ Keep in mind that the display lambda runs for every ``update_interval``, so if t it cannot be overridden from other parts. With the ``lcd_gpio``, the backlight is lit by applying ``Vcc`` to the ``BLA`` (``15``) pin and connect ``BLK`` (``16``) -pin to ``GND``. The backlight can draw more power than the microcontroller output pins can supply, so it is advisable +pin to ``GND``. The backlight can draw more power than the microcontroller output pins can supply, so it is advisable to use a transistor as a switch to control the power for the backlight pins. Below an example for a typical use-case where the backlight is turned on when a motion sensor activates and diff --git a/components/display/max7219.rst b/components/display/max7219.rst index ad1b1c6c5..11e069f1c 100644 --- a/components/display/max7219.rst +++ b/components/display/max7219.rst @@ -8,7 +8,7 @@ MAX7219 7-Segment Display The ``max7219`` display platform allows you to use MAX7219 7-segment display drivers ( `datasheet `__, `hobbycomponents `__) -with ESPHome. Please note that this integration is *only* for 7-segment display, not matrix configurations. +with ESPHome. Please note that this component is *only* for 7-segment display, not matrix configurations. .. figure:: images/max7219-full.jpg :align: center @@ -16,7 +16,7 @@ with ESPHome. Please note that this integration is *only* for 7-segment display, MAX7219 7-Segment Display. -As the communication with the MAX7219 is done using SPI for this integration, you need +As the communication with the MAX7219 is done using SPI for this component, you need to have an :ref:`SPI bus ` in your configuration with both the **mosi_pin** set (miso_pin is not required). Connect VCC to 3.3V (the manufacturer recommends 4+ V, but 3.3V seems to work fine), DIN to your ``mosi_pin`` and CS to your set ``cs_pin`` and finally GND to GND. diff --git a/components/display/max7219digit.rst b/components/display/max7219digit.rst index 2c7923c43..650ef878e 100644 --- a/components/display/max7219digit.rst +++ b/components/display/max7219digit.rst @@ -5,7 +5,7 @@ MAX7219 Digit Display :description: Instructions for setting up MAX7219 Digit displays. :image: max7219digit.jpg -The ``max7219`` display platform allows you to use MAX7219 digit with ESPHome. Please note that this integration +The ``max7219`` display platform allows you to use MAX7219 digit with ESPHome. Please note that this component is *only* for the digit "matrix" display, for the 7 segment display see :doc:`max7219`. .. figure:: images/max7219digit.png @@ -14,7 +14,7 @@ is *only* for the digit "matrix" display, for the 7 segment display see :doc:`ma MAX7219 Digit Display. -As the communication with the MAX7219 Digit is done using SPI for this integration, you need +As the communication with the MAX7219 Digit is done using SPI for this component, you need to have an :ref:`SPI bus ` in your configuration with both the **mosi_pin** set (miso_pin is not required). Connect VCC to 3.3V (the manufacturer recommends 4+ V, but 3.3V seems to work fine), DIN to your ``mosi_pin`` and CS to your set ``cs_pin`` and finally GND to GND. diff --git a/components/display/nextion.rst b/components/display/nextion.rst index 95c29a89e..09d8a85f9 100644 --- a/components/display/nextion.rst +++ b/components/display/nextion.rst @@ -18,15 +18,15 @@ with ESPHome. As the communication with the Nextion LCD display is done using UART, you need to have an :ref:`UART bus ` in your configuration with ``rx_pin`` both the ``tx_pin`` set to the respective pins on the display. The Nextion uses a baud rate of 9600 by default. It may be configured to use a faster speed by adding (for -example) +example) .. code-block:: c++ baud=115200 // Sets the baud rate to 115200 bkcmd=0 // Tells the Nextion to not send responses on commands. This is the current default but can be set just in case - - + + to the ``program.s`` source file (in the Nextion Editor) before the ``page`` line. This permits faster communication with the Nextion display and it is highly recommended when using :ref:`uart-hardware_uarts`. Without a hardware uart make sure to set the baud rate to 9600. @@ -36,17 +36,9 @@ The below example configures a UART for the Nextion display to use .. code-block:: yaml # Example configuration entry - uart: - id: uart_2 - rx_pin: GPIO16 - tx_pin: GPIO17 - baud_rate: 115200 - - display: - platform: nextion id: nextion1 - uart_id: uart_2 lambda: |- it.set_component_value("gauge", 50); it.set_component_text("textview", "Hello World!"); @@ -73,7 +65,7 @@ Configuration variables: - **on_wake** (*Optional*, :ref:`Action `): An action to be performed when the Nextion wakes up. See :ref:`Nextion Automation `. - **on_page** (*Optional*, :ref:`Action `): An action to be performed after a page change. See :ref:`Nextion Automation `. - **on_touch** (*Optional*, :ref:`Action `): An action to be performed after a touch event (press or release). See :ref:`Nextion Automation `. - + .. _display-nextion_lambda: Rendering Lambda @@ -113,7 +105,7 @@ Lambda Calls ************ Several methods are available for use within :ref:`lambdas `; these permit advanced functionality beyond simple -display updates. See the full :apiref:`nextion/nextion.h` for more info. +display updates. See the full :apiref:`nextion/nextion.h` for more info. .. _nextion_upload_tft: @@ -126,7 +118,7 @@ The developer tools in Home Assistant can be used to trigger the update. The bel services: - service: update_nextion then: - - lambda: 'id(nextion1)->upload_tft();' + - lambda: 'id(nextion1)->upload_tft();' .. _nextion_update_all_components: @@ -178,7 +170,7 @@ The developer tools in Home Assistant can be used to trigger the update. The bel .. _nextion_queue_types: - Queue Types: + Queue Types: - SENSOR 0 - BINARY_SENSOR 1 - SWITCH 2 @@ -291,7 +283,7 @@ The following arguments will be available: Uploading A TFT File -------------------- This will download the file from the tft_url and will transfer it over the UART to the Nextion. -Once completed both the ESP and Nextion will reboot. During the upload process esphome will be +Once completed both the ESP and Nextion will reboot. During the upload process esphome will be unresponsive and no logging will take place. This uses the same protocol as the Nextion editor and only updates the changes of the TFT file. If HTTPS/SSL is enabled it will be about 1kB/sec. @@ -304,7 +296,7 @@ To host the TFT file you can use Home Assistant itself or any other web server. Home Assistant ************** -To host the TFT file from Home Assistant, create a www directory if it doesn't exist in your config +To host the TFT file from Home Assistant, create a www directory if it doesn't exist in your config directory. You can create a subdirectory for those files as well. For example if the file is located @@ -321,8 +313,8 @@ The below NGINX example configuration will serve files out of the /var/www/nexti .. code-block:: nginx server { - listen 80; - access_log /var/log/nginx/nextion_access.log; + listen 80; + access_log /var/log/nginx/nextion_access.log; error_log /var/log/nginx/nextion_error.log; root /var/www/nextion; } diff --git a/components/display/qspi_amoled.rst b/components/display/qspi_amoled.rst index 54e277b82..5d65d8b46 100644 --- a/components/display/qspi_amoled.rst +++ b/components/display/qspi_amoled.rst @@ -50,9 +50,9 @@ ESP-IDF. PSRAM is a requirement due to the size of the display buffer. A :ref:`q color_order: rgb invert_colors: false brightness: 255 - cs_pin: 11 - reset_pin: 13 - enable_pin: 9 + cs_pin: GPIOXX + reset_pin: GPIOXX + enable_pin: GPIOXX Configuration variables: @@ -150,17 +150,17 @@ Lilygo T-Display S3 AMOLED - 7 - 48 - 5 - + i2c: sda: 3 scl: 2 - + touchscreen: - platform: cst816 id: my_touchscreen interrupt_pin: number: 21 - + display: - platform: qspi_amoled model: RM67162 diff --git a/components/display/st7789v.rst b/components/display/st7789v.rst index 1395d5d01..e56924b6c 100644 --- a/components/display/st7789v.rst +++ b/components/display/st7789v.rst @@ -40,17 +40,13 @@ to an ESP module. .. code-block:: yaml # Example minimal configuration entry - spi: - clk_pin: GPIO18 - mosi_pin: GPIO19 - display: - platform: st7789v model: TTGO TDisplay 135x240 - backlight_pin: GPIO4 - cs_pin: GPIO5 - dc_pin: GPIO16 - reset_pin: GPIO23 + backlight_pin: GPIOXX + cs_pin: GPIOXX + dc_pin: GPIOXX + reset_pin: GPIOXX lambda: |- it.print(0, 0, id(font), "Hello World!"); @@ -191,7 +187,7 @@ Items marked RQ are hardware dependent but required and not preset. Items marked - 22 - 23 - 4 - - + - - 18 - 19 * - Custom diff --git a/components/display/tm1621.rst b/components/display/tm1621.rst index 169ff2e95..e1619a965 100644 --- a/components/display/tm1621.rst +++ b/components/display/tm1621.rst @@ -22,10 +22,10 @@ The LCD have four signal, ``cs`` for chip select, ``data`` for data signal, ``re display: platform: tm1621 id: tm1621_display - cs_pin: GPIO17 - data_pin: GPIO5 - read_pin: GPIO23 - write_pin: GPIO18 + cs_pin: GPIOXX + data_pin: GPIOXX + read_pin: GPIOXX + write_pin: GPIOXX lambda: |- it.printf(0, "%.1f", id(my_sensor1).state); it.display_celsius(true); @@ -82,7 +82,7 @@ Also we have five function to display or not some unites: - °F on the first line : ``display_fahrenheit(bool)`` - %HR on the second line : ``display_humidity(bool)`` - V on the first line and A on the second line : ``display_voltage(bool)`` - - kW/h on the first line and W on the second line : ``display_kwh(bool)`` + - kW/h on the first line and W on the second line : ``display_kwh(bool)`` See Also -------- diff --git a/components/display/tm1638.rst b/components/display/tm1638.rst index 742f1ccbd..025d1ab99 100644 --- a/components/display/tm1638.rst +++ b/components/display/tm1638.rst @@ -23,9 +23,9 @@ The module can be powered with 5v DC. To display the colon punctuation use the display: platform: tm1638 id: tm1638_display - stb_pin: 5 - clk_pin: 18 - dio_pin: 23 + stb_pin: GPIOXX + clk_pin: GPIOXX + dio_pin: GPIOXX intensity: 5 update_interval: 5s lambda: |- @@ -113,9 +113,9 @@ The following example creates a typical digital clock with the ``:`` colon flash display: platform: tm1638 - clk_pin: 18 - dio_pin: 23 - stb_pin: 5 + clk_pin: GPIOXX + dio_pin: GPIOXX + stb_pin: GPIOXX update_interval: 500ms lambda: |- static int i = 0; @@ -132,16 +132,16 @@ The TM1638 7 Segment Display Keypad & LED Module has 8 LED lights across the top .. code-block:: yaml - switch: + switch: - platform: tm1638 id: TM1638Led1 led: 0 - + output: - platform: tm1638 id: TM1638Led2 led: 1 - + Buttons @@ -163,7 +163,7 @@ The TM1638 7 Segment Display Keypad & LED Module has 8 buttons across the top or on_release: then: - switch.turn_off: TM1638Led1 - + - platform: tm1638 name: "TM1638 Button 2" id: TM1638Button2 diff --git a/components/display/waveshare_epaper.rst b/components/display/waveshare_epaper.rst index 44a194a81..73be28b28 100644 --- a/components/display/waveshare_epaper.rst +++ b/components/display/waveshare_epaper.rst @@ -23,7 +23,7 @@ single-color E-Ink displays are implemented and of those only a few modules. Waveshare E-Paper 2.9 Inch E-Paper Display. -The communication ESPHome has chosen to use for this integration is 4-wire :ref:`SPI `, as it's the most stable +The communication ESPHome has chosen to use for this component is 4-wire :ref:`SPI `, as it's the most stable and high-speed. So you need to make sure your board is set to the 4-wire SPI mode and have an ``spi:`` section in your configuration. @@ -96,6 +96,7 @@ Configuration variables: - ``2.70in-b`` - Black/White/Red - ``2.70in-bv2`` - Black/White/Red - ``2.90in`` + - ``2.90in-dke`` - ``2.90inv2`` - ``2.90inv2-r2`` - 2.9in V2 display, but with different initialization and full/partial display refresh management than ``2.90inv2`` - ``2.90in-b`` - B/W rendering only diff --git a/components/display_menu/graphical_display_menu.rst b/components/display_menu/graphical_display_menu.rst index fc1fb52ae..9949b8b4e 100644 --- a/components/display_menu/graphical_display_menu.rst +++ b/components/display_menu/graphical_display_menu.rst @@ -12,14 +12,14 @@ on graphical displays. This offers the user an interactive method to display labels, control entities like ``switch``, ``select``, ``number`` available locally on the ESPHome node, without the requirement of a network connection. -.. figure:: images/graphical_display_menu.jpg +.. figure:: images/graphical_display_menu.png :align: center :width: 60.0% Overview -------- -The integration implements the :ref:`Display Menu ` integration providing +The component implements the :ref:`Display Menu ` component providing a hierarchical menu primarily intended to be controlled either by a rotary encoder with a button or a five-button joystick controller. diff --git a/components/display_menu/images/graphical_display_menu.jpg b/components/display_menu/images/graphical_display_menu.jpg deleted file mode 100644 index eaed932d3..000000000 Binary files a/components/display_menu/images/graphical_display_menu.jpg and /dev/null differ diff --git a/components/display_menu/images/graphical_display_menu.png b/components/display_menu/images/graphical_display_menu.png new file mode 100644 index 000000000..0f624696a Binary files /dev/null and b/components/display_menu/images/graphical_display_menu.png differ diff --git a/components/display_menu/index.rst b/components/display_menu/index.rst index 752c2ae94..9a38ecbf8 100644 --- a/components/display_menu/index.rst +++ b/components/display_menu/index.rst @@ -7,7 +7,7 @@ Display Menu .. _display_menu: -The integration provides a menu primarily intended to be controlled either by a rotary encoder +The component provides a menu primarily intended to be controlled either by a rotary encoder with a button or a five-button joystick controller. It allows to navigate a hierarchy of items and submenus with the ability to change the values and execute commands. The menu can be activated and deactivated on demand, allowing alternating between using the screen for @@ -17,8 +17,8 @@ Overview -------- This document describes the configuration and automations common for the components implementing -this integration. At the moment the character based LCD displays are supported using -the :ref:`lcd_menu ` integration and an instance of this is used in the configuration +this component. At the moment the character based LCD displays are supported using +the :ref:`lcd_menu ` component and an instance of this is used in the configuration examples. diff --git a/components/display_menu/lcd_menu.rst b/components/display_menu/lcd_menu.rst index 676c6d474..9645ece37 100644 --- a/components/display_menu/lcd_menu.rst +++ b/components/display_menu/lcd_menu.rst @@ -19,7 +19,7 @@ ESPHome node, without the requirement of a network connection. Overview -------- -The integration implements the :ref:`Display Menu ` integration providing +The component implements the :ref:`Display Menu ` component providing a hierarchical menu primarily intended to be controlled either by a rotary encoder with a button or a five-button joystick controller. diff --git a/components/esp32_camera.rst b/components/esp32_camera.rst index 793e08887..0de4c1ffd 100644 --- a/components/esp32_camera.rst +++ b/components/esp32_camera.rst @@ -14,16 +14,16 @@ directly integrate into Home Assistant through the native API. esp32_camera: name: My Camera external_clock: - pin: GPIO27 + pin: GPIOXX frequency: 20MHz i2c_pins: - sda: GPIO25 - scl: GPIO23 - data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19] - vsync_pin: GPIO22 - href_pin: GPIO26 - pixel_clock_pin: GPIO21 - reset_pin: GPIO15 + sda: GPIOXX + scl: GPIOXX + data_pins: [GPIOXX, GPIOXX, GPIOXX, GPIOXX, GPIOXX, GPIOXX, GPIOXX, GPIOXX] + vsync_pin: GPIOXX + href_pin: GPIOXX + pixel_clock_pin: GPIOXX + reset_pin: GPIOXX resolution: 640x480 jpeg_quality: 10 @@ -37,10 +37,10 @@ Configuration variables: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. Connection Options: @@ -179,7 +179,7 @@ Configuration for Ai-Thinker Camera .. warning:: - GPIO16 on this board (and possibly other boards below) is connected to onboard PSRAM. + GPIO16 on this board (and possibly other boards below) is connected to onboard PSRAM. Using this GPIO for other purposes (eg as a button) will trigger the watchdog. Further information on pin notes can be found here: https://github.com/raphaelbs/esp32-cam-ai-thinker/blob/master/docs/esp32cam-pin-notes.md diff --git a/components/ethernet.rst b/components/ethernet.rst index 80fa7dd0b..b10165883 100644 --- a/components/ethernet.rst +++ b/components/ethernet.rst @@ -17,8 +17,8 @@ This component and the Wi-Fi component may **not** be used simultaneously, even # Example configuration entry for RMII chips ethernet: type: LAN8720 - mdc_pin: GPIO23 - mdio_pin: GPIO18 + mdc_pin: GPIOXX + mdio_pin: GPIOXX clk_mode: GPIO0_IN phy_addr: 0 @@ -33,12 +33,12 @@ This component and the Wi-Fi component may **not** be used simultaneously, even # Example configuration entry for SPI chips ethernet: type: W5500 - clk_pin: GPIO19 - mosi_pin: GPIO21 - miso_pin: GPIO23 - cs_pin: GPIO18 - interrupt_pin: GPIO36 - reset_pin: GPIO22 + clk_pin: GPIOXX + mosi_pin: GPIOXX + miso_pin: GPIOXX + cs_pin: GPIOXX + interrupt_pin: GPIOXX + reset_pin: GPIOXX Configuration variables: ------------------------ diff --git a/components/event/index.rst b/components/event/index.rst new file mode 100644 index 000000000..85004ac46 --- /dev/null +++ b/components/event/index.rst @@ -0,0 +1,147 @@ +Event Component +=============== + +.. seo:: + :description: Instructions for setting up event components in ESPHome. + :image: folder-open.svg + +ESPHome supports the creation of event entities in Home Assistant. +These entities allow for the triggering of custom events within the Home Assistant ecosystem, +enabling complex automations and integrations. An event entity is represented as a stateless +entity associated with a device that has a pre-defined set of event types which can be +triggered in Home Assistant via automations. + +.. note:: + + Events in ESPHome are designed to trigger an action in Home Assistant, and have a unidirectional flow from ESPHome to Home Assistant. + Home Assistant event entities are different from events on event bus. If you just want to trigger an event on the + Home Assistant event bus, you should use a :ref:`Home Assistant event ` instead. + + +.. note:: + + Home Assistant Core 2024.5 or higher is required for ESPHome event entities to work. + +.. _config-event: + +Base Event Configuration +------------------------ + +Each event in ESPHome needs to be configured with a list of event types it can trigger and an optional device class. + +.. code-block:: yaml + + # Example event configuration + event: + - platform: ... + name: Motion Detected Event + id: my_event + + # Optional variables: + icon: "mdi:motion-sensor" + device_class: "motion" + on_event: + then: + - logger.log: "Event triggered" + +Configuration variables: + +One of ``id`` or ``name`` is required. + +- **id** (**Required**, :ref:`config-id`): Manually specify the ID used for code generation, allowing for further customization or interaction with this event within ESPHome scripts or lambda functions. +- **name** (**Required**, string): The name for the event. + + .. note:: + + If you have a :ref:`friendly_name ` set for your device and + you want the event to use that name, you can set ``name: None``. + +- **icon** (*Optional*, icon): Manually set the icon to use for the event in the frontend. +- **internal** (*Optional*, boolean): Mark this component as internal. Internal components will + not be exposed to the frontend (like Home Assistant). Only specifying an ``id`` without + a ``name`` will implicitly set this to true. +- **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, + (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). +- **entity_category** (*Optional*, string): The category of the entity. + See https://developers.home-assistant.io/docs/core/entity/#generic-properties + for a list of available options. Set to ``""`` to remove the default entity category. +- **device_class** (*Optional*, string): The device class for the event. The following device classes are supported by event entities: + + - None: Generic event. This is the default and doesn't need to be set. + - ``button``: For remote control buttons. + - ``doorbell``: Specifically for buttons that are used as a doorbell. + - ``motion``: For motion events detected by a motion sensor. + + See https://www.home-assistant.io/integrations/event/#device-class + for a list of available options. + +Automations: + +- **on_event** (*Optional*, :ref:`Automation `): An automation to perform when an event is triggered. + +MQTT options: + +- All other options from :ref:`MQTT Component `. + +Event Automation +---------------- + +.. _event-on_event: + +``on_event`` +************ + +This automation will be triggered when an event of the specified types is triggered. + +.. code-block:: yaml + + event: + - platform: template + # ... + on_event: + then: + - logger.log: "Event Triggered" + +Configuration variables: see :ref:`Automation `. + +``event.trigger`` Action +************************ + +This action allows for the triggering of an event from within an automation. + +.. code-block:: yaml + + - event.trigger: + id: my_event + event_type: "custom_event" + +Configuration variables: + +- **id** (**Required**, :ref:`config-id`): The ID of the event. +- **event_type** (**Required**, string): The type of event to trigger. + +.. _event-lambda_calls: + +lambda Calls +************ + +From :ref:`lambdas `, you can trigger an event. + +- ``trigger(std::string event_type)``: Trigger an event with the specified type. + + .. code-block:: cpp + + // Within lambda, trigger the event. + id(my_event).trigger("custom_event"); + +See Also +-------- + +- :apiref:`event/event.h` +- :ghedit:`Edit` + +.. toctree:: + :maxdepth: 1 + :glob: + + * diff --git a/components/event/template.rst b/components/event/template.rst new file mode 100644 index 000000000..d0a8d5533 --- /dev/null +++ b/components/event/template.rst @@ -0,0 +1,31 @@ +Template Event +============== + +.. seo:: + :description: Instructions for setting up template events that can trigger arbitrary automations when an event occurs. + :image: description.svg + +The ``template`` event platform enables you to define events that trigger specific automations or actions within Home Assistant. These custom events can be utilized to orchestrate complex behaviors across your smart home ecosystem based on conditions or sequences defined in your ESPHome configuration. + +.. code-block:: yaml + + # Example configuration entry + event: + - platform: template + name: "Template Event" + event_types: + - "custom_event_1" + - "custom_event_2" + +Configuration variables: +------------------------ + +- **event_types** (**Required**, list): A list of custom event identifiers that this template event is capable of triggering. These identifiers can be used in Home Assistant automations or ESPHome scripts to perform actions when the event occurs. +- All other options from :ref:`Event `. + +See Also +-------- + +- :doc:`/guides/automations` +- :doc:`/components/event/index` +- :ghedit:`Edit` diff --git a/components/exposure_notifications.rst b/components/exposure_notifications.rst index 75f323de3..1007cf55f 100644 --- a/components/exposure_notifications.rst +++ b/components/exposure_notifications.rst @@ -52,7 +52,7 @@ minute, the indicator will be on. switch: - platform: gpio - pin: GPIO22 + pin: GPIOXX id: led script: diff --git a/components/external_components.rst b/components/external_components.rst index 32a89747b..d24482171 100644 --- a/components/external_components.rst +++ b/components/external_components.rst @@ -46,6 +46,7 @@ Configuration variables: - **ref** (*Optional*, string): Git ref (branch or tag). If not specified the default branch is used. - **username** (*Optional*, string): Username for the Git server, if one is required - **password** (*Optional*, string): Password for the Git server, if one is required + - **path** (*Optional*, string): Path inside the repo, if different from ``components`` or ``esphome/components`` local options: diff --git a/components/fan/binary.rst b/components/fan/binary.rst index eefad56e1..c7328c5e7 100644 --- a/components/fan/binary.rst +++ b/components/fan/binary.rst @@ -14,18 +14,13 @@ The ``binary`` fan platform lets you represent any binary :ref:`output` as a fan .. code-block:: yaml # Example configuration entry - output: - - id: fan_output - platform: gpio - pin: GPIO16 - fan: - platform: binary output: fan_output name: "Living Room Fan" - - - + + + Configuration variables: ------------------------ diff --git a/components/fan/hbridge.rst b/components/fan/hbridge.rst index 4ed716697..7e4295f8c 100644 --- a/components/fan/hbridge.rst +++ b/components/fan/hbridge.rst @@ -23,14 +23,6 @@ The ``hbridge`` fan platform allows you to use a compatible *h-bridge* (L298N, D .. code-block:: yaml # Example configuration entry - output: - - platform: ... - id: motor_forward_pin - pin: GPIO5 - - platform: ... - id: motor_reverse_pin - pin: GPIO4 - fan: - platform: hbridge id: my_fan diff --git a/components/fan/index.rst b/components/fan/index.rst index 415e3d562..08039308a 100644 --- a/components/fan/index.rst +++ b/components/fan/index.rst @@ -49,10 +49,10 @@ Configuration variables: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. MQTT options: diff --git a/components/fingerprint_grow.rst b/components/fingerprint_grow.rst index c36a2e2c1..cdba66074 100644 --- a/components/fingerprint_grow.rst +++ b/components/fingerprint_grow.rst @@ -2,7 +2,7 @@ Grow Fingerprint Reader ======================= .. seo:: - :description: Instructions for setting up Grow Fingerprint Reader integration in ESPHome. + :description: Instructions for setting up Grow Fingerprint Reader component in ESPHome. :image: fingerprint.svg The ``fingerprint_grow`` component allows you to use your R307, R503, R503-RGB, ZFM-20, ... fingerprint sensors with ESPHome. @@ -30,16 +30,10 @@ If available on your reader model, it's recommended to connect 3.3VT (touch indu .. code-block:: yaml # Example configuration entry - uart: - rx_pin: GPIO13 - tx_pin: GPIO15 - baud_rate: 57600 - - # Declare Grow Fingerprint Reader fingerprint_grow: - sensing_pin: GPIO12 + sensing_pin: GPIOXX sensor_power_pin: - number: GPIO18 + number: GPIOXX inverted: true idle_period_to_sleep: 5s @@ -93,46 +87,27 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. -Optional Sensor Configuration: Sensor ------ - **fingerprint_count**: The number of enrolled fingerprints stored on the reader. - - - **name** (**Required**, string): The name for the sensor. - - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **last_finger_id**: The last matched enrolled fingerprint as set by :ref:`fingerprint_grow-on_finger_scan_matched`. - - - **name** (**Required**, string): The name for the sensor. - - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **last_confidence**: The last matched confidence as set by :ref:`fingerprint_grow-on_finger_scan_matched`. - - - **name** (**Required**, string): The name for the sensor. - - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **status**: The integer representation of the internal status register of the reader. - - - **name** (**Required**, string): The name for the sensor. - - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **capacity**: The fingerprint storage capacity of the reader. - - - **name** (**Required**, string): The name for the sensor. - - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **security_level**: The integer representation of the currently configured security level of the reader. Higher security levels reduce the false acceptance rate (FAR) at the expense of increasing the false rejection rate (FRR). Range is 1 (lowest) to 5 (highest). - - - **name** (**Required**, string): The name for the sensor. - - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. .. _fingerprint_grow-sleep_mode: @@ -150,14 +125,14 @@ This is a wiring example for the R503 and below you can find the respective conf .. code-block:: yaml uart: - rx_pin: GPIO16 - tx_pin: GPIO17 + rx_pin: GPIOXX + tx_pin: GPIOXX baud_rate: 57600 - + fingerprint_grow: - sensing_pin: GPIO4 + sensing_pin: GPIOXX sensor_power_pin: - number: GPIO18 + number: GPIOXX inverted: true idle_period_to_sleep: 5s @@ -191,7 +166,7 @@ The ``new_password:`` configuration option is meant to be compiled, flashed to t ``on_finger_scan_start`` Trigger ------------------------------------ -With this configuration option, you can trigger an automation when a finger is detected touching the sensor. Very useful to indicate to the user via AuraLed that the sensor has detected the finger touch and will perform the scan. This trigger will **only** activate if your fingerprint sensor is configured with the ``sensing_pin`` option. +With this configuration option, you can trigger an automation when a finger is detected touching the sensor. Very useful to indicate to the user via AuraLed that the sensor has detected the finger touch and will perform the scan. This trigger will **only** activate if your fingerprint sensor is configured with the ``sensing_pin`` option. .. code-block:: yaml @@ -513,12 +488,12 @@ Sample code .. code-block:: yaml uart: - rx_pin: GPIO13 - tx_pin: GPIO15 + rx_pin: GPIOXX + tx_pin: GPIOXX baud_rate: 57600 fingerprint_grow: - sensing_pin: GPIO12 + sensing_pin: GPIOXX on_finger_scan_invalid: - homeassistant.event: event: esphome.test_node_finger_scan_invalid diff --git a/components/gps.rst b/components/gps.rst index a391a2c46..94a4efbc0 100644 --- a/components/gps.rst +++ b/components/gps.rst @@ -2,7 +2,7 @@ GPS Component ============= .. seo:: - :description: Instructions for setting up GPS integration in ESPHome. + :description: Instructions for setting up GPS component in ESPHome. :image: crosshairs-gps.svg The ``gps`` component allows you to connect GPS modules to your ESPHome project. @@ -16,15 +16,12 @@ Any GPS module that uses the standardized NMEA communication protocol will work. .. _Adafruit: https://www.adafruit.com/product/746 -For this integration to work you need to have set up a :ref:`UART bus ` +For this component to work you need to have set up a :ref:`UART bus ` in your configuration - only the RX pin should be necessary. .. code-block:: yaml # Example configuration entry - uart: - rx_pin: D7 - baud_rate: 9600 # Declare GPS module gps: diff --git a/components/i2c.rst b/components/i2c.rst index 48176e248..a4fe7a4df 100644 --- a/components/i2c.rst +++ b/components/i2c.rst @@ -20,8 +20,8 @@ connecting the wires from each device back to the two I²C pins on the ESP. # Example configuration entry for ESP32 i2c: - sda: 21 - scl: 22 + sda: GPIOXX + scl: GPIOXX scan: true id: bus_a @@ -51,12 +51,12 @@ Configuration variables: # Example configuration entry i2c: - id: bus_a - sda: 13 - scl: 16 + sda: GPIOXX + scl: GPIOXX scan: true - id: bus_b - sda: 14 - scl: 15 + sda: GPIOXX + scl: GPIOXX scan: true # Sensors should be specified as follows - platform: bme680 diff --git a/components/i2s_audio.rst b/components/i2s_audio.rst index 3eb07a8f6..424fc5b1d 100644 --- a/components/i2s_audio.rst +++ b/components/i2s_audio.rst @@ -14,8 +14,8 @@ This component only works on ESP32 based chips. # Example configuration entry i2s_audio: - i2s_lrclk_pin: GPIO33 - i2s_bclk_pin: GPIO19 + i2s_lrclk_pin: GPIOXX + i2s_bclk_pin: GPIOXX Configuration variables: ------------------------ diff --git a/components/images/DFR0627.jpg b/components/images/DFR0627.jpg new file mode 100644 index 000000000..5a112ccc9 Binary files /dev/null and b/components/images/DFR0627.jpg differ diff --git a/components/index.rst b/components/index.rst index b9aba9769..b1f4c8739 100644 --- a/components/index.rst +++ b/components/index.rst @@ -17,6 +17,7 @@ Components sensor/index switch/index button/index + event/index display/index text_sensor/index stepper/index @@ -29,4 +30,5 @@ Components time/index alarm_control_panel/index text/index + valve/index * diff --git a/components/light/binary.rst b/components/light/binary.rst index 43e1ee7bc..4a3bf44e5 100644 --- a/components/light/binary.rst +++ b/components/light/binary.rst @@ -20,10 +20,6 @@ The ``binary`` light platform creates a simple ON/OFF-only light from a name: "Desk Lamp" output: light_output - output: - - id: light_output - platform: gpio - pin: GPIO16 Configuration variables: ------------------------ diff --git a/components/light/custom.rst b/components/light/custom.rst index 03353f6f1..0ebf96564 100644 --- a/components/light/custom.rst +++ b/components/light/custom.rst @@ -1,21 +1,27 @@ Custom Light Output =================== +.. seo:: + :description: Instructions for setting up Custom C++ lights with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create custom lights in ESPHome -using the C++ (Arduino) API. +.. warning:: -Please first read :doc:`/components/sensor/custom` guide, -the same principles apply here. + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + +This component can be used to create custom lights in ESPHome using the C++ (Arduino) API. + +Please first read :doc:`/components/sensor/custom` guide, the same principles apply here. All internal stuff (like effects, transitions etc) is handled by the light core and cannot be overridden. Light outputs are only responsible for displaying some state diff --git a/components/light/esp32_rmt_led_strip.rst b/components/light/esp32_rmt_led_strip.rst index 8c4a67c2e..cb1914244 100644 --- a/components/light/esp32_rmt_led_strip.rst +++ b/components/light/esp32_rmt_led_strip.rst @@ -12,7 +12,7 @@ This is a component using the ESP32 RMT peripheral to drive most addressable LED light: - platform: esp32_rmt_led_strip rgb_order: GRB - pin: GPIO13 + pin: GPIOXX num_leds: 30 rmt_channel: 0 chipset: ws2812 diff --git a/components/light/fastled.rst b/components/light/fastled.rst index 41c61a060..f1799fca0 100644 --- a/components/light/fastled.rst +++ b/components/light/fastled.rst @@ -47,7 +47,7 @@ Clockless FastLED lights differ from the light: - platform: fastled_clockless chipset: WS2811 - pin: GPIO23 + pin: GPIOXX num_leds: 60 rgb_order: BRG name: "FastLED WS2811 Light" @@ -126,8 +126,8 @@ whereas the clockless lights only need a single pin. light: - platform: fastled_spi chipset: WS2801 - data_pin: GPIO23 - clock_pin: GPIO22 + data_pin: GPIOXX + clock_pin: GPIOXX num_leds: 60 rgb_order: BRG name: "FastLED SPI Light" diff --git a/components/light/hbridge.rst b/components/light/hbridge.rst index 6dcd095d6..07b8c23cc 100644 --- a/components/light/hbridge.rst +++ b/components/light/hbridge.rst @@ -12,23 +12,12 @@ The ``hbridge`` light platform creates a dual color brightness controlled light :align: center :width: 40.0% -H-bridge lights are very common for Christmas lighting and they use 2 wires for a bunch of LEDs. +H-bridge lights are very common for Christmas lighting and they use 2 wires for a bunch of LEDs. The pins are switched alternatively to allow two sets of lights to operate. .. code-block:: yaml # Example configuration entry - - # Specify the two pins of the h-bridge as PWM pins - output: - - platform: esp8266_pwm - id: pina - pin: GPIO12 - - platform: esp8266_pwm - id: pinb - pin: GPIO14 - - # Create a light using the hbridge light: - platform: hbridge id: mainlight diff --git a/components/light/index.rst b/components/light/index.rst index c57c9470a..2f3550a14 100644 --- a/components/light/index.rst +++ b/components/light/index.rst @@ -77,10 +77,10 @@ Advanced options: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. - If MQTT enabled, all other options from :ref:`MQTT Component `. @@ -583,6 +583,7 @@ Configuration variables: - **cold_white** (*Optional*, percentage): The cold white channel of the light, if applicable. Defaults to ``100%``. - **warm_white** (*Optional*, percentage): The warm white channel of the light, if applicable. Defaults to ``100%``. - **duration** (**Required**, :ref:`config-time`): The duration this color should be active. + - **transition_length** (*Optional*, :ref:`config-time`): The duration of each transition. Defaults to ``0s``. See `light.turn_on ` for more information on the various color fields. diff --git a/components/light/monochromatic.rst b/components/light/monochromatic.rst index 2b86555d2..c24a9787a 100644 --- a/components/light/monochromatic.rst +++ b/components/light/monochromatic.rst @@ -26,11 +26,6 @@ The ``monochromatic`` light platform creates a simple brightness-only light from name: "Kitchen Lights" output: output_component1 - # Example output entry - output: - - platform: esp8266_pwm - id: output_component1 - pin: D1 Configuration variables: ------------------------ diff --git a/components/light/neopixelbus.rst b/components/light/neopixelbus.rst index 271af0c6e..852978677 100644 --- a/components/light/neopixelbus.rst +++ b/components/light/neopixelbus.rst @@ -18,7 +18,7 @@ in ESPHome for individually addressable lights like NeoPixel or WS2812. It is very similar to the :doc:`fastled` platform. In fact, most addressable lights are supported through both light platforms. The difference is that they use different libraries: while the fastled platform uses -the `FastLED `__ library, this integration uses +the `FastLED `__ library, this component uses the `NeoPixelBus `__ library internally. .. code-block:: yaml @@ -28,7 +28,7 @@ the `NeoPixelBus `__ library internally. - platform: neopixelbus type: GRB variant: WS2811 - pin: GPIO23 + pin: GPIOXX num_leds: 60 name: "NeoPixel Light" @@ -129,7 +129,7 @@ settings vary by method: - **esp8266_uart**: An alternative method for ESP8266s that uses the UART peripheral to send data. Available on pin GPIO1 for bus 0, and GPIO2 for bus 1. Additional options: - - **bus** (*Optional*, int): The UART bus to use. If 0, the logger ``baud_rate`` option must + - **bus** (*Optional*, int): The UART bus to use. If 0, the logger ``baud_rate`` option must be set to 0 and logs over USB/serial won't work. - **async** (*Optional*, boolean): Use an asynchronous transfer. Defaults to ``false``. If enabled, the logger must be disabled even if bus 1 is used. @@ -154,7 +154,7 @@ The following method is available only for two-wire chips (specify ``data_pin`` - **bus** (*Optional*, string): On ESP32s the SPI bus to be used can be selected. One of ``vspi`` and ``hspi``. - **speed** (*Optional*, int): The frequency to send data with. Defaults to ``10MHz``. One of ``40MHz``, ``20MHz``, ``10MHz``, ``5MHz``, ``2MHz``, ``1MHz``, ``500KHz``. - + On ESP8266 only GPIO13 can be used for ``data_pin`` and only GPIO14 can be used for ``clock_pin``. The ``method`` key also accepts a short-hand syntax consisting of a single value for historic reasons. Usage of diff --git a/components/light/rgb.rst b/components/light/rgb.rst index 61bb69936..2c1f4f837 100644 --- a/components/light/rgb.rst +++ b/components/light/rgb.rst @@ -28,12 +28,6 @@ The ``rgb`` light platform creates an RGB light from 3 :ref:`float output compon green: output_component2 blue: output_component3 - # Example output entry - output: - - platform: esp8266_pwm - id: output_component1 - pin: D1 - # Repeat for green and blue output Color Correction ---------------- @@ -54,9 +48,8 @@ perceived intensity of different colors will generally vary. This can be done by # Example output entry output: - - platform: esp8266_pwm + - platform: ... id: output_component1 - pin: D1 max_power: 80% # Repeat for green and blue output diff --git a/components/light/rgbw.rst b/components/light/rgbw.rst index 3383f8ff5..ca089b07d 100644 --- a/components/light/rgbw.rst +++ b/components/light/rgbw.rst @@ -38,9 +38,8 @@ perceived intensity of different colors will generally vary. This can be done by # Example output entry output: - - platform: esp8266_pwm + - platform: ... id: output_component1 - pin: D1 max_power: 80% .. note:: diff --git a/components/light/rgbww.rst b/components/light/rgbww.rst index f40f2dfca..426e45f1b 100644 --- a/components/light/rgbww.rst +++ b/components/light/rgbww.rst @@ -44,9 +44,8 @@ perceived intensity of different colors will generally vary. This can be done by # Example output entry output: - - platform: esp8266_pwm + - platform: ... id: output_component1 - pin: D1 max_power: 80% .. note:: diff --git a/components/light/rp2040_pio_led_strip.rst b/components/light/rp2040_pio_led_strip.rst index d012329e3..ceeda5cfa 100644 --- a/components/light/rp2040_pio_led_strip.rst +++ b/components/light/rp2040_pio_led_strip.rst @@ -13,7 +13,7 @@ This is a component using the RP2040 PIO peripheral to drive most addressable LE - platform: rp2040_pio_led_strip name: led_strip id: led_strip - pin: GPIO13 + pin: GPIOXX num_leds: 10 pio: 0 rgb_order: GRB diff --git a/components/light/spi_led_strip.rst b/components/light/spi_led_strip.rst index d6cb4a75d..31b226e09 100644 --- a/components/light/spi_led_strip.rst +++ b/components/light/spi_led_strip.rst @@ -8,7 +8,7 @@ SPI LED Strip Light The ``spi_led_strip`` light platform drives one or more SPI interfaced RGB LEDs. These LEDs are often used in strips, where each LED is individually addressable. This component requires an SPI interface to be configured. -This component has been tested with APA102 LEDs and the P9813 LED driver. It should also work with HD107 and SK9822 type +This component has been tested with APA102 LEDs and the P9813 LED driver. It should also work with HD107 and SK9822 type LEDs, or any others with a similar interface - SPI, 8 bits per colour and BGR ordering. .. figure:: images/apa102.jpg @@ -18,14 +18,9 @@ LEDs, or any others with a similar interface - SPI, 8 bits per colour and BGR or .. code-block:: yaml # Example configuration entry - spi: - mosi_pin: GPIO3 - clk_pin: GPIO9 - light: - platform: spi_led_strip num_leds: 30 - color_correct: [80%, 60%, 100%] id: rgb_led name: "RGB LED Strip" data_rate: 1MHz diff --git a/components/light/status_led.rst b/components/light/status_led.rst index 99d1fa52f..69b315b5f 100644 --- a/components/light/status_led.rst +++ b/components/light/status_led.rst @@ -22,7 +22,7 @@ When the device is in OK state, the LED will be restored to the state of the ``b light: - platform: status_led name: "Switch state" - pin: GPIO2 + pin: GPIOXX .. note:: @@ -50,7 +50,7 @@ Configuration variables: .. code-block:: yaml pin: - number: GPIO2 + number: GPIOXX inverted: true diff --git a/components/lightwaverf.rst b/components/lightwaverf.rst index 78bcac9e5..1026b677f 100644 --- a/components/lightwaverf.rst +++ b/components/lightwaverf.rst @@ -22,19 +22,8 @@ Using an inexpensive RF transmitter and receiver you can control your devices vi # Specify the two pins to connect the receiver and transmitter lightwaverf: - read_pin: 13 - write_pin: 14 - - # Create a switch to trigger a light - switch: - - platform: template - name: "Turn off sofa" - id: light_off_ceiling_sofa - turn_on_action: - lightwaverf.send_raw: - code: [0x04, 0x00, 0x00, 0x00, 0x0f, 0x03, 0x0d, 0x09, 0x08, 0x08] - name: "Sofa" - repeat: 1 + read_pin: GPIOXX + write_pin: GPIOXX Note: To gather the RAW codes from the remote, setup the ``read_pin`` and observe in the logs the printing of the codes. diff --git a/components/lock/index.rst b/components/lock/index.rst index 0428510cb..ac15894c3 100644 --- a/components/lock/index.rst +++ b/components/lock/index.rst @@ -8,10 +8,6 @@ Lock Component The ``lock`` domain includes all platforms that should function like a lock with lock/unlock actions. -.. note:: - - ESPHome lock components requires Home Assistant 2022.3 or newer - .. _config-lock: Base Lock Configuration diff --git a/components/lock/output.rst b/components/lock/output.rst index 282763eb7..ef07f4518 100644 --- a/components/lock/output.rst +++ b/components/lock/output.rst @@ -16,7 +16,7 @@ The ``output`` lock platform allows you to use any output component as a lock. # Example configuration entry output: - platform: gpio - pin: 25 + pin: GPIOXX id: 'generic_out' lock: - platform: output diff --git a/components/matrix_keypad.rst b/components/matrix_keypad.rst index 2820df56f..bf9703223 100644 --- a/components/matrix_keypad.rst +++ b/components/matrix_keypad.rst @@ -23,15 +23,15 @@ Component matrix_keypad: id: mykeypad rows: - - pin: 21 - - pin: 19 - - pin: 18 - - pin: 5 + - pin: GPIOXX + - pin: GPIOXX + - pin: GPIOXX + - pin: GPIOXX columns: - - pin: 17 - - pin: 16 - - pin: 4 - - pin: 15 + - pin: GPIOXX + - pin: GPIOXX + - pin: GPIOXX + - pin: GPIOXX keys: "123A456B789C*0#D" has_diodes: false diff --git a/components/max6956.rst b/components/max6956.rst index 7e2871908..9ef10f5a1 100644 --- a/components/max6956.rst +++ b/components/max6956.rst @@ -13,7 +13,7 @@ The ``max6956`` exists in 2 versions 20 or 28 ports, depending on the packaging. Once configured, you can use any of the 20 or 28 pins for your projects. Within ESPHome they emulate a real internal GPIO pin and can therefore be used with many of ESPHome's components such as the GPIO binary sensor or GPIO switch. Interrupt-on-change for inputs is not possible. -Pins can also be individualy configured as led driver and used with Light components. Current value can be set globaly or for each pin, through 16 possible levels. Driving RGB +Pins can also be individualy configured as led driver and used with Light components. Current value can be set globaly or for each pin, through 16 possible levels. Driving RGB led requires 3 pins. Any option accepting a :ref:`Pin Schema ` can theoretically be used. @@ -48,7 +48,7 @@ Configuration variables: - **brightness_global** (*Optional*): Set the value of the current to be sink by all pins configured as led driver. Defaults to ``0`` - **brightness_mode** (*Optional*): Define if the current to be sink will be confgured globaly or per pin configured as led driver. - Defaults to ``global`` + Defaults to ``global`` Binary Sensor Example @@ -58,19 +58,7 @@ Binary Sensor Example .. code-block:: yaml - # Example configuration : pin as input with pullup - i2c: - id: bus_a - sda: GPIO13 - scl: GPIO16 - scan: false - - max6956: - - id: max6956_1 - address: 0x40 - i2c_id: bus_a - - # Individual input + # Example configuration binary_sensor: - platform: gpio name: "MaxIn Pin 4" @@ -78,7 +66,7 @@ Binary Sensor Example pin: max6956: max6956_1 number: 4 - mode: + mode: input: true pullup: true inverted: False @@ -91,18 +79,7 @@ Switch Example .. code-block:: yaml - # Example configuration : pin as output - i2c: - id: bus_a - sda: GPIO13 - scl: GPIO16 - - max6956: - - id: max6956_1 - address: 0x40 - i2c_id: bus_a - - # Individual output + # Example configuration switch: - platform: gpio name: "MaxIn Pin 8" @@ -110,9 +87,9 @@ Switch Example pin: max6956: max6956_1 number: 8 - mode: + mode: output: true - inverted: False + inverted: False Led driver Example @@ -126,8 +103,8 @@ Led driver Example # Example configuration : pin as led driver, current globaly i2c: id: bus_a - sda: GPIO13 - scl: GPIO16 + sda: GPIOXX + scl: GPIOXX switch: - platform: template @@ -153,7 +130,7 @@ Led driver Example - max6956.set_brightness_global: id: max6956_1 brightness_global: !lambda return x; - + max6956: - id: max6956_1 address: 0x40 @@ -166,7 +143,7 @@ Led driver Example - platform: max6956 pin: 4 id: maxOut_pin4 - + #led binded to output light: - platform: monochromatic @@ -178,8 +155,8 @@ Led driver Example # Example configuration : pin as led driver, current managed individualy (RBG led) i2c: id: bus_a - sda: GPIO13 - scl: GPIO16 + sda: GPIOXX + scl: GPIOXX max6956: - id: max6956_1 @@ -229,7 +206,7 @@ Led driver Example - output.set_level: id: maxOut_pin4 level: !lambda return x/100; - + - platform: template name: "Number Green" id: number_LedGreen @@ -256,7 +233,7 @@ Led driver Example on_value: - output.set_level: id: maxOut_pin6 - level: !lambda return x/100; + level: !lambda return x/100; output: - platform: max6956 pin: 4 @@ -275,7 +252,7 @@ Led driver Example gamma_correct: 1 red: maxOut_pin4 green: maxOut_pin5 - blue: maxOut_pin6 + blue: maxOut_pin6 diff --git a/components/mcp23Sxx.rst b/components/mcp23Sxx.rst index c058eaf65..af26d0876 100644 --- a/components/mcp23Sxx.rst +++ b/components/mcp23Sxx.rst @@ -26,7 +26,7 @@ The MCP23S08 component (`datasheet `): The GPIO pin to use to mute the media player. - **mode** (*Optional*, string): The mode of the I²S bus. Can be ``mono`` or ``stereo``. Defaults to ``mono``. - **i2s_audio_id** (*Optional*, :ref:`config-id`): The ID of the :ref:`I²S Audio ` you wish to use for this media player. -- **i2s_comm_fmt** (*Optional*, string): I2S communication format. By default MSB format is used (AC101, PCM5102A). - Set to ``lsb`` if using an external DAC that uses Japanese (Least Significant Bit Justified) format (like PT8211). +- **i2s_comm_fmt** (*Optional*, string): I2S communication format. By default MSB format is used (AC101, PCM5102A). + Set to ``lsb`` if using an external DAC that uses Japanese (Least Significant Bit Justified) format (like PT8211). Can be ``msb`` or ``lsb``. Defaults to ``msb``. For best results, keep the wires as short as possible. diff --git a/components/micronova.rst b/components/micronova.rst index 8ccda83bd..f350588c2 100644 --- a/components/micronova.rst +++ b/components/micronova.rst @@ -18,7 +18,7 @@ The :ref:`UART ` must be configured with a baud rate 1200, 8 data bits, 2 Also, switching your stove on or off can behave different on the various MicroNova flavours. - Use this integration at your own risk. + Use this component at your own risk. Connecting your stove --------------------- diff --git a/components/microphone/i2s_audio.rst b/components/microphone/i2s_audio.rst index 468a0e1db..7e84843f9 100644 --- a/components/microphone/i2s_audio.rst +++ b/components/microphone/i2s_audio.rst @@ -24,12 +24,12 @@ This platform only works on ESP32 based chips. - platform: i2s_audio id: external_mic adc_type: external - i2s_din_pin: GPIO23 + i2s_din_pin: GPIOXX - platform: i2s_audio id: adc_mic adc_type: internal - adc_pin: GPIO35 + adc_pin: GPIOXX Configuration variables: @@ -80,7 +80,7 @@ M5Stack Atom Echo microphone: - platform: i2s_audio adc_type: external - i2s_din_pin: GPIO23 + i2s_din_pin: GPIOXX pdm: true RaspiAudio Muse Luxe @@ -90,7 +90,7 @@ RaspiAudio Muse Luxe microphone: - platform: i2s_audio - i2s_din_pin: GPIO35 + i2s_din_pin: GPIOXX adc_type: external pdm: false diff --git a/components/modbus_controller.rst b/components/modbus_controller.rst index c21b0a13e..00fcfd135 100644 --- a/components/modbus_controller.rst +++ b/components/modbus_controller.rst @@ -78,7 +78,7 @@ Technically there is no difference between the "inline" and the standard definit ... modbus: - flow_control_pin: 5 + flow_control_pin: GPIOXX id: modbus1 modbus_controller: @@ -129,43 +129,43 @@ Bitmasks Some devices use decimal values in read registers to show multiple binary states occupying only one register address. To decode them, you can use bitmasks according to the table below. The decimal value corresponding to a bit is always double of the previous one in the row. Multiple bits can be represented in a single register by making a sum of all the values corresponding to the bits. -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | Alarm bit | Description | DEC value | HEX value | -+============+==================+===========+===========+ ++============+==================+===========+===========+ | bit 0 | Binary Sensor 0 | 1 | 1 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 1 | Binary Sensor 1 | 2 | 2 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 2 | Binary Sensor 2 | 4 | 4 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 3 | Binary Sensor 3 | 8 | 8 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 4 | Binary Sensor 4 | 16 | 10 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 5 | Binary Sensor 5 | 32 | 20 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 6 | Binary Sensor 6 | 64 | 40 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 7 | Binary Sensor 7 | 128 | 80 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 8 | Binary Sensor 8 | 256 | 100 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 9 | Binary Sensor 9 | 512 | 200 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 10 | Binary Sensor 10 | 1024 | 400 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 11 | Binary Sensor 11 | 2048 | 800 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 12 | Binary Sensor 12 | 4096 | 1000 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 13 | Binary Sensor 13 | 8192 | 2000 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 14 | Binary Sensor 14 | 16384 | 4000 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ | bit 15 | Binary Sensor 15 | 32768 | 8000 | -+------------+------------------+-----------+-----------+ ++------------+------------------+-----------+-----------+ -In the example below, register ``15``, holds several binary values. It stores the decimal value ``12288``, which is the sum of ``4096`` + ``8192``, meaning the corresponding bits ``12`` and ``13`` are ``1``, the other bits are ``0``. +In the example below, register ``15``, holds several binary values. It stores the decimal value ``12288``, which is the sum of ``4096`` + ``8192``, meaning the corresponding bits ``12`` and ``13`` are ``1``, the other bits are ``0``. To gather some of these bits as binary sensors in ESPHome, use ``bitmask``: @@ -513,7 +513,7 @@ The response is mapped to the sensor based on ``register_count`` and offset in b The code synchronizes the localtime of MCU to the epever controller The time is set by writing 12 bytes to register 0x9013. Then battery charge settings are sent. - + .. code-block:: yaml esphome: @@ -565,7 +565,7 @@ The response is mapped to the sensor based on ``register_count`` and offset in b 0x04BA, // 900d Low Volt. Disconnect Volt. 11.8 0x04BA // 900E Discharging Limit Voltage 11.8 }; - + // Boost and equalization periods std::vector battery_settings2 = { 0x0000, // 906B Equalize Duration (min.) 0 @@ -574,7 +574,7 @@ The response is mapped to the sensor based on ``register_count`` and offset in b esphome::modbus_controller::ModbusCommandItem set_battery1_command = esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 0x9000, battery_settings1.size() , battery_settings1); - + esphome::modbus_controller::ModbusCommandItem set_battery2_command = esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 0x906B, battery_settings3.size(), battery_settings2); @@ -583,19 +583,19 @@ The response is mapped to the sensor based on ``register_count`` and offset in b delay(200) ; controller->queue_command(set_battery2_command); ESP_LOGI("ModbusLambda", "EPSOLAR Battery set"); - + uart: id: mod_bus - tx_pin: 19 - rx_pin: 18 + tx_pin: GPIOXX + rx_pin: GPIOXX baud_rate: 115200 stop_bits: 1 - + modbus: - #flow_control_pin: 23 + #flow_control_pin: GPIOXX send_wait_time: 200ms id: mod_bus_epever - + modbus_controller: - id: epever ## the Modbus device addr @@ -604,7 +604,7 @@ The response is mapped to the sensor based on ``register_count`` and offset in b command_throttle: 0ms setup_priority: -10 update_interval: ${updates} - + sensor: - platform: modbus_controller modbus_controller_id: epever @@ -617,7 +617,7 @@ The response is mapped to the sensor based on ``register_count`` and offset in b accuracy_decimals: 1 filters: - multiply: 0.01 - + - platform: modbus_controller modbus_controller_id: epever id: array_rated_current @@ -629,7 +629,7 @@ The response is mapped to the sensor based on ``register_count`` and offset in b accuracy_decimals: 2 filters: - multiply: 0.01 - + - platform: modbus_controller modbus_controller_id: epever id: array_rated_power diff --git a/components/mqtt.rst b/components/mqtt.rst index a62bdd94d..c255d8ef2 100644 --- a/components/mqtt.rst +++ b/components/mqtt.rst @@ -184,13 +184,12 @@ Home Assistant generates entity names for all discovered devices based on entity entity name (e.g. ``sensor.uptime``). Numeric suffixes are appended to entity names when multiple devices use the same name for a sensor, making it harder to distinguish between similar sensors on different devices. Home Assistant 2021.12 allows MQTT devices to change -this behaviour by specifying ``object_id`` discovery attribute which replaces the sensor +this behaviour by specifying the ``object_id`` discovery attribute which replaces the sensor name part of the generated entity name. Setting ``discovery_object_id_generator: device_name`` -in ESPHome MQTT integration configuration will cause Home Assistant to include device name +in the ESPHome MQTT component configuration will cause Home Assistant to include device name in the generated entity names (e.g. ``sensor.uptime`` becomes ``sensor._uptime``), making it easier to distinguish the entities in various entity lists. - .. _mqtt-defaults: Defaults @@ -266,7 +265,7 @@ then run the ``mqtt-fingerprint`` script of ESPHome to get the certificate: .. code-block:: bash - esphome livingroom.yaml mqtt-fingerprint + esphome mqtt-fingerprint livingroom.yaml > SHA1 Fingerprint: a502ff13999f8b398ef1834f1123650b3236fc07 > Copy above string into mqtt.ssl_fingerprints section of livingroom.yaml diff --git a/components/number/index.rst b/components/number/index.rst index d32079576..9cdb03526 100644 --- a/components/number/index.rst +++ b/components/number/index.rst @@ -43,16 +43,16 @@ Configuration variables: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. - **unit_of_measurement** (*Optional*, string): Manually set the unit - of measurement for the number. Requires Home Assistant Core 2021.12 or newer. + of measurement for the number. - **mode** (*Optional*, string): Defines how the number should be displayed in the frontend. See https://developers.home-assistant.io/docs/core/entity/number/#properties - for a list of available options. Requires Home Assistant Core 2021.12 or newer. + for a list of available options. Defaults to ``"auto"``. - **device_class** (*Optional*, string): The device class for the number. See https://www.home-assistant.io/integrations/number/#device-class diff --git a/components/output/ac_dimmer.rst b/components/output/ac_dimmer.rst index b70474852..0fd7ea664 100644 --- a/components/output/ac_dimmer.rst +++ b/components/output/ac_dimmer.rst @@ -2,7 +2,7 @@ AC Dimmer Component =================== .. seo:: - :description: Instructions for setting up AC Dimmer integration in ESPHome. + :description: Instructions for setting up AC Dimmer component in ESPHome. :image: ac_dimmer.svg .. warning:: @@ -16,9 +16,8 @@ AC Dimmer Component The ``ac_dimmer`` component allows you to connect a dimmable light or other load which supports phase control dimming to your ESPHome project. -There are several already made boards which are compatible with this integration, -for example the `RobotDyn dimmer -`__. +There are several already made boards which are compatible with this component, such as the +`RobotDyn dimmer `__. .. figure:: images/robotdyn_dimmer.jpg :align: center @@ -34,9 +33,9 @@ for example the `RobotDyn dimmer output: - platform: ac_dimmer id: dimmer1 - gate_pin: D7 + gate_pin: GPIOXX zero_cross_pin: - number: D6 + number: GPIOXX mode: input: true inverted: yes diff --git a/components/output/bp1658cj.rst b/components/output/bp1658cj.rst index 84aeb2136..2743b77ba 100644 --- a/components/output/bp1658cj.rst +++ b/components/output/bp1658cj.rst @@ -24,8 +24,8 @@ It is used in some smart light bulbs: # Example configuration entry bp1658cj: - data_pin: GPIO6 - clock_pin: GPIO7 + data_pin: GPIOXX + clock_pin: GPIOXX max_power_color_channels: 4 # Valid values 0-15 max_power_white_channels: 6 # Valid values 0-15 diff --git a/components/output/bp5758d.rst b/components/output/bp5758d.rst index ffbcc2340..adde2757b 100644 --- a/components/output/bp5758d.rst +++ b/components/output/bp5758d.rst @@ -24,8 +24,8 @@ It is used in some smart light bulbs: # Example configuration entry bp5758d: - data_pin: GPIO3 - clock_pin: GPIO5 + data_pin: GPIOXX + clock_pin: GPIOXX Configuration variables: diff --git a/components/output/custom.rst b/components/output/custom.rst index 501d46725..ad37e1bf0 100644 --- a/components/output/custom.rst +++ b/components/output/custom.rst @@ -1,17 +1,25 @@ Custom Output ============= +.. seo:: + :description: Instructions for setting up Custom C++ outputs with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create custom binary and float :doc:`outputs ` +.. warning:: + + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + +This component can be used to create custom binary and float :doc:`outputs ` in ESPHome using the C++ (Arduino) API. Please first read :doc:`/components/sensor/custom` guide, the same principles apply here. diff --git a/components/output/esp8266_pwm.rst b/components/output/esp8266_pwm.rst index e55a2dd43..ba2c572f7 100644 --- a/components/output/esp8266_pwm.rst +++ b/components/output/esp8266_pwm.rst @@ -15,7 +15,7 @@ like the one on the ESP32 (see :doc:`ledc`) are preferred. # Example configuration entry output: - platform: esp8266_pwm - pin: D1 + pin: GPIOXX frequency: 1000 Hz id: pwm_output diff --git a/components/output/gpio.rst b/components/output/gpio.rst index de9547819..26fdf0db9 100644 --- a/components/output/gpio.rst +++ b/components/output/gpio.rst @@ -14,7 +14,7 @@ will not show up in Home Assistant. See :doc:`/components/switch/gpio`. # Example configuration entry output: - platform: gpio - pin: D1 + pin: GPIOXX id: gpio_d1 Configuration variables: diff --git a/components/output/ledc.rst b/components/output/ledc.rst index 305b84350..a2e25b185 100644 --- a/components/output/ledc.rst +++ b/components/output/ledc.rst @@ -12,6 +12,32 @@ of the ESP32 as an output component. The frequency range of LEDC is from 10Hz to 40MHz - however, higher frequencies require a smaller bit depth which means the output is not that accurate for frequencies above ~300kHz. + +Configuration variables: +------------------------ + +- **pin** (**Required**, :ref:`config-pin`): The pin to use LEDC on. Can only be GPIO0-GPIO33. +- **id** (**Required**, :ref:`config-id`): The id to use for this output component. +- **frequency** (*Optional*, float): At which frequency to run the LEDC + channel’s timer. Defaults to 1000Hz. +- All other options from :ref:`Output `. + +Advanced options: + +- **channel** (*Optional*, int): Manually set the `LEDC + channel `__ + to use. Two adjacent channels share the same timer. Defaults to an automatic selection. + +Note: When configuring custom frequencies for two or more outputs, ensure that you manually specify +channel 0, 2, 4, 6 for each output. This will prevent issues that arise from automatic selection, +which chooses adjacent channels with shared timers. See +`Issue #3114 `__ for more details. + +- **phase_angle** (*Optional*, float): Set a phase angle to the other channel of this timer. + Range 0-360°, defaults to 0° + +Note: this variable is only available for the esp-idf framework + Example Usage For a Light ************************* @@ -20,8 +46,8 @@ Example Usage For a Light # Example configuration entry output: - platform: ledc - pin: GPIO19 - id: gpio_19 + pin: GPIOXX + id: gpio_ # Example usage in a light light: @@ -63,31 +89,6 @@ Example Usage For a Piezo Buzzer id: buzzer level: "50%" -Configuration variables: ------------------------- - -- **pin** (**Required**, :ref:`config-pin`): The pin to use LEDC on. Can only be GPIO0-GPIO33. -- **id** (**Required**, :ref:`config-id`): The id to use for this output component. -- **frequency** (*Optional*, float): At which frequency to run the LEDC - channel’s timer. Defaults to 1000Hz. -- All other options from :ref:`Output `. - -Advanced options: - -- **channel** (*Optional*, int): Manually set the `LEDC - channel `__ - to use. Two adjacent channels share the same timer. Defaults to an automatic selection. - -Note: When configuring custom frequencies for two or more outputs, ensure that you manually specify -channel 0, 2, 4, 6 for each output. This will prevent issues that arise from automatic selection, -which chooses adjacent channels with shared timers. See -`Issue #3114 `__ for more details. - -- **phase_angle** (*Optional*, float): Set a phase angle to the other channel of this timer. - Range 0-360°, defaults to 0° - -Note: this variable is only available for the esp-idf framework - Recommended frequencies ----------------------- diff --git a/components/output/my9231.rst b/components/output/my9231.rst index db062f5b6..c195b46dd 100644 --- a/components/output/my9231.rst +++ b/components/output/my9231.rst @@ -31,14 +31,9 @@ global ``my9231`` hub and give it an id, and then define the # Example configuration entry my9231: - - data_pin: GPIO12 - clock_pin: GPIO14 + - data_pin: GPIOXX + clock_pin: GPIOXX - # Individual outputs - output: - - platform: my9231 - id: 'my9231_output1' - channel: 0 Configuration variables: ************************ @@ -68,11 +63,6 @@ The MY931/MY9291 output component exposes a MY931/MY9291 channel of a global .. code-block:: yaml - # Example configuration entry - my9231: - - data_pin: GPIO12 - clock_pin: GPIO14 - # Individual outputs output: - platform: my9231 diff --git a/components/output/pca9685.rst b/components/output/pca9685.rst index 42772ecbf..00e9b6293 100644 --- a/components/output/pca9685.rst +++ b/components/output/pca9685.rst @@ -44,7 +44,7 @@ global ``pca9685`` hub and give it an id, and then define the output: # generate PWM from ESP32 ledc - platform: ledc - pin: 25 + pin: GPIOXX id: extclk min_power: 1 frequency: 40MHz @@ -118,10 +118,10 @@ This output can be used for different PWM functions. E.g. output for light, fan - platform: pca9685 channel: 0 id: pwm01 - + light: - - platform: monochromatic - name: 'main light' + - platform: monochromatic + name: 'main light' output: pwm01 See Also diff --git a/components/output/sigma_delta_output.rst b/components/output/sigma_delta_output.rst index 9884f00b9..55b69a8a2 100644 --- a/components/output/sigma_delta_output.rst +++ b/components/output/sigma_delta_output.rst @@ -1,7 +1,7 @@ Sigma-Delta Output ================== -This integration uses `sigma-delta modulation `__ +This component uses `sigma-delta modulation `__ to output a floating-point value on a binary output. Unlike with :doc:`/components/output/slow_pwm`, it is possible to update the output value with each update cycle, not just at the end of a longer period. @@ -14,13 +14,13 @@ it is possible to update the output value with each update cycle, not just at th For example, if you choose to toggle the output at most once every 1 second and decide on a PWM period of 10 seconds, for reasonably frequent updates, with :doc:`/components/output/slow_pwm` there are only 10 possible levels, and for higher precision a longer update interval is needed, -restricting the update rate. +restricting the update rate. A *sigma-delta* output is updated during each cycle, thus a higher precision can be achieved, without being constrained by a calculation timeframe (=period). So instead of having to define a ``period`` where the width of the pulse determines the output level, here you -choose an ``update_interval`` which acts like a clock signal from where the pulse density determines the output level. +choose an ``update_interval`` which acts like a clock signal from where the pulse density determines the output level. This component can be used as a drop-in replacement for :doc:`/components/output/slow_pwm` by changing the ``platform`` to ``sigma_delta_output`` and changing ``period`` to ``update_interval`` (you usually want to set the *sigma-delta*'s @@ -35,7 +35,7 @@ This component can be used as a drop-in replacement for :doc:`/components/output id: sd_heater_output # Output to a pin - pin: 15 + pin: GPIOXX # Use the same output, but through automations turn_on_action: @@ -44,9 +44,9 @@ This component can be used as a drop-in replacement for :doc:`/components/output turn_off_action: then: - output.turn_off: heater_relay - + - platform: gpio - pin: 15 + pin: GPIOXX id: heater_relay Configuration variables: diff --git a/components/output/slow_pwm.rst b/components/output/slow_pwm.rst index 34d6c8aa7..bef7ae0ec 100644 --- a/components/output/slow_pwm.rst +++ b/components/output/slow_pwm.rst @@ -22,7 +22,7 @@ heating element through a relay where a fast PWM update cycle would not be appro # Example configuration entry output: - platform: slow_pwm - pin: D1 + pin: GPIOXX id: my_slow_pwm period: 15s diff --git a/components/output/sm16716.rst b/components/output/sm16716.rst index e5fc31826..d8e8bd856 100644 --- a/components/output/sm16716.rst +++ b/components/output/sm16716.rst @@ -28,22 +28,11 @@ global ``sm16716`` hub and give it an id, and then define the # Example configuration entry sm16716: - data_pin: GPIO14 - clock_pin: GPIO4 + data_pin: GPIOXX + clock_pin: GPIOXX num_channels: 3 num_chips: 1 - # Individual outputs - output: - - platform: sm16716 - id: output_red - channel: 0 - - platform: sm16716 - id: output_green - channel: 1 - - platform: sm16716 - id: output_blue - channel: 2 Configuration variables: ************************ @@ -69,13 +58,6 @@ The SM16716 output component exposes a SM16716 channel of a global .. code-block:: yaml - # Example configuration entry - sm16716: - data_pin: GPIO14 - clock_pin: GPIO4 - num_channels: 3 - num_chips: 1 - # Individual outputs output: - platform: sm16716 @@ -174,7 +156,7 @@ A complete configuration for a Feit Electric A19 looks like: The white LEDs are much brighter than the color LEDs and will fully overpower the set color when the white level is set even a little bit high. You will need to set the white level to 0 in order to get usable colors from this bulb. - + Alternative Costco Feit A19 RGBCT bulb configuration: .. code-block:: yaml @@ -224,8 +206,8 @@ Alternative Costco Feit A19 RGBCT bulb configuration: power_supply: - id: rgb_power pin: GPIO13 - - + + See Also -------- diff --git a/components/output/sm2135.rst b/components/output/sm2135.rst index 2ff9a1488..df6b064d2 100644 --- a/components/output/sm2135.rst +++ b/components/output/sm2135.rst @@ -27,31 +27,9 @@ global ``sm2135`` hub and give it an id, and then define the # Example configuration entry sm2135: - data_pin: GPIO12 - clock_pin: GPIO14 + data_pin: GPIOXX + clock_pin: GPIOXX - # Individual outputs - output: - - platform: sm2135 - id: output_red - channel: 0 - max_power: 0.8 - - platform: sm2135 - id: output_green - channel: 1 - max_power: 0.8 - - platform: sm2135 - id: output_blue - channel: 2 - max_power: 0.8 - - platform: sm2135 - id: output_white - channel: 3 - max_power: 0.8 - - platform: sm2135 - id: output_warmwhite - channel: 4 - max_power: 0.8 Configuration variables: ************************ @@ -62,7 +40,7 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): The id to use for this ``sm2135`` component. Use this if you have multiple SM2135 chains connected at the same time. -- **cw_current** (*Optional*, current): The current used for the white channel. +- **cw_current** (*Optional*, current): The current used for the white channel. Defaults to ``10mA``. Can be one of ``10mA``, ``15mA``, ``20mA``, ``25mA``, ``30mA``, ``35mA``, ``40mA``, ``45mA``, ``50mA``, ``55mA``, ``60mA``. - **rgb_current** (*Optional*, current): The current used for the RGB channel. @@ -82,11 +60,6 @@ The SM2135 output component exposes a SM2135 channel of a global .. code-block:: yaml - # Example configuration entry - sm2135: - data_pin: GPIO12 - clock_pin: GPIO14 - # Individual outputs output: - platform: sm2135 diff --git a/components/output/sm2235.rst b/components/output/sm2235.rst index 71cbb7c30..e3008a032 100644 --- a/components/output/sm2235.rst +++ b/components/output/sm2235.rst @@ -21,8 +21,8 @@ global ``sm2235`` hub and give it an id, and then define the # Example configuration entry sm2235: - data_pin: GPIO4 - clock_pin: GPIO5 + data_pin: GPIOXX + clock_pin: GPIOXX max_power_color_channels: 9 max_power_white_channels: 9 diff --git a/components/output/sm2335.rst b/components/output/sm2335.rst index 011df7bc9..9ed107cbe 100644 --- a/components/output/sm2335.rst +++ b/components/output/sm2335.rst @@ -24,8 +24,8 @@ global ``sm2335`` hub and give it an id, and then define the # Example configuration entry sm2335: - data_pin: GPIO4 - clock_pin: GPIO5 + data_pin: GPIOXX + clock_pin: GPIOXX max_power_color_channels: 9 max_power_white_channels: 9 diff --git a/components/output/template.rst b/components/output/template.rst index 267c47cca..b479bcff7 100644 --- a/components/output/template.rst +++ b/components/output/template.rst @@ -22,14 +22,10 @@ The ``template`` output component can be used to create templated binary and flo id: output2 level: !lambda return state; - - platform: esp8266_pwm + - platform: ... id: output1 - pin: GPIO12 - inverted: true - - platform: esp8266_pwm + - platform: ... id: output2 - pin: GPIO14 - inverted: true diff --git a/components/output/tlc5947.rst b/components/output/tlc5947.rst index 57b84345d..0a880d44e 100644 --- a/components/output/tlc5947.rst +++ b/components/output/tlc5947.rst @@ -27,21 +27,9 @@ global ``tlc5947`` hub and give it an id, and then define the # Example configuration entry tlc5947: - data_pin: GPIO12 - clock_pin: GPIO14 - lat_pin: GPIO15 - - # Individual outputs - output: - - platform: tlc5947 - id: output_red - channel: 0 - - platform: tlc5947 - id: output_green - channel: 1 - - platform: tlc5947 - id: output_blue - channel: 2 + data_pin: GPIOXX + clock_pin: GPIOXX + lat_pin: GPIOXX Configuration variables: ************************ @@ -66,12 +54,6 @@ The tlc5947 output component exposes a tlc5947 channel of a global .. code-block:: yaml - # Example configuration entry - tlc5947: - data_pin: GPIO12 - clock_pin: GPIO14 - lat_pin: GPIO15 - # Individual outputs output: - platform: tlc5947 diff --git a/components/output/tlc5971.rst b/components/output/tlc5971.rst index 0a371c761..5701b3627 100644 --- a/components/output/tlc5971.rst +++ b/components/output/tlc5971.rst @@ -27,20 +27,9 @@ global ``tlc5971`` hub and give it an id, and then define the # Example configuration entry tlc5971: - data_pin: GPIO12 - clock_pin: GPIO14 + data_pin: GPIOXX + clock_pin: GPIOXX - # Individual outputs - output: - - platform: tlc5971 - id: output_red - channel: 0 - - platform: tlc5971 - id: output_green - channel: 1 - - platform: tlc5971 - id: output_blue - channel: 2 Configuration variables: ************************ @@ -63,11 +52,6 @@ The tlc5971 output component exposes a tlc5971 channel of a global .. code-block:: yaml - # Example configuration entry - tlc5971: - data_pin: GPIO12 - clock_pin: GPIO14 - # Individual outputs output: - platform: tlc5971 diff --git a/components/output/x9c.rst b/components/output/x9c.rst index ce7732d91..4a1ffebc8 100644 --- a/components/output/x9c.rst +++ b/components/output/x9c.rst @@ -15,7 +15,7 @@ The ``x9c`` output platform allows you to add an output that controls a `X9C dig The X9C family of digital potentiometers are available in different resistance values. -==================== ===================== +==================== ===================== ``X9C102`` ``1kΩ`` -------------------- --------------------- ``X9C103`` ``10kΩ`` @@ -33,9 +33,9 @@ All chips are controlled by a three wire interface and feature 100 possible wipe output: - platform: x9c id: x9c_pot - cs_pin: GPIO25 - inc_pin: GPIO27 - ud_pin: GPIO26 + cs_pin: GPIOXX + inc_pin: GPIOXX + ud_pin: GPIOXX initial_value: 0.5 Configuration variables: diff --git a/components/pipsolar.rst b/components/pipsolar.rst index d7f20ca46..5597ec1da 100644 --- a/components/pipsolar.rst +++ b/components/pipsolar.rst @@ -37,16 +37,8 @@ There is a buffer to buffer up to 10 commands. .. code-block:: yaml # Example configuration entry - uart: - - id: uart_bus - tx_pin: GPIO18 - rx_pin: GPIO19 - # most devices use 2400 as baud_rate - baud_rate: 2400 - pipsolar: - - uart_id: uart_bus - id: inverter0 + - id: inverter0 Configuration variables: ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/components/pn7150.rst b/components/pn7150.rst index b76e6e2df..498f713ac 100644 --- a/components/pn7150.rst +++ b/components/pn7150.rst @@ -30,10 +30,10 @@ In addition, the :doc:`binary_sensor/nfc` platform may be used to quickly and ea .. code-block:: yaml pn7150_i2c: - dwl_req_pin: 17 - irq_pin: 35 - ven_pin: 16 - wkup_req_pin: 21 + dwl_req_pin: GPIOXX + irq_pin: GPIOXX + ven_pin: GPIOXX + wkup_req_pin: GPIOXX emulation_message: https://www.home-assistant.io/tag/pulse_ce tag_ttl: 1000ms @@ -348,7 +348,7 @@ NDEF Writing The examples below illustrate how NDEF messages may be written to cards/tags via the PN7150. Note that a :doc:`button ` is a great mechanism to use to trigger these actions. -The first example will write a simple, fixed NDEF message to a tag. +The first example will write a simple, fixed NDEF message to a tag. .. code-block:: yaml diff --git a/components/pn7160.rst b/components/pn7160.rst index f359a7b5d..dd8d6b5ca 100644 --- a/components/pn7160.rst +++ b/components/pn7160.rst @@ -42,11 +42,11 @@ The ``pn7160_spi`` component allows you to use :ref:`SPI-equipped ` PN7160 .. code-block:: yaml pn7160_spi: - cs_pin: 15 - dwl_req_pin: 17 - irq_pin: 35 - ven_pin: 16 - wkup_req_pin: 21 + cs_pin: GPIOXX + dwl_req_pin: GPIOXX + irq_pin: GPIOXX + ven_pin: GPIOXX + wkup_req_pin: GPIOXX emulation_message: https://www.home-assistant.io/tag/pulse_ce tag_ttl: 1000ms @@ -87,10 +87,10 @@ The ``pn7160_i2c`` component allows you to use :ref:`I²C-equipped ` PN7160 .. code-block:: yaml pn7160_i2c: - dwl_req_pin: 17 - irq_pin: 35 - ven_pin: 16 - wkup_req_pin: 21 + dwl_req_pin: GPIOXX + irq_pin: GPIOXX + ven_pin: GPIOXX + wkup_req_pin: GPIOXX emulation_message: https://www.home-assistant.io/tag/pulse_ce tag_ttl: 1000ms @@ -406,7 +406,7 @@ NDEF Writing The examples below illustrate how NDEF messages may be written to cards/tags via the PN7160. Note that a :doc:`button ` is a great mechanism to use to trigger these actions. -The first example will write a simple, fixed NDEF message to a tag. +The first example will write a simple, fixed NDEF message to a tag. .. code-block:: yaml diff --git a/components/power_supply.rst b/components/power_supply.rst index f4e69c574..bdd734a8a 100644 --- a/components/power_supply.rst +++ b/components/power_supply.rst @@ -21,7 +21,7 @@ after the last output has been disabled. # Example configuration entry power_supply: - id: 'power_supply1' - pin: 13 + pin: GPIOXX Configuration variables: ------------------------ diff --git a/components/remote_receiver.rst b/components/remote_receiver.rst index d3eb1f6f5..c7bb7ff63 100644 --- a/components/remote_receiver.rst +++ b/components/remote_receiver.rst @@ -20,7 +20,7 @@ which will trigger when they hear their own configured signal. # Example configuration entry remote_receiver: - pin: GPIO32 + pin: GPIOXX dump: all Configuration variables: @@ -54,13 +54,19 @@ Configuration variables: - **rc5**: Decode and dump RC5 IR codes. - **rc6**: Decode and dump RC6 IR codes. - **rc_switch**: Decode and dump RCSwitch RF codes. + - **roomba**: Decode and dump Roomba infrared codes. - **samsung**: Decode and dump Samsung infrared codes. - **samsung36**: Decode and dump Samsung36 infrared codes. - **sony**: Decode and dump Sony infrared codes. - **toshiba_ac**: Decode and dump Toshiba AC infrared codes. -- **tolerance** (*Optional*, int): The percentage that the remote signal lengths can deviate in the - decoding process. Defaults to ``25%``. +- **tolerance** (*Optional*, int, :ref:`config-time` or mapping): The percentage or time that the remote signal lengths can + deviate in the decoding process. Defaults to ``25%``. + + - **type** (**Required**, enum): Set the type of the tolerance. Can be ``percentage`` or ``time``. + - **value** (**Required**, int or :ref:`config-time`): The percentage or time value. Allowed values are in range ``0`` to + ``100%`` or ``0`` to ``4294967295us``. + - **buffer_size** (*Optional*, int): The size of the internal buffer for storing the remote codes. Defaults to ``10kB`` on the ESP32 and ``1kB`` on the ESP8266. - **rmt_channel** (*Optional*, int): The RMT channel to use. Only on **esp32**. @@ -74,14 +80,17 @@ Configuration variables: "ESP32-S3", "4, 5, 6, 7" "ESP32-C3", "2, 3" -- **memory_blocks** (*Optional*, int): The number of RMT memory blocks used. Only used on ESP32 platform. Defaults to - ``3``. +- **memory_blocks** (*Optional*, int): The number of RMT memory blocks used. Only used on ESP32 platform. The maximum + number of blocks shared by all receivers and transmitters depends on the ESP32 variant. Defaults to ``3``. - **filter** (*Optional*, :ref:`config-time`): Filter any pulses that are shorter than this. Useful for removing - glitches from noisy signals. Defaults to ``50us``. + glitches from noisy signals. Allowed values are in range ``0`` to ``4294967295us``. Defaults to ``50us``. - **idle** (*Optional*, :ref:`config-time`): The amount of time that a signal should remain stable (i.e. not - change) for it to be considered complete. Defaults to ``10ms``. + change) for it to be considered complete. Allowed values are in range ``0`` to ``4294967295us``. Defaults to ``10ms``. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. Use this if you have multiple remote receivers. +- **clock_divider** (*Optional*, int): The clock divider used by the RMT peripheral. A clock divider of ``80`` leads to + a resolution of 1 µs per tick, ``160`` leads to 2 µs. Allowed values are in range ``1`` to ``255``. Only used on ESP32 + platform. Defaults to ``80``. .. note:: @@ -165,6 +174,9 @@ Automations: - **on_rc_switch** (*Optional*, :ref:`Automation `): An automation to perform when a RCSwitch RF code has been decoded. A variable ``x`` of type :apistruct:`remote_base::RCSwitchData` is passed to the automation for use in lambdas. +- **on_roomba** (*Optional*, :ref:`Automation `): An automation to perform when a + Roomba remote code has been decoded. A variable ``x`` of type :apistruct:`remote_base::RoombaData` + is passed to the automation for use in lambdas. - **on_samsung** (*Optional*, :ref:`Automation `): An automation to perform when a Samsung remote code has been decoded. A variable ``x`` of type :apistruct:`remote_base::SamsungData` is passed to the automation for use in lambdas. @@ -206,10 +218,6 @@ then immediately OFF. .. code-block:: yaml # Example configuration entry - remote_receiver: - pin: GPIO32 - dump: all - binary_sensor: - platform: remote_receiver name: "Panasonic Remote Input" @@ -398,6 +406,10 @@ Remote code selection (exactly one of these has to be included): - **state** (**Required**, boolean): The on/off state to trigger on. - **protocol** (*Optional*): The RC Switch protocol to use, see :ref:`remote_transmitter-rc_switch-protocol` for more info. +- **roomba**: Trigger on a decoded Roomba remote code with the given data. + + - **data** (**Required**, int): The Roomba code to trigger on, see dumper output for more info. + - **samsung**: Trigger on a decoded Samsung remote code with the given data. - **data** (**Required**, int): The data to trigger on, see dumper output for more info. @@ -439,7 +451,7 @@ Remote code selection (exactly one of these has to be included): remote_receiver: pin: - number: D4 + number: GPIOXX inverted: true mode: input: true @@ -475,4 +487,3 @@ See Also - `IRRemoteESP8266 `__ by `Mark Szabo-Simon `__ - :apiref:`remote/remote_receiver.h` - :ghedit:`Edit` - diff --git a/components/remote_transmitter.rst b/components/remote_transmitter.rst index 5d34b30b3..342d74539 100644 --- a/components/remote_transmitter.rst +++ b/components/remote_transmitter.rst @@ -24,18 +24,9 @@ remote signals. # Example configuration entry remote_transmitter: - pin: GPIO32 + pin: GPIOXX carrier_duty_percent: 50% - # Individual switches - switch: - - platform: template - name: "Panasonic TV Off" - turn_on_action: - remote_transmitter.transmit_panasonic: - address: 0x4004 - command: 0x100BCBD - Configuration variables: ------------------------ @@ -293,7 +284,7 @@ Configuration variables: - **id** (**Required**, int): The 24-bit ID to send. Each remote has a unique one. - **channel** (**Required**, int): The 8-bit channel to send, between 0 and 255 inclusive. -- **button** (**Required**, int): The 4-bit button to send, between 0 and 15 inclusive. +- **button** (**Required**, int): The 4-bit button to send, between 0 and 15 inclusive. - **check** (**Required**, int): The 4-bit check to send. Includes an indication that a button is being held down. See dumper output for more info. - All other options from :ref:`remote_transmitter-transmit_action`. @@ -781,6 +772,29 @@ Configuration variables: for more information. - All other options from :ref:`remote_transmitter-transmit_action`. +.. _remote_transmitter-transmit_roomba: + +``remote_transmitter.transmit_roomba`` Action +********************************************* + +This :ref:`action ` sends a Roomba infrared remote code to a remote transmitter. + +.. code-block:: yaml + + on_...: + - remote_transmitter.transmit_roomba: + data: 0x88 # clean + repeat: + times: 3 + wait_time: 17ms + +Configuration variables: + +- **data** (**Required**, int): The Roomba code to send, see dumper output for more info. +- Note that ``repeat`` is still optional, however **Roomba vacuums require that a given code is received at least three times before they will act on it.** If your Roomba still does not respond to sent command increase this value. +- Note that ``wait_time`` is still optional; it will even work without this parameter, but Roomba Remote uses this 17 ms wait time between sent commands. +- All other options from :ref:`remote_transmitter-transmit_action`. + .. _remote_transmitter-transmit_samsung: ``remote_transmitter.transmit_samsung`` Action @@ -911,7 +925,7 @@ remote_receiver instance: .. code-block:: yaml remote_receiver: - pin: D0 + pin: GPIOXX dump: all Compile and upload the code. While viewing the log output from the ESP, @@ -940,7 +954,7 @@ IR diode to a new pin on the ESP and configure a global ``remote_transmitter`` i .. code-block:: yaml remote_transmitter: - pin: D1 + pin: GPIOXX # Infrared remotes use a 50% carrier signal carrier_duty_percent: 50% @@ -986,7 +1000,7 @@ First, connect the RF module to a pin on the ESP and set up a remote_receiver in .. code-block:: yaml remote_receiver: - pin: D0 + pin: GPIOXX dump: all # Settings to optimize recognition of RF devices tolerance: 50% @@ -1018,7 +1032,7 @@ You should see log output like below: .. code-block:: yaml remote_receiver: - pin: D0 + pin: GPIOXX dump: - rc_switch tolerance: 50% @@ -1036,7 +1050,7 @@ RF transmitter to a new pin on the ESP and configure a global ``remote_transmitt .. code-block:: yaml remote_transmitter: - pin: D1 + pin: GPIOXX # RF uses a 100% carrier signal carrier_duty_percent: 100% diff --git a/components/rtttl.rst b/components/rtttl.rst index d8e6e2c70..b502a649e 100644 --- a/components/rtttl.rst +++ b/components/rtttl.rst @@ -127,7 +127,7 @@ Common beeps You can do your own beep patterns too! Here's a short collection so you can just use right away or tweak them to your like: -.. code-block:: +.. code-block:: two_short:d=4,o=5,b=100:16e6,16e6 long:d=1,o=5,b=100:e6 @@ -165,7 +165,7 @@ Sample code output: - platform: esp8266_pwm - pin: D1 + pin: GPIOXX id: rtttl_out rtttl: diff --git a/components/select/index.rst b/components/select/index.rst index a79c4d926..77fc53891 100644 --- a/components/select/index.rst +++ b/components/select/index.rst @@ -43,10 +43,10 @@ Configuration variables: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. Automations: diff --git a/components/sensor/adc.rst b/components/sensor/adc.rst index 3f6145292..fdb43a66a 100644 --- a/components/sensor/adc.rst +++ b/components/sensor/adc.rst @@ -22,7 +22,7 @@ ADC in your device to measure a voltage on certain pins. # Example configuration entry sensor: - platform: adc - pin: A0 + pin: GPIOXX name: "Living Room Brightness" update_interval: 60s diff --git a/components/sensor/adc128s102.rst b/components/sensor/adc128s102.rst index 779997910..780d016d4 100644 --- a/components/sensor/adc128s102.rst +++ b/components/sensor/adc128s102.rst @@ -6,8 +6,8 @@ ADC128S102 8-Channel 12-Bit A/D Converter :keywords: ADC128S102 :image: adc128s102.png -The ADC128S102 is a low-power, eight-channel CMOS 12-bit analog-to-digital converter specified for conversion -throughput rates of 500 ksps to 1 MSPS. The converter is based on a successive-approximation register architecture +The ADC128S102 is a low-power, eight-channel CMOS 12-bit analog-to-digital converter specified for conversion +throughput rates of 500 ksps to 1 MSPS. The converter is based on a successive-approximation register architecture with an internal track-and-hold circuit. .. figure:: images/adc128s102.png @@ -31,16 +31,9 @@ sensors for your projects. # Example configuration entry adc128s102: - cs_pin: GPIO15 + cs_pin: GPIOXX id: my_adc - sensor: - - platform: adc128s102 # Attached to pin 0 of the ADC128S102. - update_interval: 1s - adc128s102_id: my_adc - id: freezer_temp_source - channel: 0 # ADC128S102 channel - Configuration variables: - **id** (**Required**, :ref:`config-id`): The id to use for this ADC128S102 component. - **cs_pin** (**Required**, int): The SPI cable select pin to use @@ -52,6 +45,15 @@ The ``adc128s102`` sensor allows you to use your ADC128S102 12-Bit A/D Converter First, setup a :ref:`ADC128S102 Hub ` for your ADC128S102 sensor and then use this sensor platform to create individual sensors that will report the voltage to Home Assistant. +.. code-block:: yaml + + sensor: + - platform: adc128s102 # Attached to pin 0 of the ADC128S102. + update_interval: 1s + adc128s102_id: my_adc + id: freezer_temp_source + channel: 0 # ADC128S102 channel + Configuration variables: - **adc128s102_id** (**Required**, :ref:`config-id`): The id of the parent ADC128S102 component. diff --git a/components/sensor/ade7880.rst b/components/sensor/ade7880.rst index aca0c5a90..139aaf8e7 100644 --- a/components/sensor/ade7880.rst +++ b/components/sensor/ade7880.rst @@ -190,9 +190,9 @@ configured). sensor: - platform: ade7880 irq0_pin: - number: GPIO13 + number: GPIOXX irq1_pin: - number: GPIO5 + number: GPIOXX phase_a: name: Room Heater voltage: Voltage @@ -217,9 +217,9 @@ Heater Current', etc. sensor: - platform: ade7880 irq0_pin: - number: GPIO13 + number: GPIOXX irq1_pin: - number: GPIO5 + number: GPIOXX phase_a: voltage: Voltage current: @@ -249,11 +249,11 @@ configuration mode. sensor: - platform: ade7880 irq0_pin: - number: GPIO13 + number: GPIOXX irq1_pin: - number: GPIO5 + number: GPIOXX reset_pin: - number: GPIO16 + number: GPIOXX frequency: 60Hz phase_a: name: Phase A diff --git a/components/sensor/ade7953.rst b/components/sensor/ade7953.rst index f7e9d920c..c9aa54c02 100644 --- a/components/sensor/ade7953.rst +++ b/components/sensor/ade7953.rst @@ -35,7 +35,7 @@ Over I²C # Example configuration entry for i2c sensor: - platform: ade7953_i2c - irq_pin: GPIO16 + irq_pin: GPIOXX voltage: name: ADE7953 Voltage frequency: @@ -129,69 +129,35 @@ Over SPI .. code-block:: yaml - # Example configuration entry for SPI (taken from a Shelly Pro 4PM) + # Example configuration entry for SPI sensor: - platform: ade7953_spi - cs_pin: GPIO04 - irq_pin: GPIO35 - current_pga_gain_a: 2x - current_pga_gain_b: 2x - current_gain_a: 0x600000 - current_gain_b: 0x600000 + cs_pin: GPIOXX + irq_pin: GPIOXX voltage: name: "Voltage" - filters: - - delta: 1 frequency: name: ADE7953 Frequency - filters: - - delta: 0.1 current_a: name: "Current A" - filters: - - delta: 0.01 current_b: name: "Current B" - filters: - - delta: 0.01 power_factor_a: name: "Power Factor A" - filters: - - delta: 5 power_factor_b: name: "ADE7953 Power Factor B" - filters: - - delta: 5 apparent_power_a: name: "Apparent Power A" - filters: - - delta: 1 apparent_power_b: name: "Apparent Power B" - filters: - - delta: 1 active_power_a: name: "Power A" - id: active_power_1 - # active_power is inverted, so multiply by -1 - filters: - - multiply: -1 - - delta: 1 active_power_b: name: "Power B" - id: active_power_2 - # active_power is inverted, so multiply by -1 - filters: - - multiply: -1 - - delta: 1 reactive_power_a: name: "Reactive Power A" - filters: - - delta: 1 reactive_power_b: name: "Reactive Power B" - filters: - - delta: 1 Configuration variables: ************************ diff --git a/components/sensor/ads1115.rst b/components/sensor/ads1115.rst index cc1640bcc..3e2eb83c4 100644 --- a/components/sensor/ads1115.rst +++ b/components/sensor/ads1115.rst @@ -36,7 +36,7 @@ Configuration variables: - **address** (**Required**, int): The i²c address of the sensor. See :ref:`I²C Addresses ` for more information. - **continuous_mode** (*Optional*, boolean): Set if the ADS1115 should continuously measure voltages or - only measure them when an update is called. Please enable this for the :doc:`ct_clamp` integration. + only measure them when an update is called. Please enable this for the :doc:`ct_clamp` component. Defaults to ``off``. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID for this ADS1115 Hub. Use this if you want to use multiple ADS1115 hubs at once. diff --git a/components/sensor/ads1118.rst b/components/sensor/ads1118.rst index 52947293b..416fcc05f 100644 --- a/components/sensor/ads1118.rst +++ b/components/sensor/ads1118.rst @@ -25,7 +25,7 @@ It uses the :ref:`SPI Bus ` for communication. .. code-block:: yaml ads1118: - cs_pin: GPIO15 + cs_pin: GPIOXX Configuration variables: ************************ @@ -46,14 +46,12 @@ sensor platform to create individual sensors that will report the voltage. .. code-block:: yaml - ads1118: - cs_pin: GPIO15 sensor: - platform: ads1118 - type: 'adc' - id: 'batt_volt' - name: "Battery Voltage" - multiplexer: 'A3_GND' + type: adc + id: batt_volt + name: Battery Voltage + multiplexer: A3_GND gain: 4.096 update_interval: .01s diff --git a/components/sensor/airthings_ble.rst b/components/sensor/airthings_ble.rst index c29f966b4..e6fad15e7 100644 --- a/components/sensor/airthings_ble.rst +++ b/components/sensor/airthings_ble.rst @@ -135,8 +135,7 @@ Battery Level Reporting *********************** If you wish to have the 'percentage of battery life remaining' -reported as a sensor, you can make use of the :ref:`copy-sensor` -integration. +reported as a sensor, you can make use of the :ref:`copy-sensor` component. The examples below are based on standard alkaline-chemistry batteries; if you use other types of batteries you may need to adjust the diff --git a/components/sensor/as3935.rst b/components/sensor/as3935.rst index 7bc0aa4f0..c8e20951f 100644 --- a/components/sensor/as3935.rst +++ b/components/sensor/as3935.rst @@ -19,7 +19,7 @@ Component/Hub The AS3935 can be configured to use either the SPI **or** I²C protocol for data communication. First choose which communication method you want to use for the sensor, set the SI pin for the appropriate -level and set up the ESPHome integration for the chosen communication method. +level and set up the ESPHome component for the chosen communication method. Module Pins ----------- @@ -58,20 +58,10 @@ The ``as3935_spi`` sensor platform allows you to use your AS3935 sensor .. code-block:: yaml - # Example configuration for SPI (decide for one!) + # Example configuration for SPI as3935_spi: - cs_pin: GPIO12 - irq_pin: GPIO13 - # Example lightning and energy sensor - sensor: - - platform: as3935 - lightning_energy: - name: "Lightning Energy" - distance: - name: "Distance Storm" - binary_sensor: - - platform: as3935 - name: "Storm Alert" + cs_pin: GPIOXX + irq_pin: GPIOXX Configuration variables: @@ -117,19 +107,9 @@ The ``as3935_i2c`` sensor platform allows you to use your AS3935 sensor .. code-block:: yaml - # Example configuration for I²C (decide for one!) + # Example configuration for I²C as3935_i2c: - irq_pin: GPIO12 - # Example shared configuration - sensor: - - platform: as3935 - lightning_energy: - name: "Lightning Energy" - distance: - name: "Distance Storm" - binary_sensor: - - platform: as3935 - name: "Storm Alert" + irq_pin: GPIOXX Configuration variables: ************************ @@ -173,19 +153,22 @@ Sensor A sensor platform to read lightning data +.. code-block:: yaml + + sensor: + - platform: as3935 + lightning_energy: + name: Lightning Energy + distance: + name: Distance Storm + Configuration variables: - **lightning_energy** (*Optional*): Lightning energy value. According to the datasheet this is only a pure value that doesn't have any physical meaning. - - - **name** (**Required**, string): The name for the lightning energy sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **distance** (*Optional*): Distance in km to the front of the storm and not the distance to a lightning strike. - - - **name** (**Required**, string): The name for the distance sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. Binary Sensor @@ -193,11 +176,16 @@ Binary Sensor Binary sensor that indicates if a lightning strike was detected. +.. code-block:: yaml + + # Example storm alert binary sensor + binary_sensor: + - platform: as3935 + name: Storm Alert + Configuration variables: -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- All other options from :ref:`Binary Sensor `. +- All options from :ref:`Binary Sensor `. See Also diff --git a/components/sensor/as5600.rst b/components/sensor/as5600.rst index 51fe34b41..80126e3f5 100644 --- a/components/sensor/as5600.rst +++ b/components/sensor/as5600.rst @@ -30,7 +30,7 @@ the :ref:`I²C Bus ` and connect the sensor to the pins specified there. .. code-block:: yaml as5600: - dir_pin: 22 + dir_pin: GPIOXX start_position: 0deg range: 180deg @@ -39,7 +39,7 @@ Configuration variables: - **dir_pin** (*Optional*, int): The pin connected to the AS5600's direction pin. See :ref:`Direction ` for more information. -- **direction** (*Optional*, string): The direction that the magnet should rotate to increase values. +- **direction** (*Optional*, string): The direction that the magnet should rotate to increase values. Used in combination with the **dir_pin**. - ``clockwise`` (default) @@ -57,7 +57,7 @@ Configuration variables: - ``lsb2`` - ``lsb3`` -- **power_mode** (*Optional*, string): The power mode to run the sensor. Note: When **watchdog** is enabled, +- **power_mode** (*Optional*, string): The power mode to run the sensor. Note: When **watchdog** is enabled, it will switch the device to ``low3`` when there is not much change in position. - ``nominal`` (default) @@ -65,7 +65,7 @@ Configuration variables: - ``low2`` - ``low3`` -- **watchdog** (*Optional*, boolean): Whether to enable the watchdog that puts the the chip in to +- **watchdog** (*Optional*, boolean): Whether to enable the watchdog that puts the the chip in to low power mode 3. Check the datasheet for more information. Defaults to ``off``. - **slow_filter** (*Optional*, string): See datasheet. @@ -98,9 +98,9 @@ Direction The AS5600 has ``direction`` pin that controls which rotation direction will cause the position value to **increase**. This pin should be pulled low for clockwise, and pulled high for counterclockwise. If left floating, you are likely -to encounter erratic behavior. +to encounter erratic behavior. -If you would like the ESP controller to pull that pin high or low, you may configure the ``dir_pin`` and optionally, the +If you would like the ESP controller to pull that pin high or low, you may configure the ``dir_pin`` and optionally, the ``direction`` option to have the ESP controller pull the pin high or low. .. _as5600_position_range: @@ -136,7 +136,7 @@ For example, let's say we have the following component config: start_position: 90deg range: 180deg direction: clockwise - dir_pin: 22 + dir_pin: GPIOXX - If the magnet north was at the right side of the chip (i.e. 1024 / 90deg raw position), the scaled position would report a value of ``0``. - If the magnet north was at the bottom of the chip (i.e. 2048 / 180deg raw position), the scaled position would report a value of ``2048``. @@ -147,7 +147,7 @@ For example, let's say we have the following component config: .. note:: You may specify an ``end_position`` that is less than the ``start_position``. When doing so, the allowable range will start at the - ``start_position`` and continue through to the highest position value (i.e. ``4095``) and then continue from ``0`` until it reaches + ``start_position`` and continue through to the highest position value (i.e. ``4095``) and then continue from ``0`` until it reaches the ``end_position``. @@ -180,7 +180,7 @@ sensor platform to create individual sensors that will report the position to Ho .. code-block:: yaml as5600: - dir_pin: 22 + dir_pin: GPIOXX sensor: - platform: as5600 diff --git a/components/sensor/atm90e26.rst b/components/sensor/atm90e26.rst index 63394ab26..ffbfcd271 100644 --- a/components/sensor/atm90e26.rst +++ b/components/sensor/atm90e26.rst @@ -21,8 +21,8 @@ Configuration variables: - **cs_pin** (**Required**, :ref:`Pin Schema `): The pin CS is connected to. For the 6 channel meter main board, this will always be 5 and 4. For the add-on boards a jumper can be selected for each CS pin, but default to 0 and 16. - **line_frequency** (**Required**, string): The AC line frequency of the supply voltage. One of ``50Hz``, ``60Hz``. -- **meter_constant** (**Required**, float): The number of pulses per kWh. The ATM90E26 internally works based on pulses and - this value converts a pulse into Wh, which are emitted as ``forward_active_energy`` etc. Matching it against an existing +- **meter_constant** (**Required**, float): The number of pulses per kWh. The ATM90E26 internally works based on pulses and + this value converts a pulse into Wh, which are emitted as ``forward_active_energy`` etc. Matching it against an existing meter is useful in that it allows visual confirmation for some devices that blink an LED for each pulse. Common values are 1000 pulses/kWh, 1666.66 pulses/kWh, or 3200 pulses/kWh. See also **gain_metering** which determines after how much energy a pulse is emitted. @@ -111,13 +111,13 @@ Keeping the calibration values at the top of your yaml might make editing easier metering_cal: '7481' # default: 7481 - Calibrate this to match your meter based on the CF1 (CFx) pulse. spi: - clk_pin: 18 - miso_pin: 19 - mosi_pin: 23 + clk_pin: GPIOXX + miso_pin: GPIOXX + mosi_pin: GPIOXX sensor: - platform: atm90e26 - cs_pin: 5 + cs_pin: GPIOXX voltage: name: House Voltage accuracy_decimals: 1 diff --git a/components/sensor/atm90e32.rst b/components/sensor/atm90e32.rst index 198c3d118..000ccbd9a 100644 --- a/components/sensor/atm90e32.rst +++ b/components/sensor/atm90e32.rst @@ -168,7 +168,7 @@ a time-series-database, e.g. InfluxDB. sensor: #IC1 Main - platform: atm90e32 - cs_pin: 5 + cs_pin: GPIOXX phase_a: forward_active_energy: name: ${disp_name} ct1 FAWattHours @@ -208,13 +208,13 @@ Additional Examples # Example configuration entry for split single phase meter spi: - clk_pin: 18 - miso_pin: 19 - mosi_pin: 23 + clk_pin: GPIOXX + miso_pin: GPIOXX + mosi_pin: GPIOXX sensor: - platform: atm90e32 - cs_pin: 5 + cs_pin: GPIOXX phase_a: voltage: name: "EMON Line Voltage A" diff --git a/components/sensor/binary_sensor_map.rst b/components/sensor/binary_sensor_map.rst index 82e4ccf49..e23d0a014 100644 --- a/components/sensor/binary_sensor_map.rst +++ b/components/sensor/binary_sensor_map.rst @@ -6,17 +6,17 @@ Binary Sensor Map :image: binary_sensor_map.jpg The ``binary_sensor_map`` sensor platform allows you to map multiple :doc:`binary sensor ` -to an individual value. Depending on the state of each binary sensor, its associated configured parameters, and this sensor's mapping type, +to an individual value. Depending on the state of each binary sensor, its associated configured parameters, and this sensor's mapping type, the ``binary_sensor_map`` publishes a single numerical value. -Use this sensor to combine one or more binary sensors' ``ON`` or ``OFF`` states into a numerical value. Some possible use cases include +Use this sensor to combine one or more binary sensors' ``ON`` or ``OFF`` states into a numerical value. Some possible use cases include touch devices and determining Bayesian probabilities for an event. This platform supports three measurement types: ``BAYESIAN``, ``GROUP``, and ``SUM``. You need to specify your desired mapping with the ``type:`` configuration value. -When using the ``BAYESIAN`` type, add your binary sensors as ``observations`` to the binary sensor map. -If you use the ``GROUP`` or ``SUM`` type, add your binary sensors as ``channels``. +When using the ``BAYESIAN`` type, add your binary sensors as ``observations`` to the binary sensor map. +If you use the ``GROUP`` or ``SUM`` type, add your binary sensors as ``channels``. The maximum amount of observations/channels supported is 64. - ``BAYESIAN`` This type replicates Home Assistant's `Bayesian sensor `__. Based on the observation states, this sensor returns the Bayesian probability of a particular event occurring. The configured ``prior:`` probability is the likelihood that the Bayesian event is true, ignoring all external influences. Every observation has its own ``prob_given_true`` and ``prob_given_false`` parameters. The ``prob_given_true:`` value is the probability that the observation's binary sensor is ``ON`` when the Bayesian event is ``true``. The ``prob_given_false:`` value is the probability that the observation's binary sensor is ``ON`` when the Bayesian event is ``false``. Use an :doc:`/components/binary_sensor/analog_threshold` to convert this sensor's probability to a binary ``ON`` or ``OFF`` by setting an appropriate threshold. @@ -39,12 +39,12 @@ The maximum amount of observations/channels supported is 64. prob_given_false: 0.1 binary_sensor: - # If the Bayesian probability is greater than 0.6, + # If the Bayesian probability is greater than 0.6, # then predict the event is occuring - platform: analog_threshold name: "Bayesian Event Predicted State" sensor_id: bayesian_prob - threshold: 0.6 + threshold: 0.6 # ... - ``GROUP`` Each channel has its own ``value``. The sensor publishes the average value of all active @@ -78,7 +78,7 @@ The maximum amount of observations/channels supported is 64. channel: 0 id: touchkey0 # ... - + - ``SUM`` Each channel has its own ``value``. The sensor publishes the sum of all the active binary sensors values or ``0`` if no sensors are active. @@ -102,19 +102,19 @@ The maximum amount of observations/channels supported is 64. binary_sensor: - platform: gpio - pin: 4 + pin: GPIOXX id: bit0 - platform: gpio - pin: 5 + pin: GPIOXX id: bit1 - platform: gpio - pin: 6 + pin: GPIOXX id: bit2 - platform: gpio - pin: 7 + pin: GPIOXX id: bit3 # ... @@ -128,7 +128,7 @@ Configuration variables: - **binary_sensor** (**Required**): The id of the :doc:`binary sensor ` to add as a channel for this sensor. - **value** (**Required**): The value this channel should report when its binary sensor is active. -- **prior** (**Required for BAYESIAN type**, float between 0 and 1): The prior probability of the event. +- **prior** (**Required for BAYESIAN type**, float between 0 and 1): The prior probability of the event. - **observations** (**Required for BAYESIAN type**): A list of observations that influence the Bayesian probability of the event. - **binary_sensor** (**Required**): The id of the :doc:`binary sensor ` diff --git a/components/sensor/bl0939.rst b/components/sensor/bl0939.rst index d26792e22..59ed059fb 100644 --- a/components/sensor/bl0939.rst +++ b/components/sensor/bl0939.rst @@ -20,20 +20,8 @@ Additionally, you need to set the baud rate to 4800, parity to ``NONE`` and stop .. code-block:: yaml # Example configuration entry - # Disable logging over serial - logger: - baud_rate: 0 - - uart: - tx_pin: GPIO25 - rx_pin: GPIO26 - baud_rate: 4800 - parity: NONE - stop_bits: 2 - sensor: - platform: bl0939 - update_interval: 30s voltage: name: 'BL0939 Voltage' current_1: diff --git a/components/sensor/bl0940.rst b/components/sensor/bl0940.rst index 9ee4eed3d..6053fddf1 100644 --- a/components/sensor/bl0940.rst +++ b/components/sensor/bl0940.rst @@ -1,5 +1,5 @@ Belling BL0940 Energy Monitor -================================== +============================= .. seo:: :description: Instructions for setting up BL0940 power monitors. @@ -16,7 +16,7 @@ Belling BL0940 Energy Monitor The ``bl0940`` sensor platform allows you to use BL0940 energy monitors sensors with ESPHome. These are used in some Tuya-devices (e.g. the power metering BW-SHP10) -The communication with this integration is done over a :ref:`UART bus `. +The communication with this component is done via a :ref:`UART `. 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 4800 with 1 stop bit. diff --git a/components/sensor/bl0942.rst b/components/sensor/bl0942.rst index 47220333c..b2757725e 100644 --- a/components/sensor/bl0942.rst +++ b/components/sensor/bl0942.rst @@ -1,5 +1,5 @@ Belling BL0942 Energy Monitor -================================== +============================= .. seo:: :description: Instructions for setting up BL0942 power monitors. @@ -9,7 +9,7 @@ Belling BL0942 Energy Monitor The ``bl0942`` sensor platform allows you to use BL0942 energy monitors sensors with ESPHome. These are used in some Tuya-devices (e.g. Aubess Tuya WiFi Mini Smart Switch With Energy Monitor) -The communication with this integration is done over a :ref:`UART bus `. +The communication with this component is done via a :ref:`UART `. 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 4800 with 1 stop bit. diff --git a/components/sensor/bme280.rst b/components/sensor/bme280.rst index 15b667518..36c597df5 100644 --- a/components/sensor/bme280.rst +++ b/components/sensor/bme280.rst @@ -9,7 +9,7 @@ BME280 Temperature+Pressure+Humidity Sensor The ``bme280`` sensor platform allows you to use your BME280 (`datasheet `__, `Adafruit`_) temperature, pressure and humidity sensors with ESPHome. The sensor -is used in *Forced Mode* where measurement is performed and then +is used in *Forced Mode* where measurement is performed and then the sensor returns to sleep mode until next measurement. The :ref:`I²C ` or :ref:`SPI ` is required to be set up in your configuration for this sensor to work. @@ -28,13 +28,10 @@ required to be set up in your configuration for this sensor to work. - platform: bme280_i2c temperature: name: "BME280 Temperature" - oversampling: 16x pressure: name: "BME280 Pressure" humidity: name: "BME280 Humidity" - address: 0x77 - update_interval: 60s # Example configuration entry SPI @@ -42,40 +39,31 @@ required to be set up in your configuration for this sensor to work. - platform: bme280_spi temperature: name: "BME280 Temperature" - oversampling: 16x pressure: name: "BME280 Pressure" humidity: name: "BME280 Humidity" - cs_pin: GPIO5 - update_interval: 60s + cs_pin: GPIOXX Configuration variables: ------------------------ - **temperature** (*Optional*): The information for the temperature sensor. - - **name** (**Required**, string): The name for the temperature - sensor. - **oversampling** (*Optional*): The oversampling parameter for the temperature sensor. See :ref:`Oversampling Options `. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - All other options from :ref:`Sensor `. - **pressure** (*Optional*): The information for the pressure sensor. - - **name** (**Required**, string): The name for the pressure sensor. - **oversampling** (*Optional*): The oversampling parameter for the temperature sensor. See :ref:`Oversampling Options `. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - All other options from :ref:`Sensor `. - **humidity** (*Optional*): The information for the pressure sensor. - - **name** (**Required**, string): The name for the humidity sensor. - **oversampling** (*Optional*): The oversampling parameter for the temperature sensor. See :ref:`Oversampling Options `. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - All other options from :ref:`Sensor `. - **address** (*Optional*, int): Manually specify the I²C address of diff --git a/components/sensor/bme680_bsec.rst b/components/sensor/bme680_bsec.rst index a182b1ec1..2b3e0780b 100644 --- a/components/sensor/bme680_bsec.rst +++ b/components/sensor/bme680_bsec.rst @@ -30,7 +30,7 @@ The :ref:`I²C ` is required to be set up in your configuration for this se BME680 Temperature, Pressure, Humidity & Gas Sensor. -.. _BSEC license agreement: https://www.bosch-sensortec.com/media/boschsensortec/downloads/bsec/2017-07-17_clickthrough_license_terms_environmentalib_sw_clean.pdf +.. _BSEC license agreement: https://www.bosch-sensortec.com/media/boschsensortec/downloads/software/bme688_development_software/2023_04/license_terms_bme688_bme680_bsec.pdf .. _Adafruit: https://www.adafruit.com/product/3660 diff --git a/components/sensor/bmp3xx.rst b/components/sensor/bmp3xx.rst index 28ebee1db..af4f4d99e 100644 --- a/components/sensor/bmp3xx.rst +++ b/components/sensor/bmp3xx.rst @@ -7,8 +7,8 @@ BMP388 / BMP390 Temperature+Pressure Sensor :keywords: BMP388 BMP390 The ``bmp3xx`` sensor platform allows you to use your BMP388 or BMP390 -(`datasheet `__, `BMP390 product page `__) temperature and pressure sensors with ESPHome. The :ref:`I²C ` bus is -required to be set up in your configuration for this sensor to work. +(`datasheet `__, `BMP390 product page `__) temperature and pressure sensors with ESPHome. +Either :ref:`I²C ` bus or :ref:`SPI ` bus is required to be set up in your configuration for this sensor to work. .. figure:: images/bmp388.jpg :align: center @@ -16,11 +16,16 @@ required to be set up in your configuration for this sensor to work. BMP388/BMP390 Temperature and Pressure Sensor. + +Over I²C +-------- +The ``bmp3xx_i2c`` component allows you to use the device over :ref:`I²C ` interface. + .. code-block:: yaml - # Example configuration entry + # Example configuration entry for I2C connection sensor: - - platform: bmp3xx + - platform: bmp3xx_i2c temperature: name: "Outside Temperature" oversampling: 16x @@ -29,34 +34,72 @@ required to be set up in your configuration for this sensor to work. address: 0x77 update_interval: 60s -Configuration variables: ------------------------- +Configuration variables: +************************ + +- **address** (*Optional*, int): Manually specify the I²C address of the sensor. Defaults to ``0x77``. + Another address can be ``0x76``. - **temperature** (*Optional*): The information for the temperature sensor. - - **name** (**Required**, string): The name for the temperature - sensor. - **oversampling** (*Optional*): The oversampling parameter for the temperature sensor. See :ref:`Oversampling Options `. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - All other options from :ref:`Sensor `. - **pressure** (*Optional*): The information for the pressure sensor. - - **name** (**Required**, string): The name for the pressure sensor. - **oversampling** (*Optional*): The oversampling parameter for the temperature sensor. See :ref:`Oversampling Options `. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - All other options from :ref:`Sensor `. -- **address** (*Optional*, int): Manually specify the I²C address of - the sensor. Defaults to ``0x77``. Another address can be ``0x76``. - **iir_filter** (*Optional*): Set up an Infinite Impulse Response filter to increase accuracy. One of ``OFF``, ``2x``, ``4x``, ``16x``, ``32``, ``64x``, ``128x``. Defaults to ``OFF``. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. +Over SPI +-------- +The ``bmp3xx_spi`` component allows you to use the device over :ref:`SPI ` interface. + +.. code-block:: yaml + + # Example configuration entry for SPI connection + sensor: + - platform: bmp3xx_spi + temperature: + name: "Outside Temperature" + oversampling: 16x + pressure: + name: "Outside Pressure" + cs_pin: 13 + update_interval: 60s + + +Configuration variables: +************************ + +- **cs_pin** (**Required**, :ref:`Pin Schema `): The Chip Select (CS) pin. +- **temperature** (*Optional*): The information for the temperature sensor. + + - **oversampling** (*Optional*): The oversampling parameter for the temperature sensor. + See :ref:`Oversampling Options `. + - All other options from :ref:`Sensor `. + +- **pressure** (*Optional*): The information for the pressure sensor. + + - **oversampling** (*Optional*): The oversampling parameter for the temperature sensor. + See :ref:`Oversampling Options `. + - All other options from :ref:`Sensor `. + +- **iir_filter** (*Optional*): Set up an Infinite Impulse Response filter to increase accuracy. One of + ``OFF``, ``2x``, ``4x``, ``16x``, ``32``, ``64x``, ``128x``. Defaults to ``OFF``. +- **address** (*Optional*, int): *I2C* only. Manually specify the I²C address of + the sensor. Defaults to ``0x77``. Another address can be ``0x76``. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. + + .. _bmp3xx-oversampling: Oversampling Options @@ -80,7 +123,7 @@ See Also - :doc:`bmp280` - :doc:`bme680` - :doc:`bmp085` -- :apiref:`bmp3xx/bmp3xx.h` +- :apiref:`bmp3xx_base/bmp3xx_base.h` - `BMP3 sensor API `__ - `BMP388/BMP390 Library `__ by Martin Lindupp - :ghedit:`Edit` diff --git a/components/sensor/ccs811.rst b/components/sensor/ccs811.rst index 831d95ea8..95b4bde42 100644 --- a/components/sensor/ccs811.rst +++ b/components/sensor/ccs811.rst @@ -23,7 +23,7 @@ The ``ccs811`` sensor platform allows you to use CCS811 eCO_2 and volatile organ .. _Adafruit: https://www.adafruit.com/product/3566 The communication with this sensor is done via :ref:`I²C Bus `, so you need to have -an ``i2c:`` section in your config for this integration to work. +an ``i2c:`` section in your config for this component to work. .. code-block:: yaml diff --git a/components/sensor/cs5460a.rst b/components/sensor/cs5460a.rst index 0caa5b7ad..61a4136ce 100644 --- a/components/sensor/cs5460a.rst +++ b/components/sensor/cs5460a.rst @@ -35,11 +35,6 @@ 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: @@ -58,7 +53,7 @@ driven by a GPIO or wired to VCC. current_gain: 0.01 voltage_gain: 0.000573 pulse_energy: 1 Wh - cs_pin: 33 + cs_pin: GPIOXX Configuration variables: ------------------------ diff --git a/components/sensor/cse7761.rst b/components/sensor/cse7761.rst index 64bb889c0..b1e856586 100644 --- a/components/sensor/cse7761.rst +++ b/components/sensor/cse7761.rst @@ -20,16 +20,6 @@ Additionally, you need to set the baud rate to 38400 and parity to ``EVEN``. .. code-block:: yaml # Example configuration entry - # Disable logging over serial - logger: - baud_rate: 0 - - uart: - tx_pin: GPIO25 - rx_pin: GPIO26 - baud_rate: 38400 - parity: EVEN - sensor: - platform: cse7761 voltage: @@ -42,7 +32,6 @@ Additionally, you need to set the baud rate to 38400 and parity to ``EVEN``. name: 'CSE7761 Active Power 1' active_power_2: name: 'CSE7761 Active Power 2' - update_interval: 5s .. note:: diff --git a/components/sensor/cse7766.rst b/components/sensor/cse7766.rst index dcf6acd73..5b820555d 100644 --- a/components/sensor/cse7766.rst +++ b/components/sensor/cse7766.rst @@ -9,7 +9,7 @@ CSE7766 Power Sensor The ``cse7766`` sensor platform allows you to use your CSE7766 voltage/current and power sensors (`datasheet `__) sensors with ESPHome. This sensor is commonly found in Sonoff POW R2. CSE7759B is similar to CSE7766 -and works with this integration. +and works with this component. .. note:: diff --git a/components/sensor/custom.rst b/components/sensor/custom.rst index 76caada78..ad52cbeb5 100644 --- a/components/sensor/custom.rst +++ b/components/sensor/custom.rst @@ -1,16 +1,6 @@ Custom Sensor Component ======================= -.. warning:: - - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. - - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. - .. seo:: :description: Instructions for setting up Custom C++ sensors with ESPHome. :image: language-cpp.svg @@ -18,11 +8,18 @@ Custom Sensor Component .. warning:: - While I do try to keep the ESPHome configuration options as stable as possible - and back-port them, the ESPHome API is less stable. If something in the APIs needs - to be changed in order for something else to work, I will do so. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. -So, you just set up ESPHome for your ESP32/ESP8266, but sadly ESPHome is missing a sensor integration + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. + +.. warning:: + + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + +So, you just set up ESPHome for your ESP32/ESP8266, but sadly ESPHome is missing a sensor component you'd really like to have 😕. It's pretty much impossible to support every single sensor, as there are simply too many. That's why ESPHome has a really simple API for you to create your own **custom sensors** 🎉 diff --git a/components/sensor/dallas.rst b/components/sensor/dallas.rst index 45032c2d7..d5c046d9d 100644 --- a/components/sensor/dallas.rst +++ b/components/sensor/dallas.rst @@ -28,13 +28,7 @@ if you don't have massively long wires. # Example configuration entry dallas: - - pin: 23 - - # Individual sensors - sensor: - - platform: dallas - address: 0x1c0000031edd2a28 - name: "Livingroom Temperature" + - pin: GPIOXX Configuration variables: ************************ @@ -71,10 +65,6 @@ To initialize a sensor, first supply either ``address`` **or** ``index`` to iden .. code-block:: yaml - # Example configuration entry - dallas: - - pin: GPIO23 - # Individual sensors sensor: - platform: dallas @@ -114,7 +104,7 @@ the scanning will happen even with no sensors connected. For example with this c # Example configuration entry dallas: - - pin: GPIO23 + - pin: GPIOXX # Note you don't have to add any sensors at this point @@ -128,7 +118,7 @@ Now we can add the individual sensors to our configuration: # Example configuration entry dallas: - - pin: GPIO23 + - pin: GPIOXX sensor: - platform: dallas @@ -154,9 +144,9 @@ Use this if you have multiple dallas hubs: # Example configuration entry dallas: - - pin: GPIO23 + - pin: GPIOXX id: hub_1 - - pin: GPIO24 + - pin: GPIOXX id: hub_2 sensor: diff --git a/components/sensor/daly_bms.rst b/components/sensor/daly_bms.rst index cdb28600b..7fca68c04 100644 --- a/components/sensor/daly_bms.rst +++ b/components/sensor/daly_bms.rst @@ -15,18 +15,29 @@ The BMS communicates via :ref:`UART `. :align: center :width: 100.0% +Component/Hub +------------- .. code-block:: yaml - # Example configuration entry (ESP8266) - uart: - tx_pin: GPIO1 - rx_pin: GPIO3 - baud_rate: 9600 - + # Example configuration entry daly_bms: update_interval: 20s + +Configuration variables: +************************ + +- **update_interval** (*Optional*, :ref:`config-time`): Delay between data requests. +- **address** (*Optional*, int): Address to use, defaults to ``0x80``. + +Sensor +------ + +A sensor platform to read BMS data + +.. code-block:: yaml + sensor: - platform: daly_bms voltage: @@ -68,11 +79,81 @@ The BMS communicates via :ref:`UART `. cell_4_voltage: name: "Cell 4 Voltage" +Configuration variables: +************************ + +- **voltage** (*Optional*): Voltage of the battery pack connected to Daly BMS. + All options from :ref:`Sensor `. + +- **current** (*Optional*): Current flowing trough the BMS (input or output from batttery). + All options from :ref:`Sensor `. + +- **battery_level** (*Optional*): Battery level in % (SoC). + All options from :ref:`Sensor `. + +- **max_cell_voltage** (*Optional*): The cell of the battery with the higher voltage. + All options from :ref:`Sensor `. + +- **max_cell_voltage_number** (*Optional*): The cell number of the battery with the higher voltage. + All options from :ref:`Sensor `. + +- **min_cell_voltage** (*Optional*): The cell of the battery with the lower voltage. + All options from :ref:`Sensor `. + +- **min_cell_voltage_number** (*Optional*): The cell number of the battery with the lower voltage. + All options from :ref:`Sensor `. + +- **max_temperature** (*Optional*): The higher temperature measured from the temperature sensors. + All options from :ref:`Sensor `. + +- **max_temperature_probe_number** (*Optional*): The sensor number which has measured the higher temperature. + All options from :ref:`Sensor `. + +- **min_temperature** (*Optional*): The lower temperature measured from the temperature sensors. + All options from :ref:`Sensor `. + +- **min_temperature_probe_number** (*Optional*): The sensor number which has measured the lower temperature. + All options from :ref:`Sensor `. + +- **remaining_capacity** (*Optional*): The capacity in Ah left in the battery. + All options from :ref:`Sensor `. + +- **cells_number** (*Optional*): The number of cells in series in the battery pack. + All options from :ref:`Sensor `. + +- **temperature_1** (*Optional*): The first temperature sensor. + All options from :ref:`Sensor `. + +- **temperature_2** (*Optional*): The second temperature sensor. + All options from :ref:`Sensor `. + +- **cell_1_voltage** (*Optional*): The voltage of cell number 1. Cell number can be from 1 to 16. + All options from :ref:`Sensor `. + +Text Sensor +----------- + +Text sensor that indicates the status of BMS. + +.. code-block:: yaml + text_sensor: - platform: daly_bms status: name: "BMS Status" +Configuration variables: +************************ + +- **status** (*Optional*): The BMS Status (Charging, Discharging, Stationary). + All options from :ref:`Text Sensor `. + +Binary Sensor +------------- + +Binary sensor that indicates the status of MOS. + +.. code-block:: yaml binary_sensor: - platform: daly_bms @@ -81,163 +162,25 @@ The BMS communicates via :ref:`UART `. discharging_mos_enabled: name: "Discharging MOS" -Component/Hub -------------- - -Configuration variables: -************************ - -- **update_interval** (*Optional*, :ref:`config-time`): Delay between data requests. -- **address** (*Optional*, int): Address to use, defaults to ``0x80``. - -Sensor ------- - -A sensor platform to read BMS data - -Configuration variables: -************************ - -- **voltage** (*Optional*): Voltage of the battery pack connected to Daly BMS. - - - **name** (**Required**, string): The name for the voltage sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **current** (*Optional*): Current flowing trough the BMS (input or output from batttery). - - - **name** (**Required**, string): The name for the current sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **battery_level** (*Optional*): Battery level in % (SoC). - - - **name** (**Required**, string): The name for the SoC sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **max_cell_voltage** (*Optional*): The cell of the battery with the higher voltage. - - - **name** (**Required**, string): The name for the Max Cell Voltage sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **max_cell_voltage_number** (*Optional*): The cell number of the battery with the higher voltage. - - - **name** (**Required**, string): The name for the Max Cell Voltage Number sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **min_cell_voltage** (*Optional*): The cell of the battery with the lower voltage. - - - **name** (**Required**, string): The name for the Min Cell Voltage sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **min_cell_voltage_number** (*Optional*): The cell number of the battery with the lower voltage. - - - **name** (**Required**, string): The name for the Min Cell Voltage Number sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **max_temperature** (*Optional*): The higher temperature measured from the temperature sensors. - - - **name** (**Required**, string): The name for the Max Temperature sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **max_temperature_probe_number** (*Optional*): The sensor number which has measured the higher temperature. - - - **name** (**Required**, string): The name for the Max Temperature Probe Number sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **min_temperature** (*Optional*): The lower temperature measured from the temperature sensors. - - - **name** (**Required**, string): The name for the Min Temperature sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **min_temperature_probe_number** (*Optional*): The sensor number which has measured the lower temperature. - - - **name** (**Required**, string): The name for the Min Temperature Probe Number sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **remaining_capacity** (*Optional*): The capacity in Ah left in the battery. - - - **name** (**Required**, string): The name for the Remaining Capacity sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **cells_number** (*Optional*): The number of cells in series in the battery pack. - - - **name** (**Required**, string): The name for the Cells Number sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **temperature_1** (*Optional*): The first temperature sensor. - - - **name** (**Required**, string): The name for the first temperature sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **temperature_2** (*Optional*): The second temperature sensor. - - - **name** (**Required**, string): The name for the second temperature sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -- **cell_1_voltage** (*Optional*): The voltage of cell number 1. Cell number can be from 1 to 16. - - - **name** (**Required**, string): The name for the cell voltage sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. - -Text Sensor ------------ - -Text sensor that indicates the status of BMS. - -Configuration variables: -************************ - -- **status** (*Optional*): The BMS Status (Charging, Discharging, Stationary). - - - **name** (**Required**, string): The name for the BMS status text sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Text Sensor `. - -Binary Sensor -------------- - -Binary sensor that indicates the status of MOS. - Configuration variables: ************************ - **charging_mos_enabled** (*Optional*): The BMS charging MOS status to enable the recharge of the battery. - - - **name** (**Required**, string): The name for the charging MOS binary sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Binary Sensor `. + All options from :ref:`Binary Sensor `. - **discharging_mos_enabled** (*Optional*): The BMS discharging mos status to enable the load. - - - **name** (**Required**, string): The name for the discharging MOS binary sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Binary Sensor `. + All options from :ref:`Binary Sensor `. Control BMS ----------- At this moment Daly sensor platform don't suppport controlling you BMS, but you can make some stuff using uart.write -First you need to setup binary sensors for charging and disharging MOS - -.. code-block:: yaml +First you need to setup binary sensors for charging and disharging MOS + +.. code-block:: yaml + - binary_sensor: - platform: daly_bms charging_mos_enabled: @@ -249,11 +192,11 @@ First you need to setup binary sensors for charging and disharging MOS id: bin_daly_dischg_mos # binary MOS sensor must have ID to use with switch internal: True # but you can make it internal to avoid duplication -Then you can add switches - -.. code-block:: yaml +Then you can add switches + +.. code-block:: yaml + - switch: - platform: template name: "Daly Charging MOS" @@ -266,12 +209,12 @@ Then you can add switches turn_on_action: - uart.write: data: [0xA5, 0x40, 0xDA, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set charge MOS on" turn_off_action: - uart.write: data: [0xA5, 0x40, 0xDA, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC7] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set charge MOS off" - platform: template @@ -285,20 +228,20 @@ Then you can add switches turn_on_action: - uart.write: data: [0xA5, 0x40, 0xD9, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC7] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set discharge MOS on" turn_off_action: - uart.write: data: [0xA5, 0x40, 0xD9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set discharge MOS off" Also you can add select to change battery level - -.. code-block:: yaml - +.. code-block:: yaml + + select: - platform: template name: "Daly Battery Level setup" @@ -318,7 +261,7 @@ Also you can add select to change battery level then: - uart.write: data: [0xA5, 0x40, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xE8, 0xF9] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set SOC to 100%" else: - if: @@ -327,7 +270,7 @@ Also you can add select to change battery level then: - uart.write: data: [0xA5, 0x40, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xEE, 0xFE] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set SOC to 75%" else: - if: @@ -336,7 +279,7 @@ Also you can add select to change battery level then: - uart.write: data: [0xA5, 0x40, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF4, 0x03] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set SOC to 50%" else: - if: @@ -345,7 +288,7 @@ Also you can add select to change battery level then: - uart.write: data: [0xA5, 0x40, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x08] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set SOC to 25%" else: - if: @@ -354,10 +297,10 @@ Also you can add select to change battery level then: - uart.write: data: [0xA5, 0x40, 0x21, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E] - - logger.log: + - logger.log: format: "Send cmd to Daly: Set SOC to 0%" - - + + UART Connection --------------- @@ -368,15 +311,15 @@ Connect RX from BMS to TX in ESP board and TX from BMS to RX in ESP board :width: 100.0% Uart Pinout. - + **3.3v Warning:** some BMS 3.3v cant source large currents and may not work to properly power the ESP. If you are having WIFI connection issues or similar, try a different power source. There is 12-15v available on the Daly connector which via a proper step-down converter can properly power the ESP. On the ESP32 (untested on ESP8266) if you are having missing data (such as Temperature 1/2), it may be due to UART buffer size. Add the following to your configuration to increase the buffer from the default 256 to 512. -.. code-block:: +.. code-block:: - uart: + uart: ... rx_buffer_size: 512 diff --git a/components/sensor/dsmr.rst b/components/sensor/dsmr.rst index 0f664b0e7..0181270e0 100644 --- a/components/sensor/dsmr.rst +++ b/components/sensor/dsmr.rst @@ -11,7 +11,7 @@ Component/Hub The DSMR component connects to Dutch Smart Meters which comply to DSMR (Dutch Smart Meter Requirements), also known as ‘Slimme meter’ or ‘P1 port’. -This integration supports plain non encrypted telegrams and also encrypted as used in Luxembourg. +This component supports plain non encrypted telegrams and also encrypted as used in Luxembourg. In case your equipment has encryption you must get a 32 character long encryption key from your energy company. This component is passive, it does not transmit any data to your equipment, the equipment always transmits diff --git a/components/sensor/growatt_solar.rst b/components/sensor/growatt_solar.rst index b44244688..7d52e4c77 100644 --- a/components/sensor/growatt_solar.rst +++ b/components/sensor/growatt_solar.rst @@ -14,28 +14,17 @@ The ``Growatt Inverter`` sensor platform allows you to use growatt inverter data Growatt Logo -The communication with this integration is done over a :ref:`UART bus ` using :ref:`Modbus `. -You must therefore have a ``uart:`` entry in your configuration with both the TX and RX pins set +The communication with this component is done over a :ref:`UART bus ` using :ref:`Modbus `. +You must therefore have a ``uart:`` and ``modbus:`` 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: - - id: gw_uart - baud_rate: 9600 - tx_pin: GPIO1 - rx_pin: GPIO3 - - modbus: - uart_id: gw_uart - flow_control_pin: GPIO4 - + # Example configuration sensor: - platform: growatt_solar - update_interval: 10s protocol_version: RTU - + inverter_status: name: "Growatt Status Code" @@ -88,7 +77,7 @@ to some pins on your board and the baud rate set to 9600. energy_production_day: name: "Growatt Today's Generation" - + total_energy_production: name: "Growatt Total Energy Production" @@ -96,14 +85,12 @@ to some pins on your board and the baud rate set to 9600. name: "Growatt Inverter Module Temp" - - Configuration variables: ------------------------ - **inverter_status** (*Optional*): Status code of the inverter (0: waiting, 1: normal, 3:fault) -- **protocol_version** (*Optional*): Version of the protocol used by your inverter. +- **protocol_version** (*Optional*): Version of the protocol used by your inverter. Old inverters use RTU (default). Newer ones use RTU2 (e.g. MIC, MIN, MAX series) - **phase_a** (*Optional*): The group of exposed sensors for Phase A/1. diff --git a/components/sensor/haier.rst b/components/sensor/haier.rst index 9776656b7..d16bb56e7 100644 --- a/components/sensor/haier.rst +++ b/components/sensor/haier.rst @@ -15,19 +15,6 @@ Additional sensors for Haier Climate device. **These sensors are supported only .. code-block:: yaml # Example configuration entry - uart: - baud_rate: 9600 - tx_pin: 17 - rx_pin: 16 - id: ac_port - - climate: - - platform: haier - id: haier_ac - protocol: hOn - name: Haier AC - uart_id: ac_port - sensor: - platform: haier haier_id: haier_ac diff --git a/components/sensor/havells_solar.rst b/components/sensor/havells_solar.rst index 5338e6f5e..a3e46d1c8 100644 --- a/components/sensor/havells_solar.rst +++ b/components/sensor/havells_solar.rst @@ -16,24 +16,13 @@ with ESPHome. Havells On Grid Solar Inverter. -The communication with this integration is done over a :ref:`UART bus ` using :ref:`Modbus `. -You must therefore have a ``uart:`` entry in your configuration with both the TX and RX pins set +The communication with this component is done via a :ref:`UART ` using :ref:`Modbus `. +You must therefore have a ``uart:`` and ``modbus:`` 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: - - id: modbus_uart - baud_rate: 9600 - tx_pin: GPIO1 - rx_pin: GPIO3 - - - modbus: - uart_id: modbus_uart - flow_control_pin: GPIO4 - sensor: - platform: havells_solar update_interval: 60s diff --git a/components/sensor/hlw8012.rst b/components/sensor/hlw8012.rst index eb1dcf0f7..89e940057 100644 --- a/components/sensor/hlw8012.rst +++ b/components/sensor/hlw8012.rst @@ -9,12 +9,14 @@ HLW8012 Power Sensor The ``hlw8012`` sensor platform allows you to use your HLW8012 voltage/current and power sensors (`datasheet `__) sensors with ESPHome. This sensor is commonly found in Sonoff POWs. CSE7759 and BL0937 are similar to HLW8012 -and work with this integration. Beware that CSE7759B is different and should be used -with the :doc:`CSE7766 ` integration. +and work with this component. Beware that CSE7759B is different and should be used with the +:doc:`CSE7766 ` component. .. note:: - SAFETY HAZARD: Some devices such as Sonoff POWs/Shelly/etc, have the digital GND connected directly to mains voltage so **the GPIOs become LIVE during normal operation**. Our advice is to mark these boards to prevent any use of the dangerous digital pins. + SAFETY HAZARD: Some devices such as Sonoff POWs/Shelly/etc, have the digital GND connected directly to mains + voltage so **the GPIOs become LIVE during normal operation**. Our advice is to mark these boards to prevent + any use of the dangerous digital pins. This sensor has two data outputs which both encode values using the frequency of a modulated signal: CF and CF1. CF's frequency is proportional to the (active) power measured and CF1 is proportional to the current/voltage. Using @@ -28,9 +30,9 @@ be measured at the same exact points in time. # Example configuration entry sensor: - platform: hlw8012 - sel_pin: 5 - cf_pin: 14 - cf1_pin: 13 + sel_pin: GPIOXX + cf_pin: GPIOXX + cf1_pin: GPIOXX current: name: "HLW8012 Current" voltage: @@ -67,11 +69,11 @@ Advanced Options: Defaults to the Sonoff POW's value ``0.001 ohm``. - **voltage_divider** (*Optional*, float): The value of the voltage divider on the board as ``(R_upstream + R_downstream) / R_downstream``. Defaults to the Sonoff POW's value ``2351``. -- **model** (*Optional*, string): The sensor model on the board, to set internal constant factors to convert pulses to measurements. - Possible values are ``HLW8012``, ``CSE7759``, ``BL0937``. Defaults to ``HLW8012``. +- **model** (*Optional*, string): The sensor model on the board, to set internal constant factors to convert pulses to measurements. + Possible values are ``HLW8012``, ``CSE7759``, ``BL0937``. Defaults to ``HLW8012``. CSE7759 uses same constants and it also works with default. Must be set for BL0937 to be able to calibrate all three measurements at the same time. - **change_mode_every** (*Optional*, int): After how many updates to cycle between the current/voltage measurement mode. - Note that the first value after switching is discarded because it is often inaccurate. When set to ``"never"`` the measurement mode will stay at the + Note that the first value after switching is discarded because it is often inaccurate. When set to ``"never"`` the measurement mode will stay at the set ``initial_mode``. Defaults to ``8``. - **initial_mode** (*Optional*, string): The initial measurement mode. Defaults to ``VOLTAGE``. Possible initial measurement modes are ``VOLTAGE`` or ``CURRENT``. @@ -87,9 +89,9 @@ the initial measurement mode to match whichever mode the device uses, and disabl # Example configuration entry for device with fixed measurement mode sensor: - platform: hlw8012 - sel_pin: 5 - cf_pin: 14 - cf1_pin: 13 + sel_pin: GPIOXX + cf_pin: GPIOXX + cf1_pin: GPIOXX current: name: "HLW8012 Current" voltage: @@ -112,11 +114,11 @@ when SEL=1 voltage is measured. To accommodate this change use the following con sensor: - platform: hlw8012 model: BL0937 - sel_pin: - number: 12 + sel_pin: + number: GPIOXX inverted: true - cf_pin: 4 - cf1_pin: 5 + cf_pin: GPIOXX + cf1_pin: GPIOXX current: name: "BL0937 Current" voltage: diff --git a/components/sensor/homeassistant.rst b/components/sensor/homeassistant.rst index fd2096fa1..b8d0ea0e9 100644 --- a/components/sensor/homeassistant.rst +++ b/components/sensor/homeassistant.rst @@ -31,7 +31,7 @@ Entity state attributes can also be imported: This component is only for numeral states. If you want to import arbitrary text states from Home Assistant, use the :doc:`Home Assistant Text Sensor `. - + Although you might not plan to *export* states from the node and you do not need an entity of the node in Home Assistant, this component still requires you to register the node under Home Assistant. See: :doc:`Getting started with Home Assistant ` @@ -43,16 +43,15 @@ Configuration variables: - **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 `. .. note:: - The sensors implemented by this component are by default ``internal``, to avoid exporting them back to + The sensors implemented by this component are by default ``internal``, to avoid exporting them back to Home Assistant. Should you still want to do that (eg. because you use ESPHome's very efficient filters - on them) you need to specifically configure ``internal: false``. Also, ``state_class``, ``unit_of_measurement`` + on them) you need to specifically configure ``internal: false``. Also, ``state_class``, ``unit_of_measurement`` are not inherited from the imported sensor so you need to set them manually. diff --git a/components/sensor/honeywellabp.rst b/components/sensor/honeywellabp.rst index 9ec686b9b..d85582e9a 100644 --- a/components/sensor/honeywellabp.rst +++ b/components/sensor/honeywellabp.rst @@ -6,7 +6,7 @@ Honeywell ABP Pressure Sensors :image: honeywellabp.jpg :keywords: Honeywell ABP -The ``honeywellabp`` sensor platform allows you to use your Honeywell ABP +The ``honeywellabp`` sensor platform allows you to use your Honeywell ABP (`website `__, `datasheet `__, `Mouser `_) pressure and temperature sensors with ESPHome. The :ref:`SPI ` is @@ -24,30 +24,27 @@ required to be set up in your configuration for this sensor to work sensor: - platform: honeywellabp pressure: - name: "Honeywell pressure" - unit_of_measurement: "psi" + name: Honeywell pressure min_pressure: 0 max_pressure: 15 temperature: - name: "Honeywell temperature" - cs_pin: GPIO5 #D5 + name: Honeywell temperature + cs_pin: GPIOXX Configuration variables: ------------------------ -The values for ``min_pressure`` and ``max_pressure`` can be found in the device datasheet for the specific device. These are used to calculate -the pressure reading published by the sensor. Some sensors measure pressure in ``bar`` or ``kPa``; set ``min_pressure`` and ``max_pressure`` to +The values for ``min_pressure`` and ``max_pressure`` can be found in the device datasheet for the specific device. These are used to calculate +the pressure reading published by the sensor. Some sensors measure pressure in ``bar`` or ``kPa``; set ``min_pressure`` and ``max_pressure`` to the measurement range and ``unit_of_measurement`` to the appropriate unit for your device. - **pressure** (*Optional*): The information for the pressure sensor. - - **name** (**Required**, string): The name for the pressure sensor. - **min_pressure** (**Required**, int or float): Minimum pressure for the pressure sensor, default unit ``psi``. - **max_pressure** (**Required**, int or float): Maximum pressure for the pressure sensor, default unit ``psi``. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - All other options from :ref:`Sensor `. -Some sensors do not have temperature sensing ability, see datasheet. In some cases the sensor may return a valid temperature even though the +Some sensors do not have temperature sensing ability, see datasheet. In some cases the sensor may return a valid temperature even though the datasheet indicates that the sensor does not measure temperature. - **temperature** (*Optional*): The information for the temperature sensor. diff --git a/components/sensor/hrxl_maxsonar_wr.rst b/components/sensor/hrxl_maxsonar_wr.rst index 6a091f369..7d442d664 100644 --- a/components/sensor/hrxl_maxsonar_wr.rst +++ b/components/sensor/hrxl_maxsonar_wr.rst @@ -6,7 +6,7 @@ HRXL/XL MaxSonar WR Series :image: hrxl_maxsonar_wr.jpg :keywords: ultrasonic, maxbotix, maxsonar -This sensor allows you to use HRXL MaxSonar WR series ultrasonic sensors by MaxBotix +This sensor allows you to use HRXL MaxSonar WR series ultrasonic sensors by MaxBotix (`datasheet `__) or the XL MaxSonar WR series (`datasheet `__) @@ -27,28 +27,15 @@ multiple times per second, filtering is highly recommended. .. code-block:: yaml # Example configuration entry - uart: - rx_pin: 36 - baud_rate: 9600 - sensor: - platform: "hrxl_maxsonar_wr" name: "Rainwater Tank" - # Tweak the filters for your application - filters: - - sliding_window_moving_average: - window_size: 12 - send_every: 12 - - or: - - throttle: "20min" - - delta: 0.02 Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the sensor. -- All other options from :ref:`Sensor `. +- All options from :ref:`Sensor `. Advanced options: diff --git a/components/sensor/htu21d.rst b/components/sensor/htu21d.rst index b07847699..0ce14a64f 100644 --- a/components/sensor/htu21d.rst +++ b/components/sensor/htu21d.rst @@ -31,6 +31,7 @@ Example sensors: # Example configuration entry sensor: - platform: htu21d + model: htu21d temperature: name: "Temperature" humidity: @@ -52,6 +53,8 @@ Configuration variables: - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. +- **model** (*Optional*): Possible values are HTU21D, SI7021, SHT21. Defaults to HTU21D. + The heater may be enabled to help correct the reading; see the datasheet for more information. See Also diff --git a/components/sensor/hydreon_rgxx.rst b/components/sensor/hydreon_rgxx.rst index aa3cc4237..04e08c06d 100644 --- a/components/sensor/hydreon_rgxx.rst +++ b/components/sensor/hydreon_rgxx.rst @@ -26,58 +26,40 @@ Device FAQ: ``__ .. code-block:: yaml # Example RG-9 entry - - uart: - rx_pin: GPIO16 - tx_pin: GPIO17 - baud_rate: 9600 - sensor: - platform: hydreon_rgxx - model: "RG_9" - id: "hydreon_1" - update_interval: 20s - disable_led: false + model: RG_9 + id: hydreon_1 moisture: - name: "Rain Level" + name: Rain Level temperature: - name: "Device Temperature" + name: Device Temperature binary_sensor: - platform: hydreon_rgxx - hydreon_rgxx_id: "hydreon_1" + hydreon_rgxx_id: hydreon_1 too_cold: - entity_category: diagnostic - name: "Temperature Status" + name: Temperature Status lens_bad: - entity_category: diagnostic - name: "Lens Status" + name: Lens Status em_sat: - entity_category: diagnostic - name: "Emitter Saturation" + name: Emitter Saturation .. code-block:: yaml # Example RG-15 entry - - uart: - rx_pin: GPIO16 - tx_pin: GPIO17 - baud_rate: 9600 - sensor: - platform: hydreon_rgxx - model: "RG_15" + model: RG_15 resolution: high - update_interval: 60s acc: - name: "rain" + name: Rain event_acc: - name: "rain event" + name: Rain Event" total_acc: - name: "rain total" + name: Rain Total" r_int: - name: "rain intensity" + name: Rain Intensity Configuration variables: ------------------------ diff --git a/components/sensor/index.rst b/components/sensor/index.rst index 418e4d113..05df0921d 100644 --- a/components/sensor/index.rst +++ b/components/sensor/index.rst @@ -68,10 +68,10 @@ Configuration variables: significantly increase the database size. Defaults to ``false``. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. Automations: @@ -603,7 +603,7 @@ To prevent values from being published, return ``{}``: .. code-block:: yaml filters: - - lambda: !lambda |- + - lambda: |- if (x < 10) return {}; return x-10; diff --git a/components/sensor/inkbird_ibsth1_mini.rst b/components/sensor/inkbird_ibsth1_mini.rst index 4b641aab5..530fc4e5a 100644 --- a/components/sensor/inkbird_ibsth1_mini.rst +++ b/components/sensor/inkbird_ibsth1_mini.rst @@ -107,7 +107,7 @@ entry like in the configuration example at the top. .. note:: - The ESPHome Inkbird IBS-TH1/TH2 integration listens passively to packets the device sends by itself. + The ESPHome Inkbird IBS-TH1/TH2 component listens passively to packets the device sends by itself. ESPHome therefore has no impact on the battery life of the device. See Also diff --git a/components/sensor/kuntze.rst b/components/sensor/kuntze.rst index 6bd2372d7..76e222c74 100644 --- a/components/sensor/kuntze.rst +++ b/components/sensor/kuntze.rst @@ -48,12 +48,6 @@ A configured modbus component is optional. It will be automatically created. .. code-block:: yaml # Example configuration entry - uart: - - id: uart_bus - tx_pin: GPIO16 - rx_pin: GPIO17 - baud_rate: 19200 - parity: EVEN sensor: - platform: kuntze diff --git a/components/sensor/max31856.rst b/components/sensor/max31856.rst index 1d203e67e..420827b58 100644 --- a/components/sensor/max31856.rst +++ b/components/sensor/max31856.rst @@ -33,26 +33,19 @@ to have an :ref:`spi bus ` in your configuration with both **miso_pin** and .. code:: yaml # Example configuration entry - spi: - clk_pin: GPIO18 - miso_pin: GPIO19 - mosi_pin: GPIO23 - sensor: - platform: max31856 - name: "BBQ Temperature" - icon: "mdi:hamburger" - cs_pin: GPIO17 + name: BBQ Temperature + icon: mdi:hamburger + cs_pin: GPIOXX Configuration variables: ------------------------ -- **name** (**Required**, string): The name for the temperature sensor. - **cs_pin** (**Required**, :ref:`Pin Schema `): The Chip Select pin of the SPI interface. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. - **mains_filter** (*Optional*, string): The mains power frequency to reject (``50 Hz`` or ``60 Hz``). Defaults to ``60 Hz``. - **spi_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`SPI Component ` if you want to use multiple SPI buses. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor `. See Also diff --git a/components/sensor/mcp3204.rst b/components/sensor/mcp3204.rst index b8239a977..ebf18d9e7 100644 --- a/components/sensor/mcp3204.rst +++ b/components/sensor/mcp3204.rst @@ -6,10 +6,9 @@ MCP3204 & MCP3208 12-Bit A/D Converters :keywords: MCP3204 MCP3208 :image: mcp3204.jpg -The Microchip Technology Inc. MCP3204 & MCP3208 -devices are successive approximation 12-bit Analog-to-Digital (A/D) converters with on-board sample and -hold circuitry. This integration is common for both device types. -configure both devices as MCP3204 and observe the maximum number of channels as per variant used. +The Microchip Technology Inc. MCP3204 & MCP3208 devices are successive approximation 12-bit Analog-to-Digital (A/D) +converters with on-board sample and hold circuitry. This component is common for both device types. +Configure both devices as MCP3204 and observe the maximum number of channels as per variant used. .. figure:: images/mcp3204.jpg :align: center @@ -37,25 +36,9 @@ Most configurations will set the ``reference_voltage`` = VREF pin # Example configuration entry mcp3204: - cs_pin: GPIO15 + cs_pin: GPIOXX reference_voltage: 3.3V - # Example config of sensors. - # This is a small 1.5v solar panel power rail attached to pin 0 - # of the MCP3204 - sensor: - - platform: mcp3204 # Attached to pin 0 of the MCP3204. - update_interval: 1s - id: solar_voltage - number: 0 # MCP3204 pin number - - # In case MCP3208 is used. you can specify pin number > 4 - - platform: mcp3204 # Attached to pin 7 of the MCP3208. - update_interval: 1s - id: supply_voltage - number: 7 # MCP3208 pin number - - Configuration variables: ************************ @@ -71,14 +54,27 @@ The ``mcp3204`` sensor allows you to use your MCP3204 or MCP3208 12-Bit A/D Conv First, setup a :ref:`MCP3204 Hub ` for your MCP3204/8 sensor and then use this sensor platform to create individual sensors that will report the voltage to Home Assistant. +.. code-block:: yaml + + # Example config of sensors. + # This is a small 1.5v solar panel power rail attached to pin 0 + # of the MCP3204 + sensor: + - platform: mcp3204 # Attached to pin 0 of the MCP3204. + id: solar_voltage + number: 0 # MCP3204 pin number + + # In case MCP3208 is used. you can specify pin number > 4 + - platform: mcp3204 # Attached to pin 7 of the MCP3208. + id: supply_voltage + number: 7 # MCP3208 pin number + Configuration variables: ************************ - **mcp3204_id** (**Required**, :ref:`config-id`): The id of the parent MCP3204 component. -- **name** (**Required**, string): The name of the voltage sensor. - **number** (**Required**, int): The pin number of the MCP3204 - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor `. See Also diff --git a/components/sensor/mhz19.rst b/components/sensor/mhz19.rst index 7b6e13ff5..0d3c8f313 100644 --- a/components/sensor/mhz19.rst +++ b/components/sensor/mhz19.rst @@ -26,36 +26,23 @@ TX/RX labels are from the perspective of the MH-Z19). Additionally, you need to .. code-block:: yaml # Example configuration entry - uart: - rx_pin: GPIO3 - tx_pin: GPIO1 - baud_rate: 9600 - sensor: - platform: mhz19 co2: - name: "MH-Z19 CO2 Value" + name: MH-Z19 CO2 Value temperature: - name: "MH-Z19 Temperature" - update_interval: 60s - automatic_baseline_calibration: false + name: MH-Z19 Temperature Configuration variables: ------------------------ - **co2** (**Required**): The CO_2 data from the sensor in parts per million (ppm). - - - **name** (**Required**, string): The name for the CO_2 sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **temperature** (**Required**): The information for the temperature sensor. Please note that this is not officially documented in the datasheet and seems to be quite inaccurate. - - - **name** (**Required**, string): The name for the temperature sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. diff --git a/components/sensor/mmc5983.rst b/components/sensor/mmc5983.rst index c29a5b37a..b061354d0 100644 --- a/components/sensor/mmc5983.rst +++ b/components/sensor/mmc5983.rst @@ -8,8 +8,7 @@ MMC5983 Magnetometer :image: mmc5983.jpg :keywords: MMC5983 -The ``mmc5983`` integration allows you to use your MMC5983 triple-axis magnetometer -(`datasheet`_, `SparkFun`_) with ESPHome. +The ``mmc5983`` component allows you to use your MMC5983 triple-axis magnetometer (`datasheet`_, `SparkFun`_) with ESPHome. The :ref:`I²C Bus ` is required to be set up for this sensor to work. The device supports 400kHz operation, so you may specify up to ``frequency: 400kHz`` in your ``i2c`` configuration. diff --git a/components/sensor/mopeka_pro_check.rst b/components/sensor/mopeka_pro_check.rst index d5b8b8406..ec003a832 100644 --- a/components/sensor/mopeka_pro_check.rst +++ b/components/sensor/mopeka_pro_check.rst @@ -144,7 +144,7 @@ Then just copy the address (``D3:75:F2:DC:16:91``) into a new .. note:: - The ESPHome Mopeka Pro Check BLE integration listens passively to packets the Mopeka/Lippert device sends by itself. + The ESPHome Mopeka Pro Check BLE component listens passively to packets the Mopeka/Lippert device sends by itself. ESPHome therefore has no impact on the battery life of the device. See Also diff --git a/components/sensor/mopeka_std_check.rst b/components/sensor/mopeka_std_check.rst index 43911030e..e9f7f6f6d 100644 --- a/components/sensor/mopeka_std_check.rst +++ b/components/sensor/mopeka_std_check.rst @@ -138,7 +138,7 @@ Then just copy the address (``D3:75:F2:DC:16:91``) into a new .. note:: - The ESPHome Mopeka Standard Check BLE integration listens passively to packets the Mopeka device sends by itself. + The ESPHome Mopeka Standard Check BLE component listens passively to packets the Mopeka device sends by itself. ESPHome therefore has no impact on the battery life of the device. See Also diff --git a/components/sensor/mqtt_subscribe.rst b/components/sensor/mqtt_subscribe.rst index c004949fb..ae8e723e0 100644 --- a/components/sensor/mqtt_subscribe.rst +++ b/components/sensor/mqtt_subscribe.rst @@ -10,7 +10,7 @@ The ``mqtt_subscribe`` sensor platform allows you to get external data into ESPH The sensor will subscribe to messages on the given MQTT topic and parse each message into a floating point number. -Please note this integration only works with MQTT topics that have numeric data! Each time +Please note this component only works with MQTT topics that have numeric data! Each time a message that is not a number is published a warning will be shown. Please use the MQTT subscribe text sensor for importing arbitrary text into the ESPHome ecosystem. diff --git a/components/sensor/pmsx003.rst b/components/sensor/pmsx003.rst index 0ecee8b54..e51fe8e70 100644 --- a/components/sensor/pmsx003.rst +++ b/components/sensor/pmsx003.rst @@ -31,11 +31,6 @@ If you wish to use the optional ``update_interval`` ensure you have a ``tx_pin`` .. code-block:: yaml # Example configuration entry - uart: - rx_pin: GPIO23 - tx_pin: GPIO22 - baud_rate: 9600 - sensor: - platform: pmsx003 type: PMSX003 @@ -45,7 +40,6 @@ If you wish to use the optional ``update_interval`` ensure you have a ``tx_pin`` name: "Particulate Matter <2.5µm Concentration" pm_10_0: name: "Particulate Matter <10.0µm Concentration" - update_interval: 120s Configuration variables: ------------------------ diff --git a/components/sensor/pulse_counter.rst b/components/sensor/pulse_counter.rst index 865cda92f..9486bd4de 100644 --- a/components/sensor/pulse_counter.rst +++ b/components/sensor/pulse_counter.rst @@ -21,7 +21,7 @@ on the ESP32. However, due to the use of the pulse counter peripheral, a maximum # Example configuration entry sensor: - platform: pulse_counter - pin: 12 + pin: GPIOXX name: "Pulse Counter" Configuration variables @@ -72,7 +72,7 @@ count the light pulses on a power meter, you can do the following: # Example configuration entry sensor: - platform: pulse_counter - pin: 12 + pin: GPIOXX unit_of_measurement: 'kW' name: 'Power Meter House' filters: @@ -90,7 +90,7 @@ measure the total consumed energy in kWh. # Example configuration entry sensor: - platform: pulse_counter - pin: 12 + pin: GPIOXX unit_of_measurement: 'kW' name: 'Power Meter House' filters: diff --git a/components/sensor/pulse_meter.rst b/components/sensor/pulse_meter.rst index 102a20163..785f299c5 100644 --- a/components/sensor/pulse_meter.rst +++ b/components/sensor/pulse_meter.rst @@ -6,7 +6,7 @@ Pulse Meter Sensor :image: pulse.svg 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 the :doc:`pulse counter integration `. +for the :doc:`pulse counter component `. Rather than counting pulses over a fixed time interval, the pulse meter sensor measures the time between pulses. The precise manner in which this is done depends on the ``internal_filter_mode`` option. This leads to a higher resolution, especially for low pulse rates, as the pulse counter sensor is limited by the number of pulses within a time interval. Here's a comparison of the two sensors. The pulse meter is the smoother line. Both are set to an update interval of 10 seconds (using the ``update_interval`` and the ``throttle_average`` option respectively): @@ -22,7 +22,7 @@ Please note that it is not possible to use both of these two sensors on the same # Example configuration entry sensor: - platform: pulse_meter - pin: 12 + pin: GPIOXX name: "Pulse Meter" Configuration variables @@ -32,7 +32,7 @@ Configuration variables - **name** (**Required**, string): The name of the sensor. - **internal_filter** (*Optional*, :ref:`config-time`): If a pulse shorter than this time is detected, it is discarded. Defaults to ``13us``. - + This acts as a debounce filter to eliminate input noise, so choose a value a little less than your expected minimum pulse width. - **internal_filter_mode** (*Optional*, string): Determines how the internal filter is applied. @@ -62,7 +62,7 @@ For example, if you’re using the pulse meter with a photodiode to count the li state_class: measurement internal_filter: 20ms # Assuming maximum load of 16 kW and 10000 impulses per kWh, any pulses faster than 22.5 ms would exceed load. -10% ~= 20 ms. accuracy_decimals: 0 - pin: 12 + pin: GPIOXX filters: - multiply: 6 # (60s / impulse constant) * (1000W / 1kW) diff --git a/components/sensor/pzem004t.rst b/components/sensor/pzem004t.rst index 2e339e37a..b35d2c6ae 100644 --- a/components/sensor/pzem004t.rst +++ b/components/sensor/pzem004t.rst @@ -24,7 +24,7 @@ ESPHome. The PZEM-004, however, is still working (and selling) with this protocol and does not use modbus. For using the newer V3 variant of this sensor please see :doc:`pzemac `. -The communication with this integration is done over a :ref:`UART bus `. +The communication with this component is done via a :ref:`UART `. 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. diff --git a/components/sensor/pzemac.rst b/components/sensor/pzemac.rst index cebb686a1..cd3ee42dc 100644 --- a/components/sensor/pzemac.rst +++ b/components/sensor/pzemac.rst @@ -37,7 +37,7 @@ for more information. This page refers to version V3 of the PZEM004T. For using the older V1 variant of this sensor please see :doc:`pzem004t `. -The communication with this integration is done over a :ref:`UART bus ` using :ref:`Modbus `. +The communication with this component is done via a :ref:`UART ` using :ref:`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. diff --git a/components/sensor/pzemdc.rst b/components/sensor/pzemdc.rst index 6a7d29091..c2a9edc0e 100644 --- a/components/sensor/pzemdc.rst +++ b/components/sensor/pzemdc.rst @@ -15,7 +15,7 @@ Peacefair PZEM-00X DC Energy Monitor The ``pzemdc`` sensor platform allows you to use various DC Peacefair PZEM energy monitors with ESPHome. The supported models are: PZEM-003, PZEM-014, PZEM-016 and PZEM-017. -The communication with this integration is done over a :ref:`UART bus `. +The communication with this component is via a :ref:`UART `. 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. diff --git a/components/sensor/ruuvitag.rst b/components/sensor/ruuvitag.rst index 92a3ae9d7..b38f80740 100644 --- a/components/sensor/ruuvitag.rst +++ b/components/sensor/ruuvitag.rst @@ -176,7 +176,7 @@ Then just copy the address (``FF:56:D3:2F:7D:E8``) into a new .. note:: - The ESPHome Ruuvi BLE integration listens passively to packets the RuuviTag device sends by itself. + The ESPHome Ruuvi BLE component listens passively to packets the RuuviTag device sends by itself. ESPHome therefore has no impact on the battery life of the device. See Also diff --git a/components/sensor/sdm_meter.rst b/components/sensor/sdm_meter.rst index 44067ca03..fa3192694 100644 --- a/components/sensor/sdm_meter.rst +++ b/components/sensor/sdm_meter.rst @@ -16,7 +16,7 @@ with ESPHome. SDM230M Energy Monitor. -The communication with this integration is done over a :ref:`UART bus ` using the :ref:`Modbus protocol ` +The communication with this component is done via a :ref:`UART ` using the :ref:`Modbus protocol ` over RS485 wiring. You will need an RS485 to UART converter for communication. 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 9600bps. diff --git a/components/sensor/selec_meter.rst b/components/sensor/selec_meter.rst index 392583905..fb268dffa 100644 --- a/components/sensor/selec_meter.rst +++ b/components/sensor/selec_meter.rst @@ -16,7 +16,7 @@ with ESPHome. Selec EM2M Energy Monitor. -The communication with this integration is done over a :ref:`UART bus ` using :ref:`Modbus `. +The communication with this component is done via a :ref:`UART ` using :ref:`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. diff --git a/components/sensor/smt100.rst b/components/sensor/smt100.rst index 93e7567fc..cfabbd757 100644 --- a/components/sensor/smt100.rst +++ b/components/sensor/smt100.rst @@ -1,5 +1,5 @@ SMT100 Soil Moisture Sensor -================================ +=========================== .. seo:: :description: Instructions for setting up SMT100 soil moisture and temperature sensor @@ -14,7 +14,9 @@ The SMT100 sensor platform allows you to use the SMT100 soil moisture and temper :width: 50.0% -The communication with this integration is done over a UART bus using a simple ASCII protocol. 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. +The communication with this component is done via a :ref:`UART ` using a simple ASCII protocol. 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 diff --git a/components/sensor/t6615.rst b/components/sensor/t6615.rst index ee47d00c8..8b2526d5e 100644 --- a/components/sensor/t6615.rst +++ b/components/sensor/t6615.rst @@ -29,26 +29,17 @@ regulator, so you may need some additional components to power up the sensor. .. code-block:: yaml # Example configuration entry - uart: - rx_pin: 1 - tx_pin: 3 - baud_rate: 19200 - sensor: - platform: t6615 co2: - name: "CO2" - update_interval: 60s + name: CO2 Configuration variables: ------------------------ - **co2** (**Required**): The CO_2 data from the sensor in parts per million (ppm). - - - **name** (**Required**, string): The name for the CO_2 sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. diff --git a/components/sensor/teleinfo.rst b/components/sensor/teleinfo.rst index 5f3d786aa..27d97a281 100644 --- a/components/sensor/teleinfo.rst +++ b/components/sensor/teleinfo.rst @@ -52,44 +52,9 @@ simply press -/+ buttons on the counter and look for `Standard mode` or .. code-block:: yaml # Example configuration entry - uart: - id: uart_bus - rx_pin: GPIO3 - tx_pin: GPIO1 - baud_rate: 1200 - parity: EVEN - data_bits: 7 - teleinfo: id: myteleinfo - update_interval: 60s - historical_mode: true - sensor: - - platform: teleinfo - 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: ------------------------ @@ -112,17 +77,45 @@ In teleinfo platform: Sensor ****** +.. code-block:: yaml + + sensor: + - platform: teleinfo + 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 + - **tag_name** (**Required**, string): Specify the tag you want to retrieve from the Teleinformation. - **teleinfo_id** (*Optional*, :ref:`config-id`): Specify the ID of used hub. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor `. Text Sensor *********** +.. code-block:: yaml + + text_sensor: + - platform: teleinfo + tag_name: "OPTARIF" + name: "optarif" + teleinfo_id: myteleinfo + - **tag_name** (**Required**, string): Specify the tag you want to retrieve from the Teleinformation. - **teleinfo_id** (*Optional*, :ref:`config-id`): Specify the ID of used hub. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Text Sensor `. diff --git a/components/sensor/tx20.rst b/components/sensor/tx20.rst index 566e8ca8b..b4414262f 100644 --- a/components/sensor/tx20.rst +++ b/components/sensor/tx20.rst @@ -32,29 +32,22 @@ connected to GND in the TX20. sensor: - platform: tx20 wind_speed: - name: "Wind speed" + name: Wind speed wind_direction_degrees: - name: "Wind direction degrees" + name: Wind direction degrees pin: - number: GPIO04 + number: GPIOXX Configuration variables: ------------------------ - **wind_speed** (**Required**): The information for the wind speed sensor. - - - **name** (**Required**, string): The name for the wind speed - sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **wind_direction_degrees** (**Required**): The information for the direction in degrees sensor. - - - **name** (**Required**, string): The name for the direction sensor. - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - All other options from :ref:`Sensor `. + All options from :ref:`Sensor `. - **pin** (**Required**, :ref:`config-pin`): The pin, where the black or brown cable are connected. diff --git a/components/sensor/vl53l0x.rst b/components/sensor/vl53l0x.rst index 38c36d03a..86f173359 100644 --- a/components/sensor/vl53l0x.rst +++ b/components/sensor/vl53l0x.rst @@ -56,7 +56,6 @@ The :ref:`I²C Bus ` is required to be set up in your configuration for thi Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the sensor. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. - **signal_rate_limit** (*Optional*, float): Set the return signal rate limit in units of MCPS @@ -73,7 +72,6 @@ Configuration variables: on vl53l0x to enable/disable sensor. **Required** if not using address ``0x29`` which is the cause if you have multiple VL53L0X on the same i2c bus. In this case you have to assign a different pin to each VL53L0X. - **timeout** (*Optional*, :ref:`config-time`): Sensor setup timeout. Default to ``10ms``. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor `. @@ -86,7 +84,7 @@ Configuration variables: name: "distance1" id: distance1 address: 0x41 - enable_pin: GPIO16 + enable_pin: GPIOXX timeout: 200us update_interval: 500ms unit_of_measurement: "m" @@ -95,7 +93,7 @@ Configuration variables: name: "distance2" id: distance2 address: 0x42 - enable_pin: GPIO17 + enable_pin: GPIOXX timeout: 200us update_interval: 500ms unit_of_measurement: "m" diff --git a/components/sensor/xiaomi_ble.rst b/components/sensor/xiaomi_ble.rst index d10901740..cee4a1a6a 100644 --- a/components/sensor/xiaomi_ble.rst +++ b/components/sensor/xiaomi_ble.rst @@ -8,6 +8,12 @@ Xiaomi Mijia BLE Sensors The ``xiaomi_ble`` sensor platform lets you track the output of Xiaomi Bluetooth Low Energy devices using the :doc:`/components/esp32_ble_tracker`. This component will track, for example, the temperature, humidity, moisture, conductivity, illuminance, formaldehyde, mosquito tablet and battery level of the device every time the sensor sends out a BLE broadcast. Contrary to other implementations, ``xiaomi_ble`` listens passively to advertisement packets and does not pair with the device. Hence ESPHome has no impact on battery life. Thus, if you only use such sensors, you can safely set ``scan_parameters.active: false`` in ``esp32_ble_tracker`` configuration, to save from spamming your RF environment with useless scan requests. + +.. note:: + + You may alternatively use ESPHome's :doc:`/components/bluetooth_proxy` component to forward sensor data to Home Assistant and have Mija devices configured using its own Mija BLE component. This should work for the devices flashed with `PVVX MiThermometer `__ custom firmware, as well as the regular, stock firmware. + + Supported Devices ----------------- @@ -642,10 +648,6 @@ Security considerations You should at least protect your sensors with a custom pairing PIN code. Choose a method employing bindkey in order to use encrypted communication over the air. -.. note:: - - Devices flashed with `PVVX MiThermometer `__ custom firmware also support the `BTHome protocol `__ which can be used in conjunction with ESPHome's :doc:`/components/bluetooth_proxy` component to forward sensor data to Home Assistant. - See Also -------- diff --git a/components/servo.rst b/components/servo.rst index 89939fba4..2a50844a6 100644 --- a/components/servo.rst +++ b/components/servo.rst @@ -9,7 +9,7 @@ The ``servo`` component allows you to use servo motors with ESPHome. Servos are motor controllers that contain all the electronics necessary for driving the motor and provide a simple PWM interface to control the motor. -This integration works with both continuous-rotation and absolute servos and has a similar +This component works with both continuous-rotation and absolute servos and has a similar interface to the Arduino Servo library. First, create an :ref:`output component ` (here ``esp8266_pwm``) for the pin the @@ -34,7 +34,7 @@ only operate in this frequency range. output: - platform: esp8266_pwm id: pwm_output - pin: D1 + pin: GPIOXX frequency: 50 Hz Configuration variables: @@ -141,7 +141,7 @@ this will make the servo motor stop immediately and disable its active control. Home Assistant Configuration ---------------------------- -The easiest way to control your servo from Home Assistant is to add a ``number`` to your ESPHome +The easiest way to control your servo from Home Assistant is to add a ``number`` to your ESPHome configuration. See :ref:`Number ` for more information. .. code-block:: yaml diff --git a/components/sim800l.rst b/components/sim800l.rst index 58b7f0a17..4babcb9e6 100644 --- a/components/sim800l.rst +++ b/components/sim800l.rst @@ -346,7 +346,7 @@ Relay management commands received from an authorized sender: switch: - platform: gpio id: relay_1 - pin: 0 + pin: GPIOXX See Also diff --git a/components/sml.rst b/components/sml.rst index e049335f5..a9f835323 100644 --- a/components/sml.rst +++ b/components/sml.rst @@ -26,7 +26,9 @@ mature solution can be found `here `_ (in German). There are plenty of other examples and ready to buy solutions on the web. -Configuration +.. _sml-platform: + +Component/Hub ------------- As the communciation with the sensor is done using UART, you need to have the :ref:`UART bus ` @@ -36,14 +38,6 @@ smart meter. If you see checksum errors in the log try changing the interface pa .. code-block:: yaml # Example configuration entry - uart: - id: uart_bus - rx_pin: GPIO3 - baud_rate: 9600 - data_bits: 8 - parity: NONE - stop_bits: 1 - sml: id: mysml uart_id: uart_bus @@ -55,6 +49,19 @@ smart meter. If you see checksum errors in the log try changing the interface pa id(mqttclient).publish("gridmeter/sensor/sml/error", format_hex(bytes)); } + + +Configuration variables: + +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component ` if you want + to use multiple UART buses. + +Sensor +------ + +.. code-block:: yaml + sensor: - platform: sml name: "Total energy" @@ -68,6 +75,18 @@ smart meter. If you see checksum errors in the log try changing the interface pa filters: - multiply: 0.0001 +- **obis_code** (*Required*, string): Specify the OBIS code you want to retrieve data for from the device. + The format must be (A-B:C.D.E, e.g. 1-0:1.8.0) +- **server_id** (*Optional*, string): Specify the device's server_id to retrieve the OBIS code from. Should be specified if more then one device is connected to the same hardware sensor component. +- **sml_id** (*Optional*, :ref:`config-id`): The ID of the :ref:`SML platform ` +- All other options from :ref:`Sensor `. + + +Text Sensor +----------- + +.. code-block:: yaml + text_sensor: - platform: sml name: "Manufacturer" @@ -76,31 +95,6 @@ smart meter. If you see checksum errors in the log try changing the interface pa obis_code: "129-129:199.130.3" format: text - -Configuration variables: ------------------------- - -.. _sml-platform: - -SML platform -************ - -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component ` if you want - to use multiple UART buses. - -Sensor -****** - -- **obis_code** (*Required*, string): Specify the OBIS code you want to retrieve data for from the device. - The format must be (A-B:C.D.E, e.g. 1-0:1.8.0) -- **server_id** (*Optional*, string): Specify the device's server_id to retrieve the OBIS code from. Should be specified if more then one device is connected to the same hardware sensor component. -- **sml_id** (*Optional*, :ref:`config-id`): The ID of the :ref:`SML platform ` -- All other options from :ref:`Sensor `. - -Text Sensor -*********** - - **obis_code** (*Required*, string): Specify the OBIS code you want to retrieve data for from the device. The format must be (A-B:C.D.E, e.g. 1-0:1.8.0) - **server_id** (*Optional*, string): Specify the device's server_id to retrieve the OBIS code from. Should be specified if more then one device is connected to the same hardware sensor component. @@ -108,6 +102,7 @@ Text Sensor - **format** (*Optional*, string): Override the automatic interpretation of the transmitted binary data value. Possible values (`int`, `uint`, `bool`, `hex`, `text`). - All other options from :ref:`Text Sensor `. + Automations: ------------ diff --git a/components/sn74hc165.rst b/components/sn74hc165.rst index baa3f3263..6af4544a4 100644 --- a/components/sn74hc165.rst +++ b/components/sn74hc165.rst @@ -17,23 +17,12 @@ shift register to the pin QH of the next shift register. # Example configuration entry sn74hc165: - id: sn74hc165_hub - clock_pin: GPIO16 - data_pin: GPIO17 - load_pin: GPIO4 - clock_inhibit_pin: GPIO18 + clock_pin: GPIOXX + data_pin: GPIOXX + load_pin: GPIOXX + clock_inhibit_pin: GPIOXX sr_count: 2 - # Individual inputs - binary_sensor: - - platform: gpio - name: "SN74HC165 Pin #0" - pin: - sn74hc165: sn74hc165_hub - # Use pin number 0 - number: 0 - inverted: false - - Configuration variables: ************************ @@ -48,7 +37,20 @@ Configuration variables: Pin configuration variables: **************************** -- **SN74HC165** (**Required**, :ref:`config-id`): The id of the SN74HC165 component of the pin. +.. code-block:: yaml + + # Individual inputs + binary_sensor: + - platform: gpio + name: "SN74HC165 Pin #0" + pin: + sn74hc165: sn74hc165_hub + # Use pin number 0 + number: 0 + inverted: false + + +- **sn74hc165** (**Required**, :ref:`config-id`): The id of the SN74HC165 component of the pin. - **number** (**Required**, int): The pin number. - **inverted** (*Optional*, boolean): If received value should be treated as inverted. Defaults to ``false``. diff --git a/components/sn74hc595.rst b/components/sn74hc595.rst index 7d48a6192..f414a58ca 100644 --- a/components/sn74hc595.rst +++ b/components/sn74hc595.rst @@ -32,10 +32,10 @@ Over GPIO # Example configuration entry sn74hc595: - id: 'sn74hc595_hub' - data_pin: D5 - clock_pin: D8 - latch_pin: D7 - oe_pin: D6 + data_pin: GPIOXX + clock_pin: GPIOXX + latch_pin: GPIOXX + oe_pin: GPIOXX sr_count: 2 # Individual outputs @@ -58,28 +58,36 @@ Configuration variables: - **oe_pin** (*Optional*, :ref:`Pin Schema `): Pin connected to SN74HC595 OE pin - **sr_count** (*Optional*, int): Number of daisy-chained shift registers, up-to 256. Defaults to ``1``. - -Pin configuration variables: -**************************** - -- **sn74hc595** (**Required**, :ref:`config-id`): The id of the SN74HC595 component the pin belongs to. -- **number** (**Required**, int): The pin number. -- **inverted** (*Optional*, boolean): If all written values should be treated as inverted. - Defaults to ``false``. - Over SPI -------- .. code-block:: yaml # Example configuration entry - spi: sn74hc595: - id: 'sn74hc595_hub' - latch_pin: D7 - oe_pin: D6 + type: spi + latch_pin: GPIOXX + oe_pin: GPIOXX sr_count: 2 + +Configuration variables: +************************ + +- **id** (**Required**, :ref:`config-id`): The id to use for this SN74HC595 component. +- **spi_id** (**Required**, :ref:`SPI Bus Schema `): The SPI bus to use. This will automatically be set to the ID of the SPI bus if there is only one. +- **type** (**Required**, string): Must be ``spi``. +- **latch_pin** (**Required**, :ref:`Pin Schema `): Pin connected to SN74HC595 RCLK (ST_CP) pin +- **oe_pin** (*Optional*, :ref:`Pin Schema `): Pin connected to SN74HC595 OE pin +- **sr_count** (*Optional*, int): Number of daisy-chained shift registers, up to 256. Defaults to ``1``. + + +Pin configuration +----------------- + +.. code-block:: yaml + # Individual outputs switch: - platform: gpio @@ -90,17 +98,6 @@ Over SPI number: 0 inverted: false -Configuration variables: -************************ - -- **id** (**Required**, :ref:`config-id`): The id to use for this SN74HC595 component. -- **latch_pin** (**Required**, :ref:`Pin Schema `): Pin connected to SN74HC595 RCLK (ST_CP) pin -- **oe_pin** (*Optional*, :ref:`Pin Schema `): Pin connected to SN74HC595 OE pin -- **sr_count** (*Optional*, int): Number of daisy-chained shift registers, up to 256. Defaults to ``1``. - - -Pin configuration variables: -**************************** - **sn74hc595** (**Required**, :ref:`config-id`): The id of the SN74HC595 component of the pin. - **number** (**Required**, int): The pin number. diff --git a/components/speaker/i2s_audio.rst b/components/speaker/i2s_audio.rst index 34ff78bbf..92023ab37 100644 --- a/components/speaker/i2s_audio.rst +++ b/components/speaker/i2s_audio.rst @@ -12,7 +12,7 @@ This platform only works on ESP32 based chips. .. warning:: Audio and voice components consume a significant amount of resources (RAM, CPU) on the device. - + **Crashes are likely to occur** if you include too many additional components in your device's configuration. In particular, Bluetooth/BLE components are known to cause issues when used in combination with Voice Assistant and/or other audio components. @@ -23,7 +23,7 @@ This platform only works on ESP32 based chips. speaker: - platform: i2s_audio dac_type: external - i2s_dout_pin: GPIO22 + i2s_dout_pin: GPIOXX mode: mono Configuration variables: diff --git a/components/spi.rst b/components/spi.rst index 485e246fe..bf2f2543c 100644 --- a/components/spi.rst +++ b/components/spi.rst @@ -35,30 +35,30 @@ This component also accepts a list of controllers if you want to implement multi # Example configuration entry - single controller spi: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIOXX + mosi_pin: GPIOXX + miso_pin: GPIOXX # Example configuration entry - three controllers, one using quad SPI spi: - id: spi_bus0 - clk_pin: GPIO18 - mosi_pin: GPIO23 - miso_pin: GPIO19 + clk_pin: GPIOXX + mosi_pin: GPIOXX + miso_pin: GPIOXX interface: hardware - id: spi_bus1 - clk_pin: GPIO14 - mosi_pin: GPIO27 - miso_pin: GPIO26 + clk_pin: GPIOXX + mosi_pin: GPIOXX + miso_pin: GPIOXX interface: any - id: quad_spi_bus type: quad - clk_pin: GPIO47 + clk_pin: GPIOXX data_pins: - - 40 - - 41 - - 42 - - 43 + - GPIOXX + - GPIOXX + - GPIOXX + - GPIOXX Configuration variables: ------------------------ @@ -117,14 +117,14 @@ Reads and writes on the device can be performed with lambdas. For example: .. code-block:: yaml spi: - clk_pin: GPIO14 - mosi_pin: GPIO27 - miso_pin: GPIO26 + clk_pin: GPIOXX + mosi_pin: GPIOXX + miso_pin: GPIOXX interface: hardware spi_device: id: spidev - cs_pin: GPIO13 + cs_pin: GPIOXX data_rate: 2MHz mode: 3 bit_order: lsb_first diff --git a/components/sprinkler.rst b/components/sprinkler.rst index 2f7ec30dd..0221411f9 100644 --- a/components/sprinkler.rst +++ b/components/sprinkler.rst @@ -662,7 +662,7 @@ could easily be added by adding the ``pump_switch_id`` parameter and a :ref:`swi switch: - platform: gpio id: garden_sprinkler_valve - pin: 5 + pin: GPIOXX Single Controller, Three Valves, No Pump **************************************** @@ -707,13 +707,13 @@ This example illustrates a complete, simple three-valve system with no pump/upst switch: - platform: gpio id: lawn_sprinkler_valve_sw0 - pin: 0 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw1 - pin: 2 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw2 - pin: 4 + pin: GPIOXX Single Controller, Three Valves, Single Pump ******************************************** @@ -759,16 +759,16 @@ This example illustrates a complete three-valve system with a single pump/upstre switch: - platform: gpio id: sprinkler_pump_sw - pin: 12 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw0 - pin: 0 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw1 - pin: 2 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw2 - pin: 4 + pin: GPIOXX Single Controller, Three Latching Valves, Single Latching Pump ************************************************************** @@ -832,28 +832,28 @@ a common pump/upstream valve. switch: - platform: gpio id: sprinkler_pump_sw_off - pin: 14 + pin: GPIOXX - platform: gpio id: sprinkler_pump_sw_on - pin: 15 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw0_off - pin: 0 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw0_on - pin: 2 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw1_off - pin: 4 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw1_on - pin: 5 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw2_off - pin: 12 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw2_on - pin: 13 + pin: GPIOXX Dual Controller, Five Valves, Two Pumps *************************************** @@ -925,25 +925,25 @@ valves, each of which are shared between the two controllers: switch: - platform: gpio id: sprinkler_pump_sw0 - pin: 12 + pin: GPIOXX - platform: gpio id: sprinkler_pump_sw1 - pin: 13 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw0 - pin: 0 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw1 - pin: 2 + pin: GPIOXX - platform: gpio id: lawn_sprinkler_valve_sw2 - pin: 4 + pin: GPIOXX - platform: gpio id: garden_sprinkler_valve_sw0 - pin: 14 + pin: GPIOXX - platform: gpio id: garden_sprinkler_valve_sw1 - pin: 15 + pin: GPIOXX .. note:: @@ -1160,7 +1160,7 @@ How Do I... *********** - **...determine if the sprinkler controller is running?** - + Use the method ``optional active_valve()`` to check if there is an active valve. If the ``optional`` returned ``has_value()``, the sprinkler controller is running and you may use the ``value()`` method to check which specific valve is active. @@ -1225,7 +1225,7 @@ How Do I... } - **...determine the sprinkler controller's multiplier/repeat values?** - + Methods of interest in this case are: - ``float multiplier()`` diff --git a/components/status_led.rst b/components/status_led.rst index 28af3bd75..fa629893c 100644 --- a/components/status_led.rst +++ b/components/status_led.rst @@ -9,7 +9,8 @@ The ``status_led`` hooks into all ESPHome components and can indicate the status the device. Specifically, it will: - Blink slowly (about every second) when a **warning** is active. Warnings are active when for - example reading a sensor value fails temporarily or the WiFi/MQTT connections are disrupted. + example reading a sensor value fails temporarily, the WiFi/MQTT connections are disrupted, or + if the native API component is included but no client is connected. - Blink quickly (multiple times per second) when an **error** is active. Errors indicate that ESPHome has found an error while setting up. In most cases, ESPHome will still try to recover from the error and continue with all other operations. @@ -19,7 +20,7 @@ the device. Specifically, it will: # Example configuration entry status_led: - pin: GPIO2 + pin: GPIOXX .. note:: @@ -41,7 +42,7 @@ Configuration variables: status_led: pin: - number: D0 + number: GPIOXX inverted: true See Also diff --git a/components/stepper/index.rst b/components/stepper/index.rst index 10401e88a..ea3225b3c 100644 --- a/components/stepper/index.rst +++ b/components/stepper/index.rst @@ -45,12 +45,12 @@ Put this code into the configuration file on ESPHome for this device. stepper: - platform: a4988 id: my_stepper - step_pin: D0 - dir_pin: D1 + step_pin: GPIOXX + dir_pin: GPIOXX max_speed: 250 steps/s # Optional: - sleep_pin: D2 + sleep_pin: GPIOXX acceleration: inf deceleration: inf @@ -78,7 +78,7 @@ Configuration variables: - platform: a4988 # ... dir_pin: - number: D1 + number: GPIOXX inverted: true ULN2003 Component @@ -92,10 +92,10 @@ Put this code into the configuration file on ESPHome for this device. stepper: - platform: uln2003 id: my_stepper - pin_a: D0 - pin_b: D1 - pin_c: D2 - pin_d: D3 + pin_a: GPIOXX + pin_b: GPIOXX + pin_c: GPIOXX + pin_d: GPIOXX max_speed: 250 steps/s # Optional: @@ -273,7 +273,7 @@ Configuration variables: Home Assistant Configuration ---------------------------- -The easiest way to control your stepper from Home Assistant is to add a ``number`` to your ESPHome +The easiest way to control your stepper from Home Assistant is to add a ``number`` to your ESPHome configuration. See :ref:`Number ` for more information. .. code-block:: yaml diff --git a/components/switch/custom.rst b/components/switch/custom.rst index 1f9344980..5e0823171 100644 --- a/components/switch/custom.rst +++ b/components/switch/custom.rst @@ -1,21 +1,27 @@ Custom Switch ============= +.. seo:: + :description: Instructions for setting up Custom C++ switches with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create custom switches in ESPHome -using the C++ (Arduino) API. +.. warning:: -Please first read :doc:`/components/sensor/custom` guide, -the same principles apply here. + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + +This component can be used to create custom switches in ESPHome using the C++ (Arduino) API. + +Please first read :doc:`/components/sensor/custom` guide, the same principles apply here. The example below is an example of a custom switch; this custom switch is essentially the same as the gpio switch implementation. diff --git a/components/switch/gpio.rst b/components/switch/gpio.rst index 4d69d4c5b..3bdc5e0eb 100644 --- a/components/switch/gpio.rst +++ b/components/switch/gpio.rst @@ -18,7 +18,7 @@ through this platform. # Example configuration entry switch: - platform: gpio - pin: 25 + pin: GPIOXX name: "Living Room Dehumidifier" Configuration variables: @@ -26,8 +26,6 @@ Configuration variables: - **pin** (**Required**, :ref:`Pin Schema `): The GPIO pin to use for the switch. -- **name** (**Required**, string): The name for the switch. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **interlock** (*Optional*, list): A list of other GPIO switches in an interlock group. See :ref:`switch-gpio-interlocking`. - **interlock_wait_time** (*Optional*, :ref:`config-time`): For interlocking mode, set how long @@ -47,7 +45,7 @@ To create an active-low switch (one that is turned off by default), use the :ref switch: - platform: gpio pin: - number: 25 + number: GPIOXX inverted: true Momentary Switch @@ -65,7 +63,7 @@ or closes the gate. The relay simulates the button press for 500ms. # Example configuration entry switch: - platform: gpio - pin: 25 + pin: GPIOXX id: relay name: "Gate Remote" icon: "mdi:gate" @@ -92,13 +90,13 @@ with a list of all the switches in the group. # Prevent relay #1 and relay #2 from being activated at the same time. switch: - platform: gpio - pin: GPIO25 + pin: GPIOXX name: "Relay #1" id: relay1 interlock: [relay2] - platform: gpio - pin: GPIO26 + pin: GPIOXX name: "Relay #2" id: relay2 interlock: [relay1] diff --git a/components/switch/index.rst b/components/switch/index.rst index 88c739be6..eca9a1bed 100644 --- a/components/switch/index.rst +++ b/components/switch/index.rst @@ -59,14 +59,14 @@ Configuration variables: when the switch is turned off. See :ref:`switch-on_turn_on_off_trigger`. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. - **device_class** (*Optional*, string): The device class for the switch. See https://www.home-assistant.io/integrations/switch/#device-class - for a list of available options. Requires Home Assistant 2022.3 or newer. + for a list of available options. - If MQTT enabled, All other options from :ref:`MQTT Component `. .. _switch-toggle_action: diff --git a/components/switch/output.rst b/components/switch/output.rst index b637b250c..5282f3564 100644 --- a/components/switch/output.rst +++ b/components/switch/output.rst @@ -16,7 +16,7 @@ The ``output`` switch platform allows you to use any output component as a switc # Example configuration entry output: - platform: gpio - pin: 25 + pin: GPIOXX id: 'generic_out' switch: - platform: output diff --git a/components/switch/uart.rst b/components/switch/uart.rst index 1be109264..98957a318 100644 --- a/components/switch/uart.rst +++ b/components/switch/uart.rst @@ -11,10 +11,6 @@ The ``uart`` switch platform allows you to send a pre-defined sequence of bytes .. code-block:: yaml # Example configuration entry - uart: - baud_rate: 9600 - tx_pin: D0 - switch: - platform: uart name: "UART String Output" diff --git a/components/text_sensor/custom.rst b/components/text_sensor/custom.rst index e43e31f7d..f0606e19d 100644 --- a/components/text_sensor/custom.rst +++ b/components/text_sensor/custom.rst @@ -1,22 +1,28 @@ Custom Text Sensor ================== +.. seo:: + :description: Instructions for setting up Custom C++ text sensors with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create custom text sensors in ESPHome -using the C++ (Arduino) API. +.. warning:: -Please first read :doc:`/components/sensor/custom` guide, -the same principles apply here and text sensors are very similar -to sensors internally. + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + +This component can be used to create custom text sensors in ESPHome using the C++ (Arduino) API. + +Please first read :doc:`/components/sensor/custom` guide, the same principles apply here and text +sensors are very similar to sensors internally. The example below is an example of a custom text sensor which constantly publishes the message "Hello World!". diff --git a/components/text_sensor/ethernet_info.rst b/components/text_sensor/ethernet_info.rst index 7acc81ec7..cbcd0418a 100644 --- a/components/text_sensor/ethernet_info.rst +++ b/components/text_sensor/ethernet_info.rst @@ -25,6 +25,8 @@ via text sensors. name: ESP IP Address 3 address_4: name: ESP IP Address 4 + dns_address: + name: ESP DNS Address Configuration variables: @@ -34,6 +36,8 @@ Configuration variables: :ref:`Text Sensor `. - **address_0-address_4** (*Optional*): With dual stack (IPv4 and IPv6) the device will have at least two IP addresses -- often more. To report all addresses the configuration may have up to five sub-sensors. All options from :ref:`Text Sensor `. +- **dns_address** (*Optional*): Expose the DNS Address of the ESP as text sensor. + :ref:`Text Sensor `. See Also -------- diff --git a/components/text_sensor/index.rst b/components/text_sensor/index.rst index 9638ced99..ad909ecb2 100644 --- a/components/text_sensor/index.rst +++ b/components/text_sensor/index.rst @@ -41,10 +41,10 @@ Configuration variables: a ``name`` will implicitly set this to true. - **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend, (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). - Requires Home Assistant 2021.9 or newer. Defaults to ``false``. + Defaults to ``false``. - **entity_category** (*Optional*, string): The category of the entity. See https://developers.home-assistant.io/docs/core/entity/#generic-properties - for a list of available options. Requires Home Assistant 2021.11 or newer. + for a list of available options. Set to ``""`` to remove the default entity category. - If MQTT enabled, All other options from :ref:`MQTT Component `. diff --git a/components/text_sensor/mqtt_subscribe.rst b/components/text_sensor/mqtt_subscribe.rst index 306955c70..17a6d5966 100644 --- a/components/text_sensor/mqtt_subscribe.rst +++ b/components/text_sensor/mqtt_subscribe.rst @@ -31,7 +31,7 @@ Configuration variables: Example Usage for Displays -------------------------- -This integration is especially useful for displays, to show external data on the display. +This component is especially useful for displays, to show external data on the display. Please note you have to use the ``.c_str()`` method on the ``.state`` object together with the ``%s`` format to use it in ``printf`` expressions. diff --git a/components/text_sensor/wl_134.rst b/components/text_sensor/wl_134.rst index a8bfe6c33..0f55e7f01 100644 --- a/components/text_sensor/wl_134.rst +++ b/components/text_sensor/wl_134.rst @@ -10,20 +10,15 @@ The ``wl_134`` text sensor platform exposes the last read pet tag as text sensor .. code-block:: yaml # Example configuration entry - uart: - rx_pin: GPIO17 - baud_rate: 9600 - text_sensor: - platform: wl_134 name: Transponder Code - reset: true Configuration variables: ------------------------ - **reset** (*Optional*, boolean): Reset the text sensor state back to "" 1s after reading a tag. Defaults to ``false``. -- All options from :ref:`Text Sensor `. +- All other options from :ref:`Text Sensor `. See Also -------- diff --git a/components/tm1651.rst b/components/tm1651.rst index adc334661..51dc85144 100644 --- a/components/tm1651.rst +++ b/components/tm1651.rst @@ -10,9 +10,9 @@ TM1651 Battery Display Battery Display --------------- -The ``tm1651`` display platform allows you to use battery display units based on TM1651 chip, like -`this one `__ -with ESPHome. Currently integration supports level and brightness setting. All updates can be made via lambda expressions. +The ``tm1651`` display platform allows you to use battery display units based on the TM1651 chip such as +`this one `__ with ESPHome. This component supports the level +and brightness settings. All updates can be made via lambda expressions. .. figure:: images/tm1651-battery-display.jpg :align: center @@ -22,8 +22,8 @@ with ESPHome. Currently integration supports level and brightness setting. All u tm1651: id: tm1651_battery - clk_pin: D6 - dio_pin: D5 + clk_pin: GPIOXX + dio_pin: GPIOXX Configuration variables: ************************ diff --git a/components/touchscreen/cst226.rst b/components/touchscreen/cst226.rst index a9ddfaeab..8ac6328ef 100644 --- a/components/touchscreen/cst226.rst +++ b/components/touchscreen/cst226.rst @@ -27,7 +27,7 @@ Base Touchscreen Configuration touchscreen: platform: cst226 id: my_touchscreen - interrupt_pin: GPIO3 + interrupt_pin: GPIOXX Configuration variables: ************************ diff --git a/components/touchscreen/cst816.rst b/components/touchscreen/cst816.rst index 62f3bb79a..53e13aaeb 100644 --- a/components/touchscreen/cst816.rst +++ b/components/touchscreen/cst816.rst @@ -28,8 +28,8 @@ Base Touchscreen Configuration touchscreen: platform: cst816 id: my_touchscreen - interrupt_pin: GPIO3 - reset_pin: GPIO21 + interrupt_pin: GPIOXX + reset_pin: GPIOXX Configuration variables: ************************ diff --git a/components/touchscreen/ektf2232.rst b/components/touchscreen/ektf2232.rst index 220c61a37..c156584b7 100644 --- a/components/touchscreen/ektf2232.rst +++ b/components/touchscreen/ektf2232.rst @@ -15,8 +15,8 @@ The :ref:`I²C ` is required to be set up in your configuration for this se # Example configuration entry touchscreen: - platform: ektf2232 - interrupt_pin: GPIO36 - rts_pin: GPIO16 + interrupt_pin: GPIOXX + rts_pin: GPIOXX Configuration variables: diff --git a/components/touchscreen/ft63x6.rst b/components/touchscreen/ft63x6.rst index b206d21cb..75e9208aa 100644 --- a/components/touchscreen/ft63x6.rst +++ b/components/touchscreen/ft63x6.rst @@ -14,35 +14,9 @@ The :ref:`I²C ` is required to be set up in your configuration for this se .. code-block:: yaml # Example configuration entry - esp32: - board: m5stack-core2 - framework: - type: arduino - - i2c: - sda: GPIO18 - scl: GPIO19 - scan: false - - output: - - platform: ledc - pin: GPIO23 - id: screen_led - - light: - - platform: monochromatic - output: screen_led - default_transition_length: 0.2s - name: 'Backlight' - restore_mode: ALWAYS_ON - touchscreen: - platform: ft63x6 - interrupt_pin: GPIO39 - on_touch: - - logger.log: - format: Touch %d at (%d, %d) - args: [touch.id, touch.x, touch.y] + interrupt_pin: GPIOXX Configuration variables: ------------------------ diff --git a/components/touchscreen/gt911.rst b/components/touchscreen/gt911.rst index a1182c6f8..517563f50 100644 --- a/components/touchscreen/gt911.rst +++ b/components/touchscreen/gt911.rst @@ -27,7 +27,7 @@ Base Touchscreen Configuration touchscreen: platform: gt911 id: my_touchscreen - interrupt_pin: GPIO3 + interrupt_pin: GPIOXX Configuration variables: ************************ diff --git a/components/touchscreen/index.rst b/components/touchscreen/index.rst index c16c93ecf..2b9170fc3 100644 --- a/components/touchscreen/index.rst +++ b/components/touchscreen/index.rst @@ -124,7 +124,7 @@ The calibration assumes a display oriented in a way that you will be using it, i touchscreen: platform: xpt2046 id: my_touchscreen - cs_pin: 17 + cs_pin: GPIOXX on_touch: - lambda: |- ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d", @@ -256,7 +256,7 @@ For example you could do: Be aware that you need to check the state flag every time to see if the touch is still valid. - state value 0. means the touch is invalid as the touch is no longer detected. -- state value 1 means is being the first time detected. +- state value 1 means is being the first time detected. - state value 2 means the touch is still being detected but is moved on the screen. - state value 4 and higher means a touch release is detected. diff --git a/components/touchscreen/tt21100.rst b/components/touchscreen/tt21100.rst index ec0be66da..22c9cb9f2 100644 --- a/components/touchscreen/tt21100.rst +++ b/components/touchscreen/tt21100.rst @@ -32,8 +32,8 @@ Base Touchscreen Configuration touchscreen: platform: tt21100 id: my_touchscreen - interrupt_pin: GPIO3 - reset_pin: GPIO48 + interrupt_pin: GPIOXX + reset_pin: GPIOXX Configuration variables: ************************ diff --git a/components/touchscreen/xpt2046.rst b/components/touchscreen/xpt2046.rst index 7de79555b..77db1dfba 100644 --- a/components/touchscreen/xpt2046.rst +++ b/components/touchscreen/xpt2046.rst @@ -28,8 +28,8 @@ The :ref:`SPI ` is required to be set up in your configuration for this sen touchscreen: platform: xpt2046 id: my_touchscreen - cs_pin: 17 - interrupt_pin: 16 + cs_pin: GPIOXX + interrupt_pin: GPIOXX update_interval: 50ms threshold: 400 calibration: diff --git a/components/tuya.rst b/components/tuya.rst index 0710fb7d7..d941b8cf6 100644 --- a/components/tuya.rst +++ b/components/tuya.rst @@ -16,18 +16,10 @@ Put the ``tuya`` component in the config and it will list the possible devices f .. code-block:: yaml - # Make sure logging is not using the serial port - logger: - baud_rate: 0 - - uart: - rx_pin: GPIO3 - tx_pin: GPIO1 - baud_rate: 9600 - # Register the Tuya MCU connection tuya: + Here is an example output for a Tuya fan controller: .. code-block:: text diff --git a/components/uart.rst b/components/uart.rst index e808d3290..963238166 100644 --- a/components/uart.rst +++ b/components/uart.rst @@ -30,7 +30,7 @@ In some cases only **TX** or **RX** exists as the device at the other end only a On the ESP32, this component uses the hardware UART units and is thus very accurate. On the ESP8266 however, ESPHome has to use a software implementation as there are no other hardware UART units available other than the ones used for logging. Therefore the UART data on the ESP8266 can have occasional data glitches especially with - higher baud rates. + higher baud rates. .. note:: @@ -43,8 +43,8 @@ In some cases only **TX** or **RX** exists as the device at the other end only a # Example configuration entry uart: - tx_pin: 1 - rx_pin: 3 + tx_pin: GPIOXX + rx_pin: GPIOXX baud_rate: 9600 Configuration variables: @@ -74,7 +74,7 @@ be accurate at higher baud rates. logger and leave others available. If you have configured the logger to use a different hardware UART, the pins used for hardware sharing change accordingly. -The ESP32 has three UARTs. ESP32 lite variant chips (ESP32-S3, ESP32-C3, ESP32-S2, etc) may have fewer UARTs (usually two). Any pair of GPIO pins can be used, as long as they support the proper output/input modes. +The ESP32 has three UARTs. ESP32 lite variant chips (ESP32-S3, ESP32-C3, ESP32-S2, etc) may have fewer UARTs (usually two). Any pair of GPIO pins can be used, as long as they support the proper output/input modes. The ESP8266 has two UARTs; the second of which is TX-only. Only a limited set of pins can be used. ``UART0`` may use either ``tx_pin: GPIO1`` and ``rx_pin: GPIO3``, or ``tx_pin: GPIO15`` and ``rx_pin: GPIO13``. ``UART1`` must diff --git a/components/valve/images/valve-ui.png b/components/valve/images/valve-ui.png new file mode 100644 index 000000000..33c91f984 Binary files /dev/null and b/components/valve/images/valve-ui.png differ diff --git a/components/valve/index.rst b/components/valve/index.rst new file mode 100644 index 000000000..c6f196ac1 --- /dev/null +++ b/components/valve/index.rst @@ -0,0 +1,262 @@ +Valve Component +=============== + +.. seo:: + :description: Instructions for setting up base valves in ESPHome. + :image: folder-open.svg + +The ``valve`` component is a generic representation of valves in ESPHome. A valve can (currently) either be *closed* or +*open* and supports three commands: *open*, *close* and *stop*. + +.. note:: + + To use a valve in Home Assistant requires Home Assistant 2024.5 or later. + +.. figure:: images/valve-ui.png + :align: center + +.. _config-valve: + +Base Valve Configuration +------------------------ + +All valve config schemas inherit from this schema - you can set these keys for valves. + +.. code-block:: yaml + + valve: + - platform: ... + device_class: water + +Configuration variables: + +- **name** (**Required**, string): The name for the valve. + + .. note:: + + If you have a :ref:`friendly_name ` set for your device and you want the valve + to use that name, you can set ``name: None``. + +- **device_class** (*Optional*, string): The device class for the sensor. See + https://www.home-assistant.io/components/valve/ for a list of available options. +- **icon** (*Optional*, icon): Manually set the icon to use for the valve in the frontend. + +Advanced options: + +- **internal** (*Optional*, boolean): Mark this component as internal. Internal components will not be exposed to the + frontend (like Home Assistant). Only specifying an ``id`` without a ``name`` will implicitly set this to true. +- **disabled_by_default** (*Optional*, boolean): If true, this entity should not be added to any client's frontend, + (usually Home Assistant) without the user manually enabling it (via the Home Assistant UI). Defaults to ``false``. +- **entity_category** (*Optional*, string): The category of the entity. See + https://developers.home-assistant.io/docs/core/entity/#generic-properties for a list of available options. Set to ``""`` to remove the default entity category. + +MQTT options: + +- **position_state_topic** (*Optional*, string): The topic to publish valve position changes to. +- **position_command_topic** (*Optional*, string): The topic to receive valve position commands on. +- All other options from :ref:`MQTT Component `. + + +.. _valve-open_action: + +``valve.open`` Action +--------------------- + +This :ref:`action ` opens the valve with the given ID when executed. + +.. code-block:: yaml + + on_...: + then: + - valve.open: valve_1 + +.. note:: + + This action can also be expressed in :ref:`lambdas `: + + .. code-block:: cpp + + auto call = id(valve_1).make_call(); + call.set_command_open(); + call.perform(); + +.. _valve-close_action: + +``valve.close`` Action +---------------------- + +This :ref:`action ` closes the valve with the given ID when executed. + +.. code-block:: yaml + + on_...: + then: + - valve.close: valve_1 + +.. note:: + + This action can also be expressed in :ref:`lambdas `: + + .. code-block:: cpp + + auto call = id(valve_1).make_call(); + call.set_command_close(); + call.perform(); + +.. _valve-stop_action: + +``valve.stop`` Action +--------------------- + +This :ref:`action ` stops the valve with the given ID when executed. + +.. code-block:: yaml + + on_...: + then: + - valve.stop: valve_1 + +.. note:: + + This action can also be expressed in :ref:`lambdas `: + + .. code-block:: cpp + + auto call = id(valve_1).make_call(); + call.set_command_stop(); + call.perform(); + +.. _valve-toggle_action: + +``valve.toggle`` Action +----------------------- + +This :ref:`action ` toggles the valve with the given ID when executed, cycling through the states +close/stop/open/stop... This allows the valve to be controlled by a single push button. + +.. code-block:: yaml + + on_...: + then: + - valve.toggle: valve_1 + +.. note:: + + This action can also be expressed in :ref:`lambdas `: + + .. code-block:: cpp + + auto call = id(valve_1).make_call(); + call.set_command_toggle(); + call.perform(); + +.. _valve-control_action: + +``valve.control`` Action +------------------------ + +This :ref:`action ` is a more generic version of the other valve actions and allows all valve attributes +to be set. + +.. code-block:: yaml + + on_...: + then: + - valve.control: + id: valve_1 + position: 50% + +Configuration variables: + +- **id** (**Required**, :ref:`config-id`): The valve to control. +- **stop** (*Optional*, boolean): Whether to stop the valve. +- **state** (*Optional*, string): The state to set the valve to - one of ``OPEN`` or ``CLOSE``. +- **position** (*Optional*, float): The valve position to set. + + - ``0.0`` = ``0%`` = ``CLOSED`` + - ``1.0`` = ``100%`` = ``OPEN`` + +.. note:: + + This action can also be expressed in :ref:`lambdas `: + + .. code-block:: cpp + + auto call = id(valve_1).make_call(); + // set attributes + call.set_position(0.5); + call.perform(); + +.. _valve-lambda_calls: + +Lambdas +------- + +From :ref:`lambdas `, you can access the current state of the valve (note that these fields are +read-only, if you want to act on the valve, use the ``make_call()`` method as shown above). + +- ``position``: Retrieve the current position of the valve, as a value between ``0.0`` (closed) and ``1.0`` (open). + + .. code-block:: cpp + + if (id(my_valve).position == VALVE_OPEN) { + // Valve is open + } else if (id(my_valve).position == VALVE_CLOSED) { + // Valve is closed + } else { + // Valve is in-between open and closed + } + +- ``current_operation``: The operation the valve is currently performing: + + .. code-block:: cpp + + if (id(my_valve).current_operation == ValveOperation::VALVE_OPERATION_IDLE) { + // Valve is idle + } else if (id(my_valve).current_operation == ValveOperation::VALVE_OPERATION_OPENING) { + // Valve is currently opening + } else if (id(my_valve).current_operation == ValveOperation::VALVE_OPERATION_CLOSING) { + // Valve is currently closing + } + +.. _valve-on_open_trigger: + +``valve.on_open`` Trigger +************************* + +This trigger is activated each time the valve reaches a fully open state. + +.. code-block:: yaml + + valve: + - platform: template # or any other platform + # ... + on_open: + - logger.log: "Valve is Open!" + +.. _valve-on_closed_trigger: + +``valve.on_closed`` Trigger +*************************** + +This trigger is activated each time the valve reaches a fully closed state. + +.. code-block:: yaml + + valve: + - platform: template # or any other platform + # ... + on_closed: + - logger.log: "Valve is Closed!" + +See Also +-------- + +- :apiref:`valve/valve.h` +- :ghedit:`Edit` + +.. toctree:: + :maxdepth: 1 + :glob: + + * diff --git a/components/valve/template.rst b/components/valve/template.rst new file mode 100644 index 000000000..f3d3ffb5c --- /dev/null +++ b/components/valve/template.rst @@ -0,0 +1,118 @@ +Template Valve +============== + +.. seo:: + :description: Instructions for setting up template valves in ESPHome. + :image: description.svg + +The ``template`` valve platform allows you to create simple valves out of just a few actions and a value lambda. Once +defined, it will automatically appear in Home Assistant as a valve and can be controlled through the frontend. + +.. figure:: images/valve-ui.png + :align: center + +.. code-block:: yaml + + # Example configuration entry + valve: + - platform: template + name: "Template Valve" + lambda: |- + if (id(top_end_stop).state) { + return VALVE_OPEN; + } else { + return VALVE_CLOSED; + } + open_action: + - switch.turn_on: open_valve_switch + close_action: + - switch.turn_on: close_valve_switch + stop_action: + - switch.turn_on: stop_valve_switch + optimistic: true + + +Possible return values for the optional lambda: + + - ``return VALVE_OPEN;`` if the valve should be reported as OPEN. + - ``return VALVE_CLOSED;`` if the valve should be reported as CLOSED. + - ``return {};`` if the last state should be repeated. + +Configuration variables: +------------------------ + +- **name** (**Required**, string): The name of the valve. +- **lambda** (*Optional*, :ref:`lambda `): + Lambda to be evaluated repeatedly to get the current state of the valve. +- **open_action** (*Optional*, :ref:`Action `): The action that should be performed when the remote + (like Home Assistant's frontend) requests the valve to be opened. +- **close_action** (*Optional*, :ref:`Action `): The action that should be performed when the remote + requests the valve to be closed. +- **stop_action** (*Optional*, :ref:`Action `): The action that should be performed when the remote + requests the valve to be stopped. +- **optimistic** (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode, any command sent to + the template valve will immediately update the reported state and no lambda needs to be used. Defaults to ``false``. +- **assumed_state** (*Optional*, boolean): Whether the true state of the valve is not known. This will make the Home + Assistant frontend show buttons for both OPEN and CLOSE actions, instead of hiding one of them. Defaults to ``false``. +- **has_position** (*Optional*, boolean): Whether this valve will publish its position as a floating point number. + By default (``false``), the valve only publishes OPEN/CLOSED position. +- **position_action** (*Optional*, :ref:`Action `): The action that should be performed when the remote + (like Home Assistant's frontend) requests the valve be set to a specific position. The desired position is available + in the lambda in the ``pos`` variable. Requires ``has_position`` (above) to be set to ``true``. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- All other options from :ref:`Valve `. + +.. _valve-template-publish_action: + +``valve.template.publish`` Action +--------------------------------- + +You can also publish a state to a template valve from elsewhere in your YAML filewith the ``valve.template.publish`` action. + +.. code-block:: yaml + + # Example configuration entry + valve: + - platform: template + name: "Template Valve" + id: my_template_valve + + # in some trigger + on_...: + - valve.template.publish: + id: my_template_valve + state: OPEN + + # Templated + - valve.template.publish: + id: my_template_valve + state: !lambda 'return VALVE_OPEN;' + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the template valve. +- **state** (*Optional*, :ref:`templatable `): + The state to publish. One of ``OPEN``, ``CLOSED``. If using a lambda, use ``VALVE_OPEN`` or ``VALVE_CLOSED``. +- **position** (*Optional*, :ref:`templatable `, float): + The position to publish, from 0 (CLOSED) to 1.0 (OPEN) +- **current_operation** (*Optional*, :ref:`templatable `, string): + The current operation mode to publish. One of ``IDLE``, ``OPENING`` and ``CLOSING``. If using a lambda, use + ``VALVE_OPERATION_IDLE``, ``VALVE_OPERATION_OPENING``, and ``VALVE_OPERATION_CLOSING``. + +.. note:: + + This action can also be written in lambdas: + + .. code-block:: cpp + + id(my_template_valve).position = VALVE_OPEN; + id(my_template_valve).publish_state(); + +See Also +-------- + +- :doc:`/components/valve/index` +- :ref:`automation` +- :doc:`/cookbook/garage-door` +- :apiref:`template/valve/template_valve.h` +- :ghedit:`Edit` diff --git a/components/vbus.rst b/components/vbus.rst index 6ff20add9..3f582d1f8 100644 --- a/components/vbus.rst +++ b/components/vbus.rst @@ -74,17 +74,9 @@ Component .. code-block:: yaml # Example configuration entry - uart: - id: resol - rx_pin: GPIO3 - baud_rate: 9600 - vbus: uart_id: resol - logger: - baud_rate: 0 # disable uart logger on ESP8266 - .. warning:: If you are using the :doc:`logger` make sure you are not using the same pins for it or otherwise disable the UART @@ -234,7 +226,7 @@ Configuration variables: - **source** (**Required**): The address corresponding to ``your device model`` (see below). - **command** (**Required**): The ``command`` corresponding to your device (see below). - **sensors** (**Required**): A list of :ref:`Sensor ` definitions that include a ``lambda`` to do the decoding and return a ``float`` value. - + - **lambda** (**Required**, :ref:`lambda `): Code to parse a value from the incoming data packets and return it. The data packet is in a ``std::vector`` called ``x``. diff --git a/components/weikai.rst b/components/weikai.rst new file mode 100644 index 000000000..eec22c4e6 --- /dev/null +++ b/components/weikai.rst @@ -0,0 +1,340 @@ +WeiKai SPI/I²C UART/IO Expander +=============================== + +.. seo:: + :description: Instructions for setting up WeiKai SPI/I²C to UART Expanders in ESPHome. + :image: wk2168.jpg + :keywords: UART, SPI, I²C, WK2132, WK2168, WK2204, WK2212, wk2124 + +**WeiKai Microelectronics** provides a family of UART & GPIO expansion chips +that interfaces to a micro-controller through SPI or I²C bus. + +The ESPHome ``WeiKai`` component supports the following WeiKai chips: + +- `WK2168-IQPG `__ +- `WK2132-ISSG `__ +- `WK2124-ISSG `__ +- `WK2204-IQNG `__ +- `WK2212-IQNG `__ + +It can also be used with evaluation board equipped with these chips, such as: + +- `WK2168 Chip Development Board `__ +- `WK2132 Chip Development Board `__ +- `DFROBOT Gravity: I²C to Dual UART Module `__ + +.. figure:: images/DFR0627.jpg + :align: center + +The features provided by the different WeiKai chips are described in the following table: + +.. list-table:: WeiKai chip's features + :header-rows: 1 + :width: 450px + :align: center + + * - Chip + - Bus + - UART + - GPIO + * - WK2132-ISSG + - S/I + - 2 + - + * - WK2212-IQNG + - S/I + - 2 + - 8 + * - WK2124-ISSG + - S + - 4 + - + * - WK2204-IQNG + - S/I + - 4 + - + * - WK2168-IQPG + - S/I + - 4 + - 8 + +As you can see most of the components can interface either through an I²C bus or a SPI bus, +they provide either 2 or 4 serial channels, and some provide 8 input/output pins. + +Each UART channel has two independent 256-byte FIFO hardware buffers to transmit and +receive and support data transmission rates up to 1 Mbps. +The baud rate and parity format of each UART channel can be configured independently. +However, the data bit length is fixed at 8. + +Utilizing the UART channels enables you to connect your UART devices, with each channel functioning +as a virtual UART bus for the connected component. + +The I/O pins of the WeiKai chips can be use as any of the other GPIO pins. +Any option accepting a :ref:`Pin Schema ` can theoretically +be used, but some more complicated components that do communication through +this I/O expander might not work. + +Connecting via an SPI bus +------------------------- + +The ``wk2132_spi``, ``wk2212_spi``, ``wk2204_spi``, ``wk2168_spi`` components allows +you to connect the WeiKai chip with ESPHome via a :ref:`SPI ` bus. + +You can connect several of these modules to a single SPI controller circuit effectively expanding +the number of hardware serial ports available. Each WeiKai chip needs to be selected +with a individual CS. + +Here is an example of configuration entry for a wk2168_spi component. For the other components +in the list just replace the name of the component and make sure you do not use more channels that the chip +can support (an error message will be generated otherwise). Note that for the ``WK2124-ISSG`` chip +you need to use ``wk2204_spi`` as the two chips are similar. + +.. code-block:: yaml + + wk2168_spi: + - id: wk2168_bridge_spi + cs_pin: 5 + uart: + - id: spi_uart_0 + channel: 0 + baud_rate: 128200 + parity: even + - id: spi_uart_1 + channel: 1 + baud_rate: 19200 + - id: spi_uart_2 + channel: 2 + baud_rate: 9600 + - id: spi_uart_3 + channel: 3 + baud_rate: 19200 + +Configuration variables: +************************ + +- **id** (**Required**, :ref:`config-id`): The id to use for this WeiKai component. +- **spi_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`SPI Component ` if you want + to use multiple SPI buses. +- **cs_pin** (**Required**, :ref:`Pin Schema `): The pin on the ESP that the chip select line + of the chip is connected to. +- **data_rate** (*Optional*): Set the data rate of the controller. One of ``80MHz``, ``40MHz``, ``20MHz``, ``10MHz``, + ``5MHz``, ``4MHz``, ``2MHz``, ``1MHz`` (default), ``200kHz``, ``75kHz`` or ``1kHz``. A numeric value in Hz can + alternatively be specified. +- **crystal** (*Optional*): The frequency in Hz of the crystal connected to the chip. + The default value is 14745600 Hz. +- **uart** (**Required**): The UART channels. + + - **id** (**Required**, :ref:`config-id`): The id to use for this UART channel. + - **channel** (**Required**): Unique channel number of this virtual UART. + Options: ``0`` to ``1`` or ``0`` to ``3`` depending on the model. + - **baud_rate** (**Required**): The baud rate of the UART channel. + - **parity** (*Optional*): The parity used on the UART channel. Options: ``NONE``, ``EVEN``, + ``ODD``. Defaults to ``NONE``. + - **stop_bits** (*Optional*): The number of stop bits to send. Options: ``1``, ``2``. + Defaults to ``1``. + +Connecting via an I²C bus +------------------------- + +The ``wk2132_i2c`` ``wk2212_i2c`` ``wk2204_i2c`` ``wk2168_i2c`` components allows you +to connect the WeiKai chip with ESPHome via an :ref:`I²C ` bus. +Up to four WeiKai chips can be connected to an I²C controller board, effectively expanding the +available hardware serial ports. The base addresses of these boards are defined by the +positions of two switches, A0 and A1, on the board. + +.. list-table:: WeiKai address selection + :header-rows: 1 + :width: 350px + :align: center + + * - I²C address + - A1 + - A0 + * - 0x10 - 0x17 + - 0 + - 0 + * - 0x30 - 0x37 + - 0 + - 1 + * - 0x50 - 0x57 + - 1 + - 0 + * - 0x70 - 0x77 + - 1 + - 1 + +.. important:: + + Note that the address is given as a **range** a not a number as you usually find on other I²C component. + Indeed due to a peculiar way of addressing the different internal registers each component actually occupy + 8 consecutive addresses. For example if the component base address is 0x10, it will occupy the addresses ranging from + 0x10 to 0x17 on the I²C bus. + + This is important to know if you want to connect other devices on the same I²C bus. + +Here is an example of configuration entry for a ``wk2168_i2c`` component. For the other components +just replace the name of the component and do not use more channels that the chip can +support (an error message will be generated in this case). + +.. code-block:: yaml + + wk2168_i2c: + - address: 0x70 + id: wk2168_bridge_i2c + uart: + - id: i2c_uart_0 + channel: 0 + baud_rate: 9600 + parity: even + - id: i2c_uart_1 + channel: 1 + baud_rate: 19200 + - id: i2c_uart_2 + channel: 2 + baud_rate: 9600 + - id: i2c_uart_3 + channel: 3 + baud_rate: 19200 + +Configuration variables: +************************ + +- **id** (**Required**, :ref:`config-id`): The id to use for this WeiKai component. +- **address** (*Optional*): The I²C address of this component. Defaults to ``0x10``. +- **i2c_id** (*Optional*): The I²C Bus ID. Defaults to the default i²c bus. +- **crystal** (*Optional*): The frequency in Hz of the crystal connected to the chip. + The default value is 14745600 Hz. +- **uart** (*Required*): The UART channels. + + - **id** (**Required**, :ref:`config-id`): The id to use for this UART channel. + - **channel** (**Required**): Unique channel number of this virtual UART. + Options: ``0`` to ``1`` or ``0`` to ``3`` depending on the model. + - **baud_rate** (**Required**): The baud rate of the UART channel. + - **parity** (*Optional*): The parity used on the UART channel. Options: ``NONE``, ``EVEN``, + ``ODD``. Defaults to ``NONE``. + - **stop_bits** (*Optional*): The number of stop bits to send. Options: ``1``, ``2``. + Defaults to ``1``. + +Using the GPIO pins +------------------- + +For the ``WK2212``, and ``WK2168`` it is possible to use the chip I/O pins as any of the other GPIO pins. +For example for a wk2168_spi chip: + +.. code-block:: yaml + + # individual binary_sensor inputs + binary_sensor: + - platform: gpio + name: "pin_0" + pin: + wk2168_spi: wk2168_bridge_spi + number: 0 + mode: + input: true + - platform: gpio + name: "pin_1" + pin: + wk2168_spi: wk2168_bridge_spi + number: 1 + mode: + input: true + inverted: true + + # Individual binary outputs + switch: + - platform: gpio + name: "pin_2" + pin: + wk2168_spi: wk2168_bridge_spi + number: 2 + mode: + output: true + - platform: gpio + name: "pin_3" + pin: + wk2168_spi: wk2168_bridge_spi + number: 3 + mode: + output: true + inverted: true + +Pin configuration variables: +**************************** + +- **wkxxxx_xxx** (**Required**, :ref:`config-id`): The id of the ``wkxxxx_xxx`` component for the pin. For + example ``wk2212_i2c: wk2168_bridge_spi`` +- **number** (**Required**): The pin number (``0`` to ``7``) +- **inverted** (*Optional*): If all read and written values should be treated as inverted. Defaults to ``false``. +- **mode** (*Optional*): A pin mode to set for the pin at. One of ``INPUT`` or ``OUTPUT``. Default to ``INPUT`` + +Performance considerations: +--------------------------- + +Bus speed +********* + +Please be aware that the communication between the WeiKai chips and the processor occurs on an external bus, +with a relatively low operating frequency. Therefore tasks such as checking the status of the chip's +registers or transferring bytes from the internal FIFOs to the processor may take time. + +To improve this situation, it is strongly recommended to increase the default bus frequency. + +- With a SPI bus this can be done on the WeiKai component by specifying ``data_rate``. For example: + +.. code-block:: yaml + + wk2168_spi: + - id: wk2168_bridge_spi + spi_id: spi_bus_id + cs_pin: 5 + data_rate: 4MHz + +- With an I²C bus this needs to be done on the ``i2c`` declaration and therefore this frequency will + apply to all components connected to this bus. + +.. code-block:: yaml + + i2c: + sda: 21 + scl: 22 + scan: true + id: bus_i2c + frequency: 800kHz + +Maximum Baud rate +***************** + +The maximum baud_rate is proportional to the crystal frequency. The following table +gives the maximum baud_rate at usual system clock: + +.. list-table:: maximum baud rate + :header-rows: 1 + :width: 300px + :align: center + + * - Clock + - Max Bd + * - 14,745,600 Hz + - 921,600 Bd + * - 11,059,200 Hz + - 691,200 Bd + * - 7,372,800 Hz + - 460,800 Bd + * - 3,686,400 Hz + - 230,400 Bd + * - 1,843,200 Hz + - 115,200 Bd + +If you try to use a baud rate superior to the maximum baud_rate an error will be displayed in the +log file and the baud rate will automatically be decreased. + +See Also +-------- + +- :ref:`i2c` +- :ref:`spi` +- :doc:`switch/gpio` +- :doc:`binary_sensor/gpio` +- :apiref:`weika/weika.h` +- :ghedit:`Edit` diff --git a/components/wiegand.rst b/components/wiegand.rst index ba6cb6998..7234006f6 100644 --- a/components/wiegand.rst +++ b/components/wiegand.rst @@ -5,7 +5,7 @@ Wiegand keypad and tag reader :description: Wiegand-standard key input and card/tag reader panel :image: wiegand.jpg -The ``wiegand`` component allows you to integrate Wiegand-standard key +The ``wiegand`` component allows you to integrate Wiegand-standard key input and card or tag reader panels in Home Assistant. .. figure:: ../images/wiegand.jpg @@ -16,9 +16,9 @@ input and card or tag reader panels in Home Assistant. .. note:: - Some keypads are preconfigured by the factory to act as Wiegand input - devices. In order to work with this component, they may need to - be reconfigured to act as *Wiegand 26 output* or *Wiegand 34 output* + Some keypads are preconfigured by the factory to act as Wiegand input + devices. In order to work with this component, they may need to + be reconfigured to act as *Wiegand 26 output* or *Wiegand 34 output* devices. @@ -30,8 +30,8 @@ Component # Example configuration entry wiegand: - id: mykeypad - d0: GPIO5 - d1: GPIO4 + d0: GPIOXX + d1: GPIOXX on_key: - lambda: ESP_LOGI("KEY", "received key %d", x); on_tag: @@ -44,19 +44,19 @@ Component Configuration variables: - **id** (*Optional*, :ref:`config-id`): Set the ID of this device for use in lambdas. -- **d0** (**Required**, :ref:`Pin Schema `): The pin where the ``D0`` output +- **d0** (**Required**, :ref:`Pin Schema `): The pin where the ``D0`` output of the Wiegand's interface connects. -- **d1** (**Required**, :ref:`Pin Schema `): The pin where the ``D1`` output +- **d1** (**Required**, :ref:`Pin Schema `): The pin where the ``D1`` output of the Wiegand's interface connects. Automations: ------------ -- **on_key** (*Optional*, :ref:`Automation `): An automation to perform +- **on_key** (*Optional*, :ref:`Automation `): An automation to perform when a key has been pressed on the pad. The key is in a variable called ``x``. -- **on_tag** (*Optional*, :ref:`Automation `): An automation to perform - when a Wiegand-compatible card or a tag has been read by the device. The tag code is +- **on_tag** (*Optional*, :ref:`Automation `): An automation to perform + when a Wiegand-compatible card or a tag has been read by the device. The tag code is in a variable called ``x``. - **on_raw** (*Optional*, :ref:`Automation `): An automation to perform for any data sent by the device. The value is in a variable called ``value``, the number of @@ -66,7 +66,7 @@ Automations: .. note:: - Automatic handling of multiple keys (e.g. PIN code entry) is possible with the + Automatic handling of multiple keys (e.g. PIN code entry) is possible with the the :ref:`Key Collector ` component. Keys 10 and 11 are ``*`` and ``#``. They might be labelled as ``ENT`` or ``ESC``, diff --git a/conf.py b/conf.py index 9c7797903..469f336c3 100644 --- a/conf.py +++ b/conf.py @@ -67,9 +67,9 @@ author = "ESPHome" # built documents. # # The short X.Y version. -version = "2024.5" +version = "2024.4" # The full version, including alpha/beta/rc tags. -release = "2024.5.0-dev" +release = "2024.4.2" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/cookbook/display_time_temp_oled.rst b/cookbook/display_time_temp_oled.rst index ea3317f12..0e1ecfaca 100644 --- a/cookbook/display_time_temp_oled.rst +++ b/cookbook/display_time_temp_oled.rst @@ -99,14 +99,14 @@ Note your ``address`` and ``model`` might be different, use the scan option to f .. code-block:: yaml i2c: - sda: D1 - scl: D2 + sda: GPIOXX + scl: GPIOXX scan: false display: - platform: ssd1306_i2c model: "SH1106 128x64" - reset_pin: D0 + reset_pin: GPIOXX address: 0x3C lambda: |- // Print "Mitt Smarta Hus" in top center. @@ -148,7 +148,7 @@ Below follows an example that replaces the "Mitt smarta hem" top printout with t display: - platform: ssd1306_i2c model: "SH1106 128x64" - reset_pin: D0 + reset_pin: GPIOXX address: 0x3C lambda: |- // Print "Alarm State: " in top center diff --git a/cookbook/garage-door.rst b/cookbook/garage-door.rst index 542bf4d14..92a3156e7 100644 --- a/cookbook/garage-door.rst +++ b/cookbook/garage-door.rst @@ -13,11 +13,11 @@ for a short period of time, the close/open action begins. switch: - platform: gpio - pin: D3 + pin: GPIOXX name: "Garage Door Open Switch" id: open_switch - platform: gpio - pin: D4 + pin: GPIOXX name: "Garage Door Close Switch" id: close_switch cover: diff --git a/cookbook/infostrip.rst b/cookbook/infostrip.rst index 1885882a0..e20060aa8 100644 --- a/cookbook/infostrip.rst +++ b/cookbook/infostrip.rst @@ -26,17 +26,9 @@ ESPHome configuration .. code-block:: yaml - esphome: - name: esp_infostrip - - esp8266: - board: d1_mini - - # TODO -> add your personal wifi, logging, api, ota settings here - uart: - rx_pin: 4 - tx_pin: 5 + rx_pin: GPIOXX + tx_pin: GPIOXX baud_rate: 9600 sensor: @@ -57,7 +49,7 @@ ESPHome configuration - platform: fastled_clockless chipset: WS2812B id: light_fastled - pin: D4 + pin: GPIOXX num_leds: 4 rgb_order: GRB name: "Infostrip" diff --git a/cookbook/lambda_magic.rst b/cookbook/lambda_magic.rst index 7f901283b..5aa4aaea6 100644 --- a/cookbook/lambda_magic.rst +++ b/cookbook/lambda_magic.rst @@ -13,7 +13,7 @@ These things don't need external or custom components, and show how powerful :re Display pages alternative ------------------------- -Some displays like :ref:`lcd-pcf8574` don't support pages natively, but you can easily implement them +Some displays like :ref:`lcd-pcf8574` don't support pages natively, but you can easily implement them using Lambdas: .. code-block:: yaml @@ -28,10 +28,10 @@ using Lambdas: case 1: it.print(0, 1, "Page1"); break; - case 2: + case 2: it.print(0, 1, "Page2"); break; - case 3: + case 3: it.print(0, 1, "Page3"); break; } @@ -104,8 +104,8 @@ Tested on both `arduino` and `esp-idf` platforms. Custom UART Text Sensor ----------------------- -Lots of devices communicate using the UART protocol. If you want to read -lines from uart to a Text Sensor you can do so using this code example. +Lots of devices communicate using the UART protocol. If you want to read +lines from uart to a Text Sensor you can do so using this code example. With this you can use automations or lambda to set switch or sensor states. @@ -115,17 +115,17 @@ With this you can use automations or lambda to set switch or sensor states. class UartReadLineSensor : public Component, public UARTDevice, public TextSensor { public: - UartReadLineSensor(UARTComponent *parent) : UARTDevice(parent) {} + UartReadLineSensor(UARTComponent *parent) : UARTDevice(parent) {} void setup() override { // nothing to do here - } + } int readline(int readch, char *buffer, int len) { static int pos = 0; int rpos; - + if (readch > 0) { switch (readch) { case '\n': // Ignore new-lines @@ -143,7 +143,7 @@ With this you can use automations or lambda to set switch or sensor states. } // No end of line has been found, so return -1. return -1; - } + } void loop() override { const int max_line_length = 80; @@ -157,7 +157,7 @@ With this you can use automations or lambda to set switch or sensor states. }; (Store this file in your configuration directory, for example ``uart_read_line_sensor.h``) - + And in YAML: .. code-block:: yaml @@ -166,15 +166,15 @@ And in YAML: esphome: includes: - uart_read_line_sensor.h - + logger: level: VERBOSE #makes uart stream available in esphome logstream baud_rate: 0 #disable logging over uart uart: id: uart_bus - tx_pin: D0 - rx_pin: D1 + tx_pin: GPIOXX + rx_pin: GPIOXX baud_rate: 9600 text_sensor: @@ -215,7 +215,7 @@ Then the switch uses the text sensor state to publish its own state. - uart.write: "\r*pow=on#\r" turn_off_action: - uart.write: "\r*pow=off#\r" - + interval: - interval: 10s then: @@ -228,13 +228,13 @@ Delaying Remote Transmissions The solution below handles the problem of RF frames being sent out by :doc:`/components/rf_bridge` (or :doc:`/components/remote_transmitter`) too quickly one after another when operating radio controlled -covers. The cover motors seem to need at least 600-700ms of silence between the individual code transmissions +covers. The cover motors seem to need at least 600-700ms of silence between the individual code transmissions to be able to recognize them. This can be solved by building up a queue of raw RF codes and sending them out one after the other with -(a configurable) delay between them. Delay is only added to the next commands coming from a list of -covers which have to be operated at once from Home Assistant. This is transparent to the system, which -will still look like they operate simultaneously. +(a configurable) delay between them. Delay is only added to the next commands coming from a list of +covers which have to be operated at once from Home Assistant. This is transparent to the system, which +will still look like they operate simultaneously. .. code-block:: yaml @@ -305,7 +305,7 @@ One Button Cover Control The configuration below shows how with a single button you can control the motion of a motorized cover by cycling between: open->stop->close->stop->... -In this example a :doc:`/components/cover/time_based` is used with the GPIO configuration of a Sonoff Dual R2. +In this example a :doc:`/components/cover/time_based` is used with the GPIO configuration of a Sonoff Dual R2. .. note:: diff --git a/custom/custom_component.rst b/custom/custom_component.rst index 5544f3aac..72e23baf9 100644 --- a/custom/custom_component.rst +++ b/custom/custom_component.rst @@ -1,20 +1,29 @@ Generic Custom Component ======================== +.. seo:: + :description: Instructions for setting up Custom C++ components with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. -This integration can be used to create generic custom components in ESPHome -using the C++ (Arduino) API. This integration should be used in cases where +.. warning:: + + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. + + +This component can be used to create generic custom components in ESPHome +using the C++ (Arduino) API. This component should be used in cases where none of ESPHome's abstraction layers (for example the "sensor", "binary sensor", -"switch", etc concepts) work well for your integration. +"switch", etc concepts) work well for your component. Please first read :doc:`/components/sensor/custom` guide, the same principles apply here. diff --git a/custom/i2c.rst b/custom/i2c.rst index 7b556a9ba..87940b8be 100644 --- a/custom/i2c.rst +++ b/custom/i2c.rst @@ -1,15 +1,23 @@ Custom I²C Device ================= +.. seo:: + :description: Instructions for setting up Custom C++ I2C devices with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. + +.. warning:: + + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. Lots of devices communicate using the I²C protocol. If you want to integrate a device into ESPHome that uses this protocol you can pretty much use almost diff --git a/custom/spi.rst b/custom/spi.rst index 1653a282c..6407d1d58 100644 --- a/custom/spi.rst +++ b/custom/spi.rst @@ -1,15 +1,23 @@ Custom SPI Device ================= +.. seo:: + :description: Instructions for setting up Custom C++ SPI devices with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. + +.. warning:: + + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. Lots of devices communicate using the SPI protocol. If you want to integrate a device into ESPHome that uses this protocol you can pretty much use almost diff --git a/custom/uart.rst b/custom/uart.rst index 57c52bcf0..c4426cc2d 100644 --- a/custom/uart.rst +++ b/custom/uart.rst @@ -1,15 +1,23 @@ Custom UART Device ================== +.. seo:: + :description: Instructions for setting up Custom C++ UART devices with ESPHome. + :image: language-cpp.svg + :keywords: C++, Custom + .. warning:: - Custom components are deprecated, not recommended for new configurations - and will be removed from ESPHome in a future release. - Please look at creating a real ESPHome component and "importing" it into your - configuration with :doc:`/components/external_components`. + Custom components are deprecated, not recommended for new configurations and will be removed from ESPHome in a + future release. Please look at creating a real ESPHome component and "importing" it into your configuration with + :doc:`/components/external_components`. - You can find some basic documentation on creating your own components - at :ref:`contributing_to_esphome`. + You can find some basic documentation on creating your own components at :ref:`contributing_to_esphome`. + +.. warning:: + + While we try to keep the ESPHome YAML configuration options as stable as possible, the ESPHome API is less + stable. If something in the APIs needs to be changed in order for something else to work, we will do so. Lots of devices communicate using the UART protocol. If you want to integrate a device into ESPHome that uses this protocol you can pretty much use almost @@ -51,8 +59,8 @@ And in YAML: uart: id: uart_bus - tx_pin: D0 - rx_pin: D1 + tx_pin: GPIOXX + rx_pin: GPIOXX baud_rate: 9600 custom_component: diff --git a/guides/automations.rst b/guides/automations.rst index f1cd253e6..7bfe0e3b5 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -18,18 +18,18 @@ Let's begin with an example to explain these concepts. Suppose you have this con switch: - platform: gpio - pin: GPIO3 + pin: GPIOXX name: "Living Room Dehumidifier" binary_sensor: - platform: gpio - pin: GPIO4 + pin: GPIOXX name: "Living Room Dehumidifier Toggle Button" With this file you can already perform some basic tasks. You can control the ON/OFF state of the dehumidifier in your living room from Home Assistant's front-end. But in many cases, controlling everything strictly from the frontend is quite a pain. That's why you have -decided to also install a simple push button next to the dehumidifier on pin GPIO4. +decided to also install a simple push button next to the dehumidifier on pin GPIOXX. A simple push on this button should toggle the state of the dehumidifier. You *could* write an automation to do this task in Home Assistant's automation engine, but @@ -46,13 +46,13 @@ For example, this configuration would achieve your desired behavior: switch: - platform: gpio - pin: GPIO3 + pin: GPIOXX name: "Living Room Dehumidifier" id: dehumidifier1 binary_sensor: - platform: gpio - pin: GPIO4 + pin: GPIOXX name: "Living Room Dehumidifier Toggle Button" on_press: then: @@ -418,7 +418,7 @@ All Conditions -------------- - :ref:`lambda ` -- :ref:`and ` / :ref:`or ` / :ref:`xor ` / :ref:`not ` +- :ref:`and ` / :ref:`or ` / :ref:`xor ` / :ref:`not ` - :ref:`for ` - :ref:`binary_sensor.is_on ` / :ref:`binary_sensor.is_off ` - :ref:`switch.is_on ` / :ref:`switch.is_off ` @@ -706,7 +706,7 @@ After this action the component will refresh at the original update_interval rat This will allow the component to resume automatic update at the defined interval. -This action also allows to change the update interval, calling it without suspend, +This action also allows to change the update interval, calling it without suspend, replace the poller directly. Please note that this only works with PollingComponent types and others will result in a @@ -724,7 +724,7 @@ compile error. # Change the poller interval on_...: then: - - component.resume: + - component.resume: id: my_component update_interval: 15s diff --git a/guides/configuration-types.rst b/guides/configuration-types.rst index 29e32a906..4f9ae825d 100644 --- a/guides/configuration-types.rst +++ b/guides/configuration-types.rst @@ -34,7 +34,7 @@ names :8000`` in your browser. @@ -211,7 +211,7 @@ documents establish the following character order for better consistency. switch: - platform: gpio name: "Relay #42" - pin: GPIO13 + pin: GPIOXX .. code-block:: yaml @@ -219,7 +219,7 @@ documents establish the following character order for better consistency. switch: - platform: gpio name: "Relay #42" - pin: GPIO13 + pin: GPIOXX .. note:: @@ -485,7 +485,7 @@ Let's leave what's written in those files for (2.), but for now you should also whenever a component is loaded, all the C++ source files in the folder of the component are automatically copied into the generated PlatformIO project. So you just need to add the C++ source files in the folder and the ESPHome core will copy them with no additional code required -by the integration developer. +by the component developer. .. note:: @@ -520,7 +520,7 @@ called ``CONFIG_SCHEMA``. An example of such a schema is shown below: This variable is automatically loaded by the ESPHome core and validated against. The underlying system ESPHome uses for this is `voluptuous `__. Going into how to validate is out of scope for this guide, but the best way to learn is to look -at examples of how similar integrations validate user input. +at examples of how similar components validate user input. A few point on validation: @@ -537,7 +537,7 @@ After the user input has been successfully validated, the last step of the Pytho is called: Code generation. As you may know, ESPHome converts the user's configuration into C++ code (you can see the generated -code under ``/src/main.cpp``). Each integration must define its own ``to_code`` method +code under ``/src/main.cpp``). Each component must define its own ``to_code`` method that converts the user input to C++ code. This method is also automatically loaded and invoked by the ESPHome core. An example of @@ -555,10 +555,10 @@ such a method can be seen below: Again, going into all the details of ESPHome code generation would be out-of-scope. However, ESPHome's code generation is 99% syntactic sugar - and again it's probably best to study other -integrations and just copy what they do. +components and just copy what they do. There's one important concept for the ``to_code`` method: coroutines with ``yield``. -First the problem that leads to coroutines: In ESPHome, integrations can declare (via ``cg.Pvariable``) and access variables +First the problem that leads to coroutines: In ESPHome, components can declare (via ``cg.Pvariable``) and access variables (``cg.get_variable()``) - but sometimes when one part of the code base requests a variable it has not been declared yet because the code for the component creating the variable has not run yet. @@ -575,14 +575,14 @@ If you do not call "add" a piece of code explicitly, it will not be added to the ********** Okay, the Python part of the codebase is now complete - now let's talk about the C++ part of -creating a new integration. +creating a new component. -The two major parts of any integration roughly are: +The two major parts of any component roughly are: - Setup Phase - Run Phase -When you create a new integration, your new component will inherit from :apiclass:`Component`. +When you create a new component, your new component will inherit from :apiclass:`Component`. That class has a special ``setup()`` method that will be called once to set up the component - at the time the ``setup()`` method is called, all the setters generated by the Python codebase have already run and the all fields are set for your class. @@ -590,7 +590,7 @@ have already run and the all fields are set for your class. The ``setup()`` method should set up the communication interface for the component and check if communication works (if not, it should call ``mark_failed()``). -Again, look at examples of other integrations to learn more. +Again, look at examples of other components to learn more. The next thing that will be called with your component is ``loop()`` (or ``update()`` for a :apiclass:`PollingComponent`). In these methods you should retrieve the latest data from the @@ -621,11 +621,11 @@ loader. These are: - ``AUTO_LOAD``: Automatically load a component if the user hasn't added it manually. - ``MULTI_CONF``: Mark this component to accept an array of configurations. If this is an integer instead of a boolean, validation will only permit the given number of entries. -- ``CONFLICTS_WITH``: Mark a list of components as conflicting with this integration. If the user +- ``CONFLICTS_WITH``: Mark a list of components as conflicting with this component. If the user has one of them in the config, a validation error will be generated. -- ``ESP_PLATFORMS``: Provide a list of allowed ESP types this integration works with. -- ``CODEOWNERS``: GitHub usernames or team names of people that are responsible for this integration. +- ``ESP_PLATFORMS``: Provide a list of allowed ESP types this component works with. +- ``CODEOWNERS``: GitHub usernames or team names of people that are responsible for this component. You should add at least your GitHub username here, as well as anyone who helped you to write code that is being included. @@ -663,8 +663,8 @@ Standard for the esphome-core codebase: like ``Wire`` there's a problem because then the component may not modular (i.e. not possible to create two instances of a component on one ESP) -- Integrations **must** use the provided abstractions like ``Sensor``, ``Switch`` etc. - Integration should specifically **not** directly access other components like for example +- Components **must** use the provided abstractions like ``sensor``, ``switch`` etc. + Components should specifically **not** directly access other components like for example publish to MQTT topics. - Implementations for new devices should contain reference links for the datasheet and other sample diff --git a/guides/diy.rst b/guides/diy.rst index ef0cac207..4254fa477 100644 --- a/guides/diy.rst +++ b/guides/diy.rst @@ -92,6 +92,7 @@ Custom Components & Code - `Custom esp32 media player and notifier `__ by :ghuser:`rananna` - `Blauberg recuperator S22 controller replacement `__ by :ghuser:`Benas09` - `Rheem Econet Water Heater and Furnace Controller `__ by `ESPHome-econet `__ +- `Garage Door Opener with position control using a relay and one or two reed sensors `__ by :ghuser:`tronikos` - `Medisana BS440 (and propably more scales) `__ by `bwynants `__ Sample Configurations @@ -115,7 +116,6 @@ Sample Configurations - `ESPHome config for Universal IR Remote ZJ-A1 (russian) `__ by `kvvhost `__ - `ESPHome Home Assistant Cheap Cat Feeder `__ by :ghuser:`rubengargar` - `ESPHome configs `__ by :ghuser:`nuttytree` -- `ESPHome Home Assistant stepper motor blinds/curtain `__ by :ghuser:`icarome` - `Control LG UD79-B monitor via UART `__ by :ghuser:`kquinsland` - `ESPHome AXA Remote 2 control `__ by :ghuser:`galagaking` - `ESPHome WF-DS01 TuyaMCU based dimmable bedside touch lamp `__ by :ghuser:`davet2001` diff --git a/guides/faq.rst b/guides/faq.rst index 9fc1ab43f..722ffdde2 100644 --- a/guides/faq.rst +++ b/guides/faq.rst @@ -21,11 +21,11 @@ Tips for using ESPHome binary_sensor: - platform: gpio id: button1 - pin: GPIO16 + pin: GPIOXX on_multi_click: !include { file: on-multi-click.yaml, vars: { id: 1 } } # inline syntax - platform: gpio id: button2 - pin: GPIO4 + pin: GPIOXX on_multi_click: !include # multi-line syntax file: on-multi-click.yaml @@ -73,48 +73,68 @@ Tips for using ESPHome .. |include| replace:: ``!include`` .. _include: https://www.home-assistant.io/docs/configuration/splitting_configuration/ -.. _esphome-flasher: +I can't get flashing over USB to work +------------------------------------- -I can't get flashing over USB to work. --------------------------------------- +.. _esphome-esptool: -ESPHome depends on the operating system the tool is running on to recognize -the ESP. This can sometimes fail. Common causes are that you did not install -the drivers (see note below) or you are trying to upload from a Docker container -and did not mount the ESP device into your container using ``--device=/dev/ttyUSB0``. - -Starting with ESPHome 1.9.0, the ESPHome suite provides -`esphome-flasher `__, a tool to flash ESPs over USB. +ESPHome depends on the operating system the tool is running on to recognize the ESP. This can sometimes fail. Common +causes are that you may not have the drivers installed (see :ref:`here `) or you are trying to +upload from a Docker container and did not mount the ESP device into your container using ``--device=/dev/ttyUSB0``. First, you need to get the firmware file to flash. For the Home Assistant add-on based -installs you can use the ``Manual download`` method (click ``Install`` in the overflow icon with the three dots -and then select ``Manual download``). For command line based installs you can access the +installs you can use the ``Manual download`` method of the Dashboard (click ``Install`` in the overflow icon with the three dots +and then select ``Manual download``). For direct esphome command line based installs you can access the file under ``//.pioenvs//firmware.bin``. -Then, install esphome-flasher by going to the `releases page `__ -and downloading one of the pre-compiled binaries. Open up the application and select the serial port -you want to flash to (on windows you can use the "device manager" to check if it's the right one). +Second, you need to put the ESP in :ref:`programming mode ` while connecting it to your computer. -.. figure:: images/esphomeflasher-ui.png - :align: center - :width: 80% -Select the firmware binary and finally press "Flash ESP". +Third, to flash a firmware file downloaded from Home Assistant add-on Dashboard, you can use: + +- `ESPHome Web `__ web-based installer, which requires a browser that supports WebSerial, like + Google Chrome or Microsoft Edge. Connect the board to your computer, make sure it's detected as a + :ref:`serial port `, and press **Connect**. Give the requested permission in the browser and in + the pop-up box that appears, select the serial device which connects to your ESP. Then press **Install**, and browse + for the binary file you downloaded from the Dashboard in the step above. Note that the file will be processed + locally, it won't be uploaded to any cloud service. +- *esptool* `from the GitHub repository `__, package from your distro or + install it yourself with ``pip install esptool`` (in case of Linux). + +Before using ``esptool``, make sure you know which serial port your programming adapter is connected to. In Linux use +the ``dmesg`` command afer you plug the device into the USB port to see the name of the newly detected serial port. +In Windows check the Device Manager to see if a new serial port appears when you plug it in and note the COM number. + +Erase flash: + +.. code-block:: bash + + esptool --port /dev/ttyUSB0 erase_flash + +Program flash with your firmware binary: + +.. code-block:: bash + + esptool --port /dev/ttyUSB0 write_flash 0x0 your_node_firmware.bin .. note:: - If the serial port is not showing up, you might not have the required drivers installed. - ESPs usually ship with one of these two UART chips: + If you're just seeing ``Connecting....____....`` on the screen and flashing fails: - * CP2102 (square chip): `driver `__ - * CH341: `driver `__ + - verify that the device name of the port has not changed while you were re-plugging it too fast (eg. changed + from ``/dev/ttyUSB0`` to ``/dev/ttyUSB1``). + - double check the UART wires are connected correctly if flashing using an external programmer (RX of programmer to + TX of the ESP and vice-versa). + - for some devices you need to keep ``GPIO0`` and ``GND`` connected at least until flashing has begun. + - for some devices you need to power-cycle in programming mode after erasing flash, they don't auto-reset. + - it also might be a sign that ESP is defective, damaged or otherwise cannot be programmed. -.. note:: + If you're in an RF noisy environment or your UART wires are a bit long, flashing can fail during transfer. Don't + worry, an ESP won't brick just because of that. Put it again in programming mode and flash with a reduced baudrate + for safer transfers: + + ``esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash 0x0 your_node_firmware.bin`` - If you're just seeing ``Connecting....____....`` on the screen and the flashing fails, that might - be a sign that the ESP is defect or cannot be programmed. Please double check the UART wires - are connected correctly if flashing using a USB to UART bridge. For some devices you need to - keep pressing the BOOT button until flashing has begun (ie. Geekcreit DOIT ESP32 DEVKIT V1). Help! Something's not working!! ------------------------------- @@ -271,7 +291,7 @@ Some steps that can help with the issue: of the networking code. For this reason, we advise using a lower log level for production purposes. - Related to this, seems to be the number of clients that are simultaneously connected to the native - API server on the device. These might for example be Home Assistant (via the ESPHome integration) and + API server on the device. These might for example be Home Assistant (via the ESPHome component) and the log viewer on the web dashboard. In production, you will likely only have a single connection from Home Assistant, making this less of an issue. But beware that attaching a log viewer might have impact. @@ -361,14 +381,16 @@ And a docker compose file looks like this: .. _docker-reference-notes: .. note:: - By default ESPHome uses mDNS to show online/offline state in the dashboard view. So for that feature to work you need to enable host networking mode. + By default ESPHome uses mDNS to show online/offline state in the dashboard view. So for that feature to work you + need to enable host networking mode. On MacOS the networking mode ("-net=host" option) doesn't work as expected. You have to use another way to launch the dashboard with a port mapping option and use alternative to mDNS to have the online/offline stat (see below) mDNS might not work if your Home Assistant server and your ESPHome nodes are on different subnets. - If your router supports Avahi (eg. OpenWRT or pfSense), you are able to get mDNS working over different subnets following the steps below: + If your router supports Avahi (eg. OpenWRT or pfSense), you are able to get mDNS working over different subnets + following the steps below: 1. Enable Avahi on both subnets (install Avahi modules on OpenWRT or pfSense). 2. Enable UDP traffic from ESPHome node's subnet to 224.0.0.251/32 on port 5353. @@ -381,15 +403,22 @@ And a docker compose file looks like this: .. _faq-notes_on_disabling_mdns: Notes on disabling mDNS ------------------------------------------------------------------------------- -Some of ESPHome's functionalities rely on mDNS, so naturally :doc:`disabling ` it will cause these features to stop working. -Generally speaking, disabling mDNS without setting a :ref:`static IP address ` (or a static DHCP lease) is bound to cause problems. This is due to the fact that mDNS is used to find the IP address of each ESPHome nodes. +----------------------- +Some of ESPHome's functionalities rely on mDNS, so naturally :doc:`disabling ` it will cause these +features to stop working. +Generally speaking, disabling mDNS without setting a :ref:`static IP address ` (or a static DHCP lease) +is bound to cause problems. This is due to the fact that mDNS is used to find the IP address of each ESPHome nodes. - You will not be able to use the node's hostname to ping, find it's IP address or connect to it. -- Automatic discovery in Home Assistant when using :doc:`native API ` relies on mDNS broadcast messages to detect presence of new ESPHome nodes. If you need to use the native API with mDNS disabled, then you will have to use a static IP address and manually add the ESPHome integration with the fixed IP address. +- Automatic discovery in Home Assistant when using :doc:`native API ` relies on mDNS broadcast + messages to detect presence of new ESPHome nodes. If you need to use the native API with mDNS disabled, then you will + have to use a static IP address and manually add the ESPHome component with the fixed IP address. -- Online status detection in ESPHome's dashboard by default uses mDNS, so disabling mDNS will cause the ESPHome dashboard to show the status of the nodes created without mDNS support to be always offline. Currently, this does not affect any functionality, however if you want to see the online/offline status you could configure ESPHome to ping each node instead. See the :ref:`notes in the Docker Reference section ` for more information. +- Online status detection in ESPHome's dashboard by default uses mDNS, so disabling mDNS will cause the ESPHome + dashboard to show the status of the nodes created without mDNS support to be always offline. Currently, this does not + affect any functionality, however if you want to see the online/offline status you could configure ESPHome to ping + each node instead. See the :ref:`notes in the Docker Reference section ` for more information. Can Configuration Files Be Recovered From The Device? ----------------------------------------------------- @@ -405,25 +434,37 @@ Always back up all your files! Why shouldn't I use underscores in my device name? -------------------------------------------------- -The top level ``name:`` field in your .yaml file defines the node name(/hostname) on the local network. According to `RFC1912 `_, underscore characters (``_``) in hostnames are not valid. In reality some local DNS/DHCP setups will be ok with underscores and some will not. If connecting via a static IP address, there will probably be no issues. In some cases, initial setup using an underscore works, but later the connection might fail when Home Assistant restarts or if you change router hardware. Recommendation: use hyphen (``-``) instead of underscore if you can. +The top level ``name:`` field in your .yaml file defines the node name(/hostname) on the local network. According to +`RFC1912 `_, underscore characters (``_``) in hostnames are not valid. +In reality some local DNS/DHCP setups will be ok with underscores and some will not. If connecting via a static IP +address, there will probably be no issues. In some cases, initial setup using an underscore works, but later the +connection might fail when Home Assistant restarts or if you change router hardware. +Recommendation: use hyphen (``-``) instead of underscore if you can. -Important: follow these `instructions `_ to use the ``use_address`` parameter when renaming a live device, as the connection to an existing device will only work with the old name until the name change is complete. +Important: follow these `instructions `_ to use the +``use_address`` parameter when renaming a live device, as the connection to an existing device will only +work with the old name until the name change is complete. .. _strapping-warnings: Why am I getting a warning about strapping pins? --------------------------------------------------- +------------------------------------------------ -The ESP chips have special "strapping pins" that are read during the bootup procedure and determine how it boots up. They define whether the ESP boots into a special "flashing mode" or normal boot and a couple of other internal settings. +The ESP chips have special "strapping pins" that are read during the bootup procedure and determine how it boots up. +They define whether the ESP boots into a special "flashing mode" or normal boot and a couple of other internal settings. If an external pullup/down changes the configured voltage levels boot failures or hard to diagnose issues can happen. -While the use of them in software is not a problem, if there's something attached to the pins (particularly if they're not floating during the bootup) you may run into problems. -It's recommended to avoid them unless you have a pressing need to use them and you have reviewed the expected boot voltage levels of these pins from the ESP datasheet. +While the use of them in software is not a problem, if there's something attached to the pins (particularly if they're +not floating during the bootup) you may run into problems. +It's recommended to avoid them unless you have a pressing need to use them and you have reviewed the expected boot +voltage levels of these pins from the ESP datasheet. -Some development boards connect GPIO 0 to a button, often labeled "boot". Holding this button while the ESP is turning on will cause it to go into bootloader mode. Once the ESP is fully booted up, this button can be used as a normal input safely. +Some development boards connect GPIO 0 to a button, often labeled "boot". Holding this button while the ESP is +turning on will cause it to go into bootloader mode. Once the ESP is fully booted up, this button can be used +as a normal input safely. -Strapping pins should be safe to use as outputs if they are *only* connected to other devices that have hi-impedance inputs -with no pull-up or pull-down resistors. Note that I2C clock and data lines *do* have pull-up resistors and are not -safe on strapping pins. +Strapping pins should be safe to use as outputs if they are *only* connected to other devices that have hi-impedance +inputs with no pull-up or pull-down resistors. Note that I2C clock and data lines *do* have pull-up resistors and are +not safe on strapping pins. If you are absolutely sure that your use of strapping pins is safe, and want to suppress the warning, you can add ``ignore_strapping_warning: true`` to the relevant pin configurations. diff --git a/guides/getting_started_command_line.rst b/guides/getting_started_command_line.rst index 618bee4d2..9cff10fa3 100644 --- a/guides/getting_started_command_line.rst +++ b/guides/getting_started_command_line.rst @@ -40,7 +40,7 @@ If you want to use `docker-compose` instead, here's a sample file: privileged: true network_mode: host environment: - - USERNAME=test + - USERNAME=test - PASSWORD=ChangeMe .. note:: @@ -107,7 +107,7 @@ GPIO switch ` to our app. switch: - platform: gpio name: "Living Room Dehumidifier" - pin: 5 + pin: GPIO5 The configuration format should hopefully immediately seem similar to you. ESPHome has tried to keep it as close to Home Assistant’s @@ -144,10 +144,15 @@ to your docker command to map a local USB device. Docker on Mac will not be able docker run --rm --privileged -v "${PWD}":/config --device=/dev/ttyUSB0 -it ghcr.io/esphome/esphome run livingroom.yaml -Now when you go to the Home Assistant "Integrations" screen (under "Configuration" panel), you + +.. note:: + + Alternatively, you can flash the binary using :ref:`ESPHome Web or esptool `. + +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). -Alternatively, you can manually add the device by clicking "CONFIGURE" on the ESPHome integration -and entering ".local" as the host. +Alternatively, you can manually add the device by clicking **CONFIGURE** on the ESPHome integration +and entering ``.local`` as the host. .. figure:: /components/switch/images/gpio-ui.png :align: center @@ -186,7 +191,7 @@ for docker you need to supply an additional parameter: .. code-block:: bash - esphome livingroom.yaml run + esphome run livingroom.yaml # On docker docker run --rm -v "${PWD}":/config -it ghcr.io/esphome/esphome run livingroom.yaml @@ -219,8 +224,8 @@ To start the ESPHome dashboard, simply start ESPHome with the following command .. code-block:: bash # Install dashboard dependencies - pip install tornado esptool - esphome dashboard config/ + pip install tornado esptool\ + esphome dashboard config # On Docker, host networking mode is required for online status indicators docker run --rm --net=host -v "${PWD}":/config -it ghcr.io/esphome/esphome diff --git a/guides/getting_started_hassio.rst b/guides/getting_started_hassio.rst index 32aad9a36..e1da95fa1 100644 --- a/guides/getting_started_hassio.rst +++ b/guides/getting_started_hassio.rst @@ -101,7 +101,7 @@ to the configuration like this: switch: - platform: gpio name: "Living Room Dehumidifier" - pin: 5 + pin: GPIO5 In above example, we're simply adding a switch that's called "Living Room Dehumidifier" (could control anything really, for example lights) and is connected to the pin ``GPIO5``. diff --git a/guides/images/esphomeflasher-ui.png b/guides/images/esphomeflasher-ui.png deleted file mode 100644 index c547fdc69..000000000 Binary files a/guides/images/esphomeflasher-ui.png and /dev/null differ diff --git a/guides/made_for_esphome.rst b/guides/made_for_esphome.rst index 7079dcf5b..48d2828ac 100644 --- a/guides/made_for_esphome.rst +++ b/guides/made_for_esphome.rst @@ -37,7 +37,9 @@ For all projects - Your project supports adoption via the ``dashboard_import`` feature of ESPHome (see :doc:`Sharing `). In particular: - There are **no** references to secrets or passwords - Network configuration must assume defaults (no static IPs or DNS configured) - - All configuration is contained within a single YAML file + - It **must** compile successfully without any user changes after adopting it. + - All configuration is contained within a single YAML file. Fully remote packages are permitted if using ``import_full_config: true``. + - Your product name cannot contain **ESPHome** except in the case of *ending with* **for ESPHome** When your project matches all requirements of the Made for ESPHome program, diff --git a/guides/migrate_espeasy.rst b/guides/migrate_espeasy.rst index b0f954d63..1524da252 100644 --- a/guides/migrate_espeasy.rst +++ b/guides/migrate_espeasy.rst @@ -19,7 +19,7 @@ file. Then, generate and download the binary: .. figure:: images/download_binary.png -- **Using the command line**: run ``esphome livingroom.yaml compile`` (replacing +- **Using the command line**: run ``esphome compile livingroom.yaml`` (replacing ``livingroom.yaml`` with your configuration file of course) and navigate to the ``/.pioenvs//`` folder. There you will find a ``firmware.bin`` file, this is the binary you will upload. diff --git a/guides/migrate_espurna.rst b/guides/migrate_espurna.rst index 09505a24e..ef7dc8f12 100644 --- a/guides/migrate_espurna.rst +++ b/guides/migrate_espurna.rst @@ -20,7 +20,7 @@ file. Then, generate and download the binary: .. figure:: images/download_binary.png -- **Using the command line**: run ``esphome livingroom.yaml compile`` (replacing +- **Using the command line**: run ``esphome compile livingroom.yaml`` (replacing ``livingroom.yaml`` with your configuration file of course) and navigate to the ``/.pioenvs//`` folder. There you will find a ``firmware.bin`` file, this is the binary you will upload. diff --git a/guides/physical_device_connection.rst b/guides/physical_device_connection.rst index 53031aaa4..bc4b91487 100644 --- a/guides/physical_device_connection.rst +++ b/guides/physical_device_connection.rst @@ -29,31 +29,66 @@ component `_ to install software remotely. Programming a ESP-based device is done by connecting the serial port on the ESP8266/ESP32 to your computer through a USB to serial adapter. Some devices -have adapter built into the circuit board, in which case things are a bit easier. +have adapter built into the circuit board (and some even have the programmer +embedded in the MCU, in which case things are a bit easier. + +In case you use an external serial programmer connected to RX and TX of the ESP, choose one based +on CH340 as it's the most reliable and the cheapest one to use for flashing. Programmers based on +CP2102 or PL2303 are compatible with many devices, but using an external 3.3V supply might be +necessary for them. + +.. _esphome-phy-con-drv: + +Plug in the board or the serial programmer into a free USB port and check if it has been properly detected +by your computer. The firmware programming tools use a serial interface to communicate with your device. +On Windows these interfaces are named ``COM1``, ``COM2``, etc. and on Linux they are named ``/dev/ttyUSB0``, +``/dev/ttyACM1``, etc. .. note:: - If the serial port is not showing up, you might not have the required - drivers installed. The model number you need is engraved on the chip - connected to the USB port, or in the store listing. These drivers work for - most ESP devices: + If it's not showing up as a serial port, you might not have the required drivers + installed. The model number you need is engraved on the chip connected to the USB port. + ESPs and programmers usually ship with one of these UART chips: - * CP2102 (square chip): `driver - `__ - * CH341: `driver - `__ + * CH34x: `driver `__ + * CP2102: `driver `__ + * PL2303: `driver `__ With the exception of the situation where you have a USB port, you need to make five electrical connections to program an ESP-based board: -- +3.3V, or occasionally +5.0V -- GND, or ground -- TX -- RX -- IO0, used to place the board into programming mode. This is often a button - that you need to hold down while connecting the power (+3.3V). +- ``+3.3V``, or occasionally ``+5.0V`` +- ``GND``, or ground +- ``TX`` of programmer to ``RX`` of the ``ESP`` +- ``RX`` of programmer to ``TX`` of the ``ESP`` +- ``IO0``, used to place the board into programming mode. This is often a button + that you need to hold down while connecting the power (``+3.3V``). -RX and TX are frequently swapped. If programming your board doesn't work the +The power supplied to the device is one of the most important elements for both flashing +the device and for stable operation. You must ensure that the device receives sufficient +power (current AND appropriate voltage level) to properly flash the firmware on the device. +When using an external ``3.3V`` supply, ensure the ground (``GND``) of both are connected together, +this ensures a common ground. A PC power supply can be a good source for ``3.3V`` DC power. + +.. note:: + + Some adapters can be switched between ``3.3V`` and ``5V`` for the data pins, but still provide 5V on the power pin which will irreparably destroy your device. You **MUST** make sure the data (``RX`` and ``TX``) and ``VCC`` pins are set for ``3.3V``. + +ESP needs to be put into programming mode or flash mode before the firmware can be uploaded. This is +done by connecting ``GPIO0`` pin to ``GND`` while the chip is booting. + +.. _esphome-phy-con-prg: + +To put the ESP into programming mode: + +* Disconnect the USB connection of your board or serial programmer from the computer (to power off your ESP) +* Bridge ``GPIO0`` and ``GND`` (by pressing the on-board button or connection with a wire) +* Connect the board or serial programmer to your computer (ensuring ESP powers up) +* After a few seconds disconnect ``GPIO0`` from ``GND`` (release button or remove the wire connection). On devices that do not provide the ``GPIO0`` connected button, it may be easier to leave the wired bridge in place throughout the entire flashing process (erase & upload). Doing so will not create any problems. After the firmware is uploaded successfully, remove the bridge. This allows the device to boot normally. + +You may need to power-cycle the ESP between erasing and uploading the firmware, this can be done by disconnecting and reconnecting, of course with ``GPIO0`` and ``GND`` still connected to each other. + +``RX`` and ``TX`` can be sometimes swapped. If programming your board doesn't work the first time, try flipping the wires connected to those pins before trying again. .. warning:: diff --git a/guides/supporters.rst b/guides/supporters.rst index 901329910..1c9098e51 100644 --- a/guides/supporters.rst +++ b/guides/supporters.rst @@ -122,6 +122,7 @@ Contributors - `arunderwood (@arunderwood) `__ - `Arya (@Arya11111) `__ - `aschmitz (@aschmitz) `__ +- `Anton Sergunov (@asergunov) `__ - `Borys Pierov (@ashald) `__ - `Ash McKenzie (@ashmckenzie) `__ - `ashp8i (@ashp8i) `__ @@ -228,6 +229,7 @@ Contributors - `bwynants (@bwynants) `__ - `c0ffeeca7 (@c0ffeeca7) `__ - `Captain Haddock (@ca-haddock) `__ +- `Caleb Gabbie (@calebgab) `__ - `Cal Howard (@calhoward) `__ - `callacomp (@callacomp) `__ - `Callum Gare (@callumgare) `__ @@ -258,6 +260,7 @@ Contributors - `cg089 (@cg089) `__ - `Audric Schiltknecht (@chemicalstorm) `__ - `Charles Johnson (@ChemicalXandco) `__ +- `chiahsing (@chiahsing) `__ - `chris-jennings (@chris-jennings) `__ - `Chris (@chrismaki) `__ - `Christoph Wagner (@Christoph-Wagner) `__ @@ -318,6 +321,7 @@ Contributors - `Daniel Bjørnbakk (@danibjor) `__ - `Daniel Baulig (@DanielBaulig) `__ - `danielionutmuresan (@danielionutmuresan) `__ +- `Daniel Kent (@danielkent-net) `__ - `Daniel Kucera (@danielkucera) `__ - `Daniel O'Connor (@DanielO) `__ - `Daniel Rheinbay (@danielrheinbay) `__ @@ -349,7 +353,6 @@ Contributors - `Davy Landman (@DavyLandman) `__ - `Dawid Cieszyński (@dawidcieszynski) `__ - `Darren Tucker (@daztucker) `__ -- `Donovan Baarda (@dbaarda) `__ - `David Buezas (@dbuezas) `__ - `dckiller51 (@dckiller51) `__ - `Daniel Correa Lobato (@dclobato) `__ @@ -390,9 +393,7 @@ Contributors - `Marcos Pérez Ferro (@djwmarcx) `__ - `Dan Mannock (@dmannock) `__ - `Dmitriy Lopatko (@dmitriy5181) `__ -- `Farzad E. (@dnetguru) `__ - `Tristan Rowley (@doctea) `__ -- `DrZoid (@docteurzoidberg) `__ - `DominikBitzer (@DominikBitzer) `__ - `Dominik (@DomiStyle) `__ - `Don Burch (@donburch888) `__ @@ -432,6 +433,7 @@ Contributors - `Ettore Beltrame (@E440QF) `__ - `Earle F. Philhower, III (@earlephilhower) `__ - `Ermanno Baschiera (@ebaschiera) `__ +- `ebw44 (@ebw44) `__ - `Robert Resch (@edenhaus) `__ - `Niclas Larsson (@edge90) `__ - `EdJoPaTo (@EdJoPaTo) `__ @@ -451,8 +453,8 @@ Contributors - `Elkropac (@Elkropac) `__ - `Elliot Wood (@elliot-wood) `__ - `Eduard Llull (@ellull) `__ +- `Joakim Plate (@elupus) `__ - `Andrew Elwell (@Elwell) `__ -- `EmbeddedDevver (@EmbeddedDevver) `__ - `EmmanuelLM (@EmmanuelLM) `__ - `Emory Dunn (@emorydunn) `__ - `Eric van Blokland (@Emrvb) `__ @@ -467,12 +469,13 @@ Contributors - `Eric Hiller (@erichiller) `__ - `Ernst Klamer (@Ernst79) `__ - `Eduardo Roldan (@eroldan) `__ +- `ervede (@ervede) `__ - `escoand (@escoand) `__ -- `Eric Severance (@esev) `__ - `esphomebot (@esphomebot) `__ - `espressif2022 (@espressif2022) `__ - `Daniel Dunn (@EternityForest) `__ - `EtienneMD (@EtienneMD) `__ +- `etzisim (@etzisim) `__ - `Evan Coleman (@evandcoleman) `__ - `Clemens Kirchgatterer (@everslick) `__ - `Everything Smart Home (@EverythingSmartHome) `__ @@ -482,11 +485,8 @@ Contributors - `f0rdprefect (@f0rdprefect) `__ - `Fabian Affolter (@fabaff) `__ - `Fabian (@Fabian-Schmidt) `__ -- `Fabian Muehlberger (@fabianmuehlberger) `__ -- `Federico Ariel Castagnini (@facastagnini) `__ - `C W (@fake-name) `__ - `Fabian Bläse (@fblaese) `__ -- `Fabian Berthold (@fbrthld) `__ - `F.D.Castel (@fdcastel) `__ - `Sun Xiangyu (@feizi) `__ - `felixlungu (@felixlungu) `__ @@ -528,6 +528,7 @@ Contributors - `Aljaž Srebrnič (@g5pw) `__ - `Alex Hermann (@gaaf) `__ - `Gabe Cook (@gabe565) `__ +- `Gábor Poczkodi (@gabest11) `__ - `gazoodle (@gazoodle) `__ - `gcopeland (@gcopeland) `__ - `Greg Cormier (@gcormier) `__ @@ -582,6 +583,7 @@ Contributors - `Ha Thach (@hathach) `__ - `Cong Hoang Nguyen (@HcNguyen111) `__ - `hcoohb (@hcoohb) `__ +- `helgek (@helgek) `__ - `hellotomtom (@hellotomtom) `__ - `Jimmy Hedman (@HeMan) `__ - `Hemi03 (@Hemi03) `__ @@ -630,6 +632,7 @@ Contributors - `Fredrik Gustafsson (@jagheterfredrik) `__ - `jakehdk (@jakehdk) `__ - `Jake Shirley (@JakeShirley) `__ +- `Jonathan Kollasch (@jakllsch) `__ - `jakub-medrzak (@jakub-medrzak) `__ - `James Hirka (@jameshirka) `__ - `James Lakin (@jamesorlakin) `__ @@ -725,7 +728,6 @@ Contributors - `AngeloGioacchino Del Regno (@kholk) `__ - `Kilowatt (@Kilowatt-W) `__ - `Kip (@kipwittchen) `__ -- `Ed (@kixtarter) `__ - `Klaas Schoute (@klaasnicolaas) `__ - `Klarstein (@Klarstein) `__ - `Marcus Klein (@kleini) `__ @@ -750,7 +752,6 @@ Contributors - `Ludovic BOUÉ (@lboue) `__ - `lcavalli (@lcavalli) `__ - `Craig Fletcher (@leakypixel) `__ -- `Dominik Wagenknecht (@LeDominik) `__ - `Benny de Leeuw (@leeuwte) `__ - `Thayne (@Legot) `__ - `Leonardo La Rocca (@leoli51) `__ @@ -849,12 +850,14 @@ Contributors - `Merlin Schumacher (@merlinschumacher) `__ - `Martin Flasskamp (@MFlasskamp) `__ - `Michael Hoffmann (@mghoffmann) `__ +- `Michaël Guay-Lambert (@mguaylam) `__ - `Marcel Hetzendorfer (@mhetzi) `__ - `M Hightower (@mhightower83) `__ - `Michael Muré (@MichaelMure) `__ - `Michal Fapso (@michalfapso) `__ - `Michał (@michau-krakow) `__ - `Michel Munzert (@michelde) `__ +- `michlann (@michlann) `__ - `micw (@micw) `__ - `Pauline Middelink (@middelink) `__ - `Joel Midstjärna (@midstar) `__ @@ -879,7 +882,9 @@ Contributors - `Moriah Morgan (@moriahmorgan) `__ - `moritzj29 (@moritzj29) `__ - `Chris Laplante (@mostthingsweb) `__ +- `Michael P. Flaga (@mpflaga) `__ - `MrEditor97 (@mreditor97) `__ +- `MRemy2 (@MRemy2) `__ - `Mariusz Kryński (@mrk-its) `__ - `Michael Davidson (@MrMDavidson) `__ - `mrred2k (@mrred2k) `__ @@ -937,6 +942,7 @@ Contributors - `nldroid (@nldroid) `__ - `Niccolò Maggioni (@nmaggioni) `__ - `nmeachen (@nmeachen) `__ +- `David Friedland (@nohat) `__ - `Álvaro Fernández Rojas (@Noltari) `__ - `Łukasz Śliwiński (@nonameplum) `__ - `JJ (@notjj) `__ @@ -997,6 +1003,7 @@ Contributors - `Peter Galantha (@peterg79) `__ - `Peter Polacek (@PeterPolacek) `__ - `Peter Kieser (@pfak) `__ +- `Lee (@phatone007) `__ - `Philippe Delodder (@phdelodder) `__ - `Philipp Helo Rehs (@Phhere) `__ - `philbowers (@philbowers) `__ @@ -1015,6 +1022,7 @@ Contributors - `Jan Pluskal (@pluskal) `__ - `DK (@poldim) `__ - `poloswiss (@poloswiss) `__ +- `polyfloyd (@polyfloyd) `__ - `Pontus Oldberg (@PontusO) `__ - `poptix (@poptix) `__ - `Peter Provost (@PProvost) `__ @@ -1030,6 +1038,7 @@ Contributors - `Pascal Vizeli (@pvizeli) `__ - `Alex (@pxe-la) `__ - `[pʲɵs] (@pyos) `__ +- `Peter Zich (@pzich) `__ - `Qc (@qc24) `__ - `Quinn Casey (@qcasey) `__ - `qianh-wan (@qianh-wan) `__ @@ -1084,12 +1093,14 @@ Contributors - `Jérôme W. (@RomRider) `__ - `roscoegray (@roscoegray) `__ - `rotarykite (@rotarykite) `__ +- `Roving Ronin (@Roving-Ronin) `__ - `Robert Paskowitz (@rpaskowitz) `__ - `Rajan Patel (@rpatel3001) `__ - `Bob Perciaccante (@rperciaccante) `__ - `rradar (@rradar) `__ - `rspaargaren (@rspaargaren) `__ - `rsumner (@rsumner) `__ +- `Romain TORRENTE (@rtorrente) `__ - `@RubenKelevra (@RubenKelevra) `__ - `Ruben van Dijk (@RubenNL) `__ - `RubyBailey (@RubyBailey) `__ @@ -1115,6 +1126,7 @@ Contributors - `scamiv (@scamiv) `__ - `Nils Schulte (@Schnilz) `__ - `Wolle (@schreibfaul1) `__ +- `Scobber (@Scobber) `__ - `Ville Skyttä (@scop) `__ - `Dan (@ScrewLooseDan) `__ - `Sean True (@seantrue) `__ @@ -1147,6 +1159,7 @@ Contributors - `Niklas Wagner (@Skaronator) `__ - `Brian Slesinsky (@skybrian) `__ - `Jordan W. Cobb (@skykingjwc) `__ +- `slimeinacloak (@slimeinacloak) `__ - `Sebastian Lövdahl (@slovdahl) `__ - `smischny (@smischny) `__ - `John Mueller (@softplus) `__ @@ -1294,6 +1307,7 @@ Contributors - `WallyCZ (@WallyCZ) `__ - `walzing (@walzing) `__ - `warpzone (@warpzone) `__ +- `Warwick Bruce Chapman (@warwickchapman) `__ - `Wauter (@Wauter) `__ - `WeekendWarrior1 (@WeekendWarrior1) `__ - `Thomas Aldrian (@Weissnix4711) `__ @@ -1310,6 +1324,7 @@ Contributors - `Artur 'Wodor' Wielogorski (@wodor) `__ - `Rick van Hattem (@wolph) `__ - `workingmanrob (@workingmanrob) `__ +- `Dawid Wróbel (@wrobelda) `__ - `Sven Serlier (@wrt54g) `__ - `Wolfgang Tremmel (@wtremmel) `__ - `Jiangang Wu (@wujiangang) `__ @@ -1331,9 +1346,10 @@ Contributors - `Brynley McDonald (@ZephireNZ) `__ - `Stefan Goethals (@zipkid) `__ - `zivillian (@zivillian) `__ +- `zry98 (@zry98) `__ - `Zack Barett (@zsarnett) `__ - `Zsolt Zsiros (@ZsZs73) `__ - `Christian Zufferey (@zuzu59) `__ - `Zynth-dev (@Zynth-dev) `__ -*This page was last updated April 4, 2024.* +*This page was last updated April 30, 2024.* diff --git a/images/graphical_display_menu.jpg b/images/graphical_display_menu.jpg deleted file mode 100644 index d224e96a8..000000000 Binary files a/images/graphical_display_menu.jpg and /dev/null differ diff --git a/images/graphical_display_menu.png b/images/graphical_display_menu.png new file mode 100644 index 000000000..9848f835b Binary files /dev/null and b/images/graphical_display_menu.png differ diff --git a/images/wk2168.jpg b/images/wk2168.jpg new file mode 100644 index 000000000..284699c93 Binary files /dev/null and b/images/wk2168.jpg differ diff --git a/index.rst b/index.rst index 31d25bc6b..9af5a24d3 100644 --- a/index.rst +++ b/index.rst @@ -121,41 +121,113 @@ ESPHome is a system to control your microcontrollers by simple yet powerful conf .. _devices: -Platforms ---------- +Supported Microcontrollers +-------------------------- .. imgtable:: - ESP8266, components/esp8266, esp8266.svg ESP32, components/esp32, esp32.svg + ESP8266, components/esp8266, esp8266.svg RP2040, components/rp2040, rp2040.svg BK72xx, components/libretiny, bk72xx.svg RTL87xx, components/libretiny, rtl87xx.svg -Core Components ---------------- +Microcontroller Peripherals +--------------------------- + +Peripherals which directly support the operation of the microcontroller's processor(s). + +.. imgtable:: + + PSRAM, components/psram, psram.svg + Deep Sleep, components/deep_sleep, hotel.svg, dark-invert + +ESPHome Components +------------------ + +ESPHome-specific components or components supporting ESPHome device provisioning post-installation. .. imgtable:: Core, components/esphome, cloud-circle.svg, dark-invert - PSRAM, components/psram, psram.svg - WiFi, components/wifi, network-wifi.svg, dark-invert - Network, components/network, network-wifi.svg, dark-invert - - I²C Bus, components/i2c, i2c.svg - SPI Bus, components/spi, spi.svg - UART Bus, components/uart, uart.svg - CAN Bus, components/canbus, canbus.svg - - MQTT, components/mqtt, mqtt.png - OTA Updates, components/ota, system-update.svg, dark-invert - Logger, components/logger, file-document-box.svg, dark-invert - Web Server, components/web_server, http.svg, dark-invert - - Native API, components/api, server-network.svg, dark-invert - Power Supply, components/power_supply, power.svg, dark-invert - Deep Sleep, components/deep_sleep, hotel.svg, dark-invert + Captive Portal, components/captive_portal, wifi-strength-alert-outline.svg, dark-invert + Copy, components/copy, content-copy.svg, dark-invert + Demo, components/demo, description.svg, dark-invert External Components, components/external_components, external_components.svg, dark-invert + Improv via BLE, components/esp32_improv, improv.svg, dark-invert + Improv via Serial, components/improv_serial, improv.svg, dark-invert + +Network Hardware +---------------- + +.. imgtable:: + + WiFi, components/wifi, network-wifi.svg, dark-invert + ESP32 Ethernet, components/ethernet, ethernet.svg, dark-invert + +Network Protocols +----------------- + +.. imgtable:: + + Network Core, components/network, server-network.svg, dark-invert + Native API, components/api, server-network.svg, dark-invert + MQTT, components/mqtt, mqtt.png + HTTP Request, components/http_request, connection.svg, dark-invert + mDNS, components/mdns, radio-tower.svg, dark-invert + WireGuard, components/wireguard, wireguard_custom_logo.svg + +Bluetooth/BLE +------------- + +.. imgtable:: + + ESP32 BLE Beacon, components/esp32_ble_beacon, bluetooth.svg, dark-invert + ESP32 BLE Client, components/ble_client, bluetooth.svg, dark-invert + ESP32 BLE Tracker, components/esp32_ble_tracker, bluetooth.svg, dark-invert + Bluetooth Proxy, components/bluetooth_proxy, bluetooth.svg, dark-invert + Improv via BLE, components/esp32_improv, improv.svg, dark-invert + +Management and Monitoring +------------------------- + +.. imgtable:: + + Debug, components/debug, bug-report.svg, dark-invert + Logger, components/logger, file-document-box.svg, dark-invert + OTA Updates, components/ota, system-update.svg, dark-invert + Prometheus, components/prometheus, prometheus.svg + Web Server, components/web_server, http.svg, dark-invert + ESP32 Camera Web Server, components/esp32_camera_web_server, camera.svg, dark-invert + +Hardware Peripheral Interfaces/Busses +------------------------------------- + +.. imgtable:: + + CAN Bus, components/canbus, canbus.svg + I²C Bus, components/i2c, i2c.svg + I²S Audio, components/i2s_audio, i2s_audio.svg + SPI Bus, components/spi, spi.svg + UART, components/uart, uart.svg + +I/O Expanders/Multiplexers +-------------------------- + +.. imgtable:: + + MAX6956 - I²C Bus, components/max6956, max6956.jpg + MCP230XX - I²C Bus, components/mcp230xx, mcp230xx.svg + MCP23SXX - SPI Bus, components/mcp23Sxx, mcp230xx.svg + PCA6416A, components/pca6416a, pca6416a.svg + PCA9554, components/pca9554, pca9554a.jpg + PCF8574, components/pcf8574, pcf8574.jpg + SN74HC165, components/sn74hc165, sn74hc595.jpg + SN74HC595, components/sn74hc595, sn74hc595.jpg + SX1509, components/sx1509, sx1509.jpg + TCA9548A I²C Multiplexer, components/tca9548a, tca9548a.jpg + WeiKai SPI/I²C UART/IO Expander, components/weikai, wk2168.jpg + XL9535, components/xl9535, xl9535.svg Sensor Components ----------------- @@ -164,19 +236,19 @@ Sensors are split into categories. If a sensor fits into more than one category, Core **** + .. imgtable:: Sensor Core, components/sensor/index, folder-open.svg, dark-invert + Template Sensor, components/sensor/template, description.svg, dark-invert Home Assistant, components/sensor/homeassistant, home-assistant.svg, dark-invert MQTT Subscribe, components/sensor/mqtt_subscribe, mqtt.png Uptime Sensor, components/sensor/uptime, timer.svg, dark-invert WiFi Signal Strength, components/sensor/wifi_signal, network-wifi.svg, dark-invert - Template Sensor, components/sensor/template, description.svg, dark-invert - Custom Sensor, components/sensor/custom, language-cpp.svg, dark-invert - Air Quality *********** + .. imgtable:: AGS10, components/sensor/ags10, ags10.jpg, Volatile Organic Compound Sensor @@ -186,18 +258,19 @@ Air Quality ENS160, components/sensor/ens160, ens160.jpg, CO2 & Air Quality GCJA5, components/sensor/gcja5, gcja5.svg, Particulate HM3301, components/sensor/hm3301, hm3301.jpg, Particulate + iAQ-Core, components/sensor/iaqcore, iaqcore.jpg, CO2 & Volatile organics MH-Z19, components/sensor/mhz19, mhz19.jpg, CO2 & Temperature MiCS-4514, components/sensor/mics_4514, mics_4514.jpg, Gas concentration PM1006 Sensor, components/sensor/pm1006, pm1006.jpg, Particulate PMSA003I, components/sensor/pmsa003i, pmsa003i.jpg, Particulate PMSX003, components/sensor/pmsx003, pmsx003.svg, Particulate RadonEye BLE, components/sensor/radon_eye_ble, radon_eye_logo.png, Radon + SCD30, components/sensor/scd30, scd30.jpg, CO2 & Temperature & Humidity + SCD4X, components/sensor/scd4x, scd4x.jpg, CO2 & Temperature & Humidity SDS011 Sensor, components/sensor/sds011, sds011.jpg, Particulate SEN0321, components/sensor/sen0321, sen0321.jpg, Ozone SEN5x, components/sensor/sen5x, sen54.jpg, Temperature & Humidity, Volatile organics and NOx SenseAir, components/sensor/senseair, senseair_s8.jpg, CO2 - SCD30, components/sensor/scd30, scd30.jpg, CO2 & Temperature & Humidity - SCD4X, components/sensor/scd4x, scd4x.jpg, CO2 & Temperature & Humidity SFA30, components/sensor/sfa30, sfa30.jpg, Formaldehyde SGP30, components/sensor/sgp30, sgp30.jpg, CO2 & Volatile organics SGP4x, components/sensor/sgp4x, sgp40.jpg, Volatile organics and NOx @@ -205,11 +278,10 @@ Air Quality SPS30, components/sensor/sps30, sps30.jpg, Particulate T6613/15, components/sensor/t6615, t6615.jpg, CO2 ZyAura, components/sensor/zyaura, zgm053.jpg, CO2 & Temperature & Humidity - iAQ-Core, components/sensor/iaqcore, iaqcore.jpg, CO2 & Volatile organics - Analogue ******** + .. imgtable:: ADC, components/sensor/adc, flash.svg, ESP internal, dark-invert @@ -221,25 +293,25 @@ Analogue MCP3204 / MCP3208, components/sensor/mcp3204, mcp3204.jpg, 4-channel ADC Resistance, components/sensor/resistance, omega.svg, dark-invert - Bluetooth Low Energy (BLE) ************************** + .. imgtable:: + Alpha3, components/sensor/alpha3, alpha3.jpg AM43, components/sensor/am43, am43.jpg, Lux & Battery level BLE Client Sensor, components/sensor/ble_client, bluetooth.svg, dark-invert BLE RSSI, components/sensor/ble_rssi, bluetooth.svg, dark-invert + HHCCJCY10 (MiFlora Pink), components/sensor/xiaomi_hhccjcy10, xiaomi_hhccjcy10.jpg, Soil moisture & Temperature & Light Inkbird IBS-TH1 Mini, components/sensor/inkbird_ibsth1_mini, inkbird_isbth1_mini.jpg, Temperature & Humidity Mopeka Pro Check LP, components/sensor/mopeka_pro_check, mopeka_pro_check.jpg, tank level Mopeka Standard Check LP, components/sensor/mopeka_std_check, mopeka_std_check.jpg, tank level RuuviTag, components/sensor/ruuvitag, ruuvitag.jpg, Temperature & Humidity & Accelerometer Xiaomi BLE, components/sensor/xiaomi_ble, xiaomi_mijia_logo.jpg, Various - HHCCJCY10 (MiFlora Pink), components/sensor/xiaomi_hhccjcy10, xiaomi_hhccjcy10.jpg, Soil moisture & Temperature & Light - Alpha3, components/sensor/alpha3, alpha3.jpg - Digital Signals *************** + .. imgtable:: Duty Cycle, components/sensor/duty_cycle, percent.svg, dark-invert @@ -247,22 +319,23 @@ Digital Signals Pulse Meter, components/sensor/pulse_meter, pulse.svg, dark-invert Pulse Width, components/sensor/pulse_width, pulse.svg, dark-invert - Distance ******** + .. imgtable:: A01NYUB, components/sensor/a01nyub, a01nyub.jpg, Acoustic distance A02YYUW, components/sensor/a02yyuw, a02yyuw.jpg, Acoustic distance HRXL MaxSonar WR, components/sensor/hrxl_maxsonar_wr, hrxl_maxsonar_wr.jpg, Acoustic distance + JSN-SR04T, components/sensor/jsn_sr04t, jsn-sr04t-v3.jpg, Acoustic distance TOF10120, components/sensor/tof10120, tof10120.jpg, IR optical distance Ultrasonic Sensor, components/sensor/ultrasonic, ultrasonic.jpg, Acoustic distance VL53L0x, components/sensor/vl53l0x, vl53l0x.jpg, IR optical distance Zio Ultrasonic Sensor, components/sensor/zio_ultrasonic, zio_ultrasonic.jpg, Acoustic distance - JSN-SR04T, components/sensor/jsn_sr04t, jsn-sr04t-v3.jpg, Acoustic distance Electricity *********** + .. imgtable:: ADE7880, components/sensor/ade7880, ade7880.svg, Voltage & Current & Power @@ -293,7 +366,6 @@ Electricity Teleinfo, components/sensor/teleinfo, teleinfo.jpg, Electrical counter Total Daily Energy, components/sensor/total_daily_energy, sigma.svg, dark-invert - Environmental ************* @@ -304,14 +376,14 @@ Environmental AirThings BLE, components/sensor/airthings_ble, airthings_logo.png, Temperature & Humidity & Pressure AM2315C, components/sensor/am2315c, am2315c.jpg, Temperature & Humidity AM2320, components/sensor/am2320, am2320.jpg, Temperature & Humidity + b-parasite, components/sensor/b_parasite, b_parasite.jpg, Moisture & Temperature & Humidity & Light BME280, components/sensor/bme280, bme280.jpg, Temperature & Humidity & Pressure - BME680, components/sensor/bme680, bme680.jpg, Temperature & Humidity & Pressure & Gas BME680 via BSEC, components/sensor/bme680_bsec, bme680.jpg, Temperature & Humidity & Pressure & Gas + BME680, components/sensor/bme680, bme680.jpg, Temperature & Humidity & Pressure & Gas BMP085, components/sensor/bmp085, bmp180.jpg, Temperature & Pressure BMP280, components/sensor/bmp280, bmp280.jpg, Temperature & Pressure BMP388 and BMP390, components/sensor/bmp3xx, bmp388.jpg, Temperature & Pressure BMP581, components/sensor/bmp581, bmp581.jpg, Temperature & Pressure - b-parasite, components/sensor/b_parasite, b_parasite.jpg, Moisture & Temperature & Humidity & Light Dallas DS18B20, components/sensor/dallas, dallas.jpg, Temperature DHT, components/sensor/dht, dht.jpg, Temperature & Humidity DHT12, components/sensor/dht12, dht12.jpg, Temperature & Humidity @@ -321,13 +393,14 @@ Environmental ENS210, components/sensor/ens210, ens210.jpg, Temperature & Humidity HDC1080, components/sensor/hdc1080, hdc1080.jpg, Temperature & Humidity HHCCJCY10 (MiFlora Pink), components/sensor/xiaomi_hhccjcy10, xiaomi_hhccjcy10.jpg, Soil moisture & Temperature & Light - HTE501, components/sensor/hte501, HTE501.png, Temperature & Humidity Honeywell ABP, components/sensor/honeywellabp, honeywellabp.jpg, Pressure & Temperature Honeywell ABP2 I2C, components/sensor/honeywellabp2_i2c, honeywellabp.jpg, Pressure & Temperature Honeywell HIH I2C, components/sensor/honeywell_hih_i2c, honeywellhih.jpg, Temperature & Humidity + HTE501, components/sensor/hte501, HTE501.png, Temperature & Humidity HTU21D / Si7021 / SHT21, components/sensor/htu21d, htu21d.jpg, Temperature & Humidity HTU31D, components/sensor/htu31d, htu31d.jpg, Temperature & Humidity Hydreon Rain Sensor, components/sensor/hydreon_rgxx, hydreon_rg9.jpg, Rain + HYT271, components/sensor/hyt271, hyt271.jpg, Temperature & Humidity Inkbird IBS-TH1 Mini, components/sensor/inkbird_ibsth1_mini, inkbird_isbth1_mini.jpg, Temperature & Humidity Internal Temperature, components/sensor/internal_temperature, thermometer.svg, Temperature, dark-invert MCP9808, components/sensor/mcp9808, mcp9808.jpg, Temperature @@ -352,14 +425,13 @@ Environmental STS3X, components/sensor/sts3x, sts3x.jpg, Temperature TEE501, components/sensor/tee501, TEE501.png, Temperature TMP102, components/sensor/tmp102, tmp102.jpg, Temperature - TMP117, components/sensor/tmp117, tmp117.jpg, Temperature TMP1075, components/sensor/tmp1075, tmp1075.jpg, Temperature - HYT271, components/sensor/hyt271, hyt271.jpg, Temperature & Humidity + TMP117, components/sensor/tmp117, tmp117.jpg, Temperature XGZP68xx Series, components/sensor/xgzp68xx, 6897d.jpg, Differential Pressure - Light ***** + .. imgtable:: AM43, components/sensor/am43, am43.jpg, Lux @@ -375,65 +447,65 @@ Light VEML6030, components/sensor/veml7700, veml6030.jpg, Lux VEML7700, components/sensor/veml7700, veml7700.jpg, Lux - Magnetic ******** + .. imgtable:: - ESP32 Hall Sensor, components/sensor/esp32_hall, magnet.svg, ESP internal, dark-invert AS5600, components/sensor/as5600, as5600.jpg, 12-Bit Magnetic Position Sensor + ESP32 Hall Sensor, components/sensor/esp32_hall, magnet.svg, ESP internal, dark-invert HMC5883L, components/sensor/hmc5883l, hmc5883l.jpg, 3-Axis magnetometer + MLX90393, components/sensor/mlx90393, mlx90393.jpg, 3-Axis magnetometer MMC5603, components/sensor/mmc5603, mmc5603.jpg, 3-Axis magnetometer MMC5983, components/sensor/mmc5983, mmc5983.jpg, 3-Axis magnetometer - MLX90393, components/sensor/mlx90393, mlx90393.jpg, 3-Axis magnetometer QMC5883L, components/sensor/qmc5883l, qmc5883l.jpg, 3-Axis magnetometer - Miscellaneous ************* + .. imgtable:: AS3935, components/sensor/as3935, as3935.jpg, Storm lightning - Binary Sensor Map, components/sensor/binary_sensor_map, binary_sensor_map.jpg, Map binary to value b-parasite, components/sensor/b_parasite, b_parasite.jpg, Moisture & Temperature & Humidity & Light + Binary Sensor Map, components/sensor/binary_sensor_map, binary_sensor_map.jpg, Map binary to value Combination, components/sensor/combination, function.svg, dark-invert Duty Time, components/sensor/duty_time, timer-play-outline.svg, dark-invert EZO sensor circuits, components/sensor/ezo, ezo-ph-circuit.png, (pH) FS3000, components/sensor/fs3000, fs3000.jpg, Air velocity + Growatt Solar, components/sensor/growatt_solar, growatt.jpg, Solar rooftop Havells Solar, components/sensor/havells_solar, havellsgti5000d_s.jpg, Solar rooftop Integration, components/sensor/integration, sigma.svg, dark-invert - Growatt Solar, components/sensor/growatt_solar, growatt.jpg, Solar rooftop + Kuntze pool sensor, components/sensor/kuntze, kuntze.jpg + MicroNova pellet stove, components/micronova, pellet.svg Modbus Sensor, components/sensor/modbus_controller, modbus.png Nextion, components/sensor/nextion, nextion.jpg, Sensors from display + Person Sensor (SEN21231), components/sensor/sen21231, sen21231.png + Resol VBus, components/vbus, resol_deltasol_bs_plus.jpg Rotary Encoder, components/sensor/rotary_encoder, rotary_encoder.jpg SMT100, components/sensor/smt100, smt100.jpg, Moisture & Temperature Tuya Sensor, components/sensor/tuya, tuya.png TX20, components/sensor/tx20, tx20.jpg, Wind speed & Wind direction uFire EC sensor, components/sensor/ufire_ec, ufire_ec.png, EC & Temperature uFire ISE sensor, components/sensor/ufire_ise, ufire_ise.png, pH & Temperature - Resol VBus, components/vbus, resol_deltasol_bs_plus.jpg - Person Sensor (SEN21231), components/sensor/sen21231, sen21231.png - Kuntze pool sensor, components/sensor/kuntze, kuntze.jpg WireGuard, components/wireguard, wireguard_custom_logo.svg - MicroNova pellet stove, components/micronova, pellet.svg - Motion ****** + .. imgtable:: APDS9960, components/sensor/apds9960, apds9960.jpg, Colour & Gesture BMI160, components/sensor/bmi160, bmi160.jpg, Accelerometer & Gyroscope LD2410, components/sensor/ld2410, ld2410.jpg, Motion & Presence LD2420, components/sensor/ld2420, ld2420.jpg, Motion & Presence - Seeed Studio MR24HPC1 mmWave, components/seeed_mr24hpc1, seeed-mr24hpc1.jpg, Motion & Presence MPU6050, components/sensor/mpu6050, mpu6050.jpg, Accelerometer & Gyroscope MPU6886, components/sensor/mpu6886, mpu6886.jpg, Accelerometer & Gyroscope RuuviTag, components/sensor/ruuvitag, ruuvitag.jpg, Temperature & Humidity & Accelerometer - + Seeed Studio MR24HPC1 mmWave, components/seeed_mr24hpc1, seeed-mr24hpc1.jpg, Motion & Presence Thermocouple ************ + .. imgtable:: KMeterISO, components/sensor/kmeteriso, kmeteriso.jpg, K-Type, @@ -443,9 +515,9 @@ Thermocouple MAX6675, components/sensor/max6675, max6675.jpg, K-Type, MCP9600, components/sensor/mcp9600, mcp9600.jpg, All types - Weight ****** + .. imgtable:: HX711, components/sensor/hx711, hx711.jpg, Load cell amplifier @@ -464,17 +536,18 @@ Binary Sensors are split into categories. If a sensor fits into more than one ca Core **** + .. imgtable:: Binary Sensor Core, components/binary_sensor/index, folder-open.svg, dark-invert - Custom Binary Sensor, components/binary_sensor/custom, language-cpp.svg, dark-invert + Template Binary Sensor, components/binary_sensor/template, description.svg, dark-invert GPIO, components/binary_sensor/gpio, pin.svg, dark-invert Home Assistant, components/binary_sensor/homeassistant, home-assistant.svg, dark-invert Status, components/binary_sensor/status, server-network.svg, dark-invert - Template Binary Sensor, components/binary_sensor/template, description.svg, dark-invert Capacitive Touch **************** + .. imgtable:: CAP1188 Capacitive Touch Sensor, components/binary_sensor/cap1188, cap1188.jpg @@ -484,14 +557,15 @@ Capacitive Touch Mechanical ********** + .. imgtable:: Matrix Keypad, components/matrix_keypad, matrix_keypad.jpg TM1637, components/display/tm1637, tm1637.jpg TM1638, components/display/tm1638, tm1638.jpg -NFC/RFID Components -******************* +NFC/RFID +******** Often known as "tag" or "card" readers within the community. @@ -503,29 +577,33 @@ Often known as "tag" or "card" readers within the community. PN716X, components/pn7160, pn716x.jpg RC522, components/binary_sensor/rc522, rc522.jpg RDM6300, components/binary_sensor/rdm6300, rdm6300.jpg + Wiegand Reader, components/wiegand, wiegand.jpg Touchscreen *********** + .. imgtable:: - Nextion Binary Sensor, components/binary_sensor/nextion, nextion.jpg - Touchscreen, components/touchscreen/index, touch.svg, dark-invert - TT21100, components/touchscreen/tt21100, esp32-s3-korvo-2-lcd.png + Touchscreen Core, components/touchscreen/index, touch.svg, dark-invert FT5X06, components/touchscreen/ft5x06, indicator.jpg GT911, components/touchscreen/gt911, esp32_s3_box_3.png + Nextion Binary Sensor, components/binary_sensor/nextion, nextion.jpg + TT21100, components/touchscreen/tt21100, esp32-s3-korvo-2-lcd.png Presence Detection ****************** + .. imgtable:: - DFRobot mmWave Radar, components/dfrobot_sen0395, dfrobot_sen0395.jpg AT581X, components/at581x, at581x.png + DFRobot mmWave Radar, components/dfrobot_sen0395, dfrobot_sen0395.jpg LD2410, components/sensor/ld2410, ld2410.jpg LD2420, components/sensor/ld2420, ld2420.jpg Seeed Studio MR24HPC1 mmWave, components/seeed_mr24hpc1, seeed-mr24hpc1.jpg Miscellaneous ************* + .. imgtable:: Analog Threshold, components/binary_sensor/analog_threshold, analog_threshold.svg, dark-invert @@ -546,36 +624,35 @@ Output Components .. imgtable:: Output Core, components/output/index, folder-open.svg, dark-invert - ESP8266 Software PWM, components/output/esp8266_pwm, pwm.png - Slow PWM, components/output/slow_pwm, pwm.png - GPIO Output, components/output/gpio, pin.svg, dark-invert + Template Output, components/output/template, description.svg, dark-invert + AC Dimmer, components/output/ac_dimmer, ac_dimmer.svg, dark-invert + BLE Binary Output, components/output/ble_client, bluetooth.svg, dark-invert + BP1658CJ, components/output/bp1658cj, bp1658cj.svg + BP5758D, components/output/bp5758d, bp5758d.svg + DAC7678, components/output/dac7678, dac7678.svg + EMC2101, components/emc2101, emc2101.jpg ESP32 DAC, components/output/esp32_dac, dac.svg ESP32 LEDC, components/output/ledc, pwm.png + ESP8266 Software PWM, components/output/esp8266_pwm, pwm.png + GP8403, components/output/gp8403, gp8403.svg + GPIO Output, components/output/gpio, pin.svg, dark-invert LibreTiny PWM, components/output/libretiny_pwm, pwm.png - AC Dimmer, components/output/ac_dimmer, ac_dimmer.svg, dark-invert - PCA9685, components/output/pca9685, pca9685.jpg - TLC59208F, components/output/tlc59208f, tlc59208f.jpg - TLC5947, components/output/tlc5947, tlc5947.jpg - TLC5971, components/output/tlc5971, tlc5971.jpg + MCP4725, components/output/mcp4725, mcp4725.jpg + MCP4728, components/output/mcp4728, mcp4728.jpg + MCP47A1, components/output/mcp47a1, mcp47a1.svg + Modbus Output, components/output/modbus_controller, modbus.png MY9231/MY9291, components/output/my9231, my9231.svg + PCA9685, components/output/pca9685, pca9685.jpg + Sigma-Delta Output, components/output/sigma_delta_output, sigma-delta.svg, dark-invert + Slow PWM, components/output/slow_pwm, pwm.png SM16716, components/output/sm16716, sm16716.svg SM2135, components/output/sm2135, sm2135.svg SM2235, components/output/sm2235, sm2235.svg SM2335, components/output/sm2335, sm2335.svg - MCP4725, components/output/mcp4725, mcp4725.jpg - MCP4728, components/output/mcp4728, mcp4728.jpg - MCP47A1, components/output/mcp47a1, mcp47a1.svg - DAC7678, components/output/dac7678, dac7678.svg - BLE Binary Output, components/output/ble_client, bluetooth.svg, dark-invert - Modbus Output, components/output/modbus_controller, modbus.png - Custom Output, components/output/custom, language-cpp.svg, dark-invert - Sigma-Delta Output, components/output/sigma_delta_output, sigma-delta.svg, dark-invert - Template Output, components/output/template, description.svg, dark-invert - BP1658CJ, components/output/bp1658cj, bp1658cj.svg - BP5758D, components/output/bp5758d, bp5758d.svg + TLC59208F, components/output/tlc59208f, tlc59208f.jpg + TLC5947, components/output/tlc5947, tlc5947.jpg + TLC5971, components/output/tlc5971, tlc5971.jpg X9C Potentiometer, components/output/x9c, x9c.jpg - GP8403, components/output/gp8403, gp8403.svg - EMC2101, components/emc2101, emc2101.jpg Light Components ---------------- @@ -583,35 +660,31 @@ Light Components .. imgtable:: Light Core, components/light/index, folder-open.svg, dark-invert + Beken SPI, components/light/beken_spi_led_strip, color_lens.svg, dark-invert Binary Light, components/light/binary, lightbulb.svg, dark-invert - Status Led, components/light/status_led, led-on.svg, dark-invert - Monochromatic Light, components/light/monochromatic, brightness-medium.svg, dark-invert - Cold+Warm White Light, components/light/cwww, brightness-medium.svg, dark-invert Color Temperature Light, components/light/color_temperature, brightness-medium.svg, dark-invert + ESP32 RMT, components/light/esp32_rmt_led_strip, color_lens.svg, dark-invert + FastLED Light, components/light/fastled, color_lens.svg, dark-invert + H-bridge Light, components/light/hbridge, brightness-medium.svg, dark-invert + Light Partition, components/light/partition, color_lens.svg, dark-invert + LightWaveRF, components/lightwaverf, brightness-medium.svg + Monochromatic Light, components/light/monochromatic, brightness-medium.svg, dark-invert + NeoPixelBus Light, components/light/neopixelbus, color_lens.svg, dark-invert RGB Light, components/light/rgb, rgb.png + RGBCT Light, components/light/rgbct, rgbw.png RGBW Light, components/light/rgbw, rgbw.png RGBWW Light, components/light/rgbww, rgbw.png - RGBCT Light, components/light/rgbct, rgbw.png - - ESP32 RMT, components/light/esp32_rmt_led_strip, color_lens.svg, dark-invert RP2040 PIO, components/light/rp2040_pio_led_strip, color_lens.svg, dark-invert - FastLED Light, components/light/fastled, color_lens.svg, dark-invert - NeoPixelBus Light, components/light/neopixelbus, color_lens.svg, dark-invert - Beken SPI, components/light/beken_spi_led_strip, color_lens.svg, dark-invert - Light Partition, components/light/partition, color_lens.svg, dark-invert - SPI LED Strips, components/light/spi_led_strip, apa102.jpg - - Tuya Dimmer, components/light/tuya, tuya.png Shelly Dimmer, components/light/shelly_dimmer, shellydimmer2.jpg - Custom Light, components/light/custom, language-cpp.svg, dark-invert - LightWaveRF, components/lightwaverf, brightness-medium.svg - - H-bridge Light, components/light/hbridge, brightness-medium.svg, dark-invert Sonoff D1 Dimmer, components/light/sonoff_d1, sonoff_d1.jpg + SPI LED Strips, components/light/spi_led_strip, apa102.jpg + Status Led, components/light/status_led, led-on.svg, dark-invert + Tuya Dimmer, components/light/tuya, tuya.png -Looking for WS2811 and similar individually addressable lights? Have a look at the -:doc:`FastLED Light `. +**Looking for WS2811 and similar individually addressable lights?** For the ESP32 and its variants, we +recommend the :doc:`components/light/esp32_rmt_led_strip` or :doc:`components/light/spi_led_strip`; for +other processors, have a look at the :doc:`FastLED Light `. Switch Components ----------------- @@ -619,19 +692,18 @@ Switch Components .. imgtable:: Switch Core, components/switch/index, folder-open.svg, dark-invert + Template Switch, components/switch/template, description.svg, dark-invert + BLE Client Switch, components/switch/ble_client, bluetooth.svg, dark-invert + Factory Reset Switch, components/switch/factory_reset, restart-alert.svg, dark-invert + Generic Output Switch, components/switch/output, upload.svg, dark-invert GPIO Switch, components/switch/gpio, pin.svg, dark-invert + Modbus Switch, components/switch/modbus_controller, modbus.png + Nextion Switch, components/switch/nextion, nextion.jpg Restart Switch, components/switch/restart, restart.svg, dark-invert Safe Mode Switch, components/switch/safe_mode, restart-alert.svg, dark-invert Shutdown Switch, components/switch/shutdown, power_settings.svg, dark-invert - Factory Reset Switch, components/switch/factory_reset, restart-alert.svg, dark-invert - Generic Output Switch, components/switch/output, upload.svg, dark-invert - Template Switch, components/switch/template, description.svg, dark-invert - UART Switch, components/switch/uart, uart.svg - Custom Switch, components/switch/custom, language-cpp.svg, dark-invert Tuya Switch, components/switch/tuya, tuya.png - Modbus Switch, components/switch/modbus_controller, modbus.png - BLE Client Switch, components/switch/ble_client, bluetooth.svg, dark-invert - Nextion Switch, components/switch/nextion, nextion.jpg + UART Switch, components/switch/uart, uart.svg Button Components ----------------- @@ -640,14 +712,21 @@ Button Components Button Core, components/button/index, folder-open.svg, dark-invert Template Button, components/button/template, description.svg, dark-invert + Factory Reset Button, components/button/factory_reset, restart-alert.svg, dark-invert Generic Output Button, components/button/output, upload.svg, dark-invert Restart Button, components/button/restart, restart.svg, dark-invert Safe Mode Button, components/button/safe_mode, restart-alert.svg, dark-invert Shutdown Button, components/button/shutdown, power_settings.svg, dark-invert - Factory Reset Button, components/button/factory_reset, restart-alert.svg, dark-invert - Wake-on-LAN, components/button/wake_on_lan, power_settings.svg, dark-invert UART Button, components/button/uart, uart.svg + Wake-on-LAN, components/button/wake_on_lan, power_settings.svg, dark-invert +Event Components +----------------- + +.. imgtable:: + + Event Core, components/event/index, folder-open.svg, dark-invert + Template Event, components/event/template, description.svg, dark-invert Fan Components -------------- @@ -655,11 +734,11 @@ Fan Components .. imgtable:: Fan Core, components/fan/index, folder-open.svg, dark-invert + Template Fan, components/fan/template, description.svg, dark-invert Binary Fan, components/fan/binary, fan.svg, dark-invert H-bridge Fan, components/fan/hbridge, fan.svg, dark-invert Speed Fan, components/fan/speed, fan.svg, dark-invert Tuya Fan, components/fan/tuya, tuya.png - Template Fan, components/fan/template, description.svg, dark-invert Display Components ------------------ @@ -667,7 +746,17 @@ Display Components .. imgtable:: Display Core, components/display/index, folder-open.svg, dark-invert + Display Menu Core, components/display_menu/index, folder-open.svg, dark-invert Font Renderer, components/display/fonts, format-font.svg, dark-invert + + Graphical Display Menu, components/display_menu/graphical_display_menu, graphical_display_menu.png + LCD Menu, components/display_menu/lcd_menu, lcd_menu.png + +Display Hardware Platforms +-------------------------- + +.. imgtable:: + Addressable Light, components/display/addressable_light, addressable_light.jpg ILI9xxx, components/display/ili9xxx, ili9341.jpg ILI9341, components/display/ili9xxx, ili9341.svg @@ -676,15 +765,14 @@ Display Components ILI9486, components/display/ili9xxx, ili9341.jpg ILI9488, components/display/ili9xxx, ili9488.svg WSPICOLCD, components/display/ili9xxx, ili9488.svg - Inkplate, components/display/inkplate6, inkplate6.jpg LCD Display, components/display/lcd_display, lcd.jpg - MAX7219, components/display/max7219, max7219.jpg MAX7219 Dot Matrix, components/display/max7219digit, max7219digit.jpg + MAX7219, components/display/max7219, max7219.jpg Nextion, components/display/nextion, nextion.jpg PCD8544 (Nokia 5110/ 3310), components/display/pcd8544, pcd8544.jpg - Quad SPI AMOLED, components/display/qspi_amoled, t4-s3.jpg PVVX MiThermometer, components/display/pvvx_mithermometer, ../components/sensor/images/xiaomi_lywsd03mmc.jpg + Quad SPI AMOLED, components/display/qspi_amoled, t4-s3.jpg RPI_DPI_RGB, components/display/rpi_dpi_rgb, waveshare_touch-s3.jpg SSD1306, components/display/ssd1306, ssd1306.jpg SSD1322, components/display/ssd1322, ssd1322.jpg @@ -693,14 +781,15 @@ Display Components SSD1331, components/display/ssd1331, ssd1331.jpg SSD1351, components/display/ssd1351, ssd1351.jpg ST7567, components/display/st7567, st7567.jpg - ST7735, components/display/st7735, st7735.jpg ST7701S, components/display/st7701s, indicator.jpg + ST7735, components/display/st7735, st7735.jpg ST7789V, components/display/st7789v, st7789v.jpg ST7796, components/display/ili9xxx, st7796.svg ST7920, components/display/st7920, st7920.jpg TM1621, components/display/tm1621, tm1621.jpg TM1637, components/display/tm1637, tm1637.jpg TM1638, components/display/tm1638, tm1638.jpg + TM1651 Battery Display, components/tm1651, tm1651_battery_display.jpg Waveshare E-Paper, components/display/waveshare_epaper, waveshare_epaper.jpg Touchscreen Components @@ -709,14 +798,14 @@ Touchscreen Components .. imgtable:: Touchscreen Core, components/touchscreen/index, folder-open.svg, dark-invert + CST226, components/touchscreen/cst226, t4-s3.jpg CST816, components/touchscreen/cst816, cst816.jpg EKTF2232, components/touchscreen/ektf2232, ektf2232.svg, Inkplate 6 Plus + FT63X6, components/touchscreen/ft63x6, wt32-sc01.png + GT911, components/touchscreen/gt911, esp32_s3_box_3.png Lilygo T5 4.7", components/touchscreen/lilygo_t5_47, lilygo_t5_47_touch.jpg TT21100, components/touchscreen/tt21100, esp32-s3-korvo-2-lcd.png XPT2046, components/touchscreen/xpt2046, xpt2046.jpg - CST226, components/touchscreen/cst226, t4-s3.jpg - GT911, components/touchscreen/gt911, esp32_s3_box_3.png - FT63X6, components/touchscreen/ft63x6, wt32-sc01.png Cover Components ---------------- @@ -725,14 +814,29 @@ Cover Components Cover Core, components/cover/index, folder-open.svg, dark-invert Template Cover, components/cover/template, description.svg, dark-invert - Feedback Cover, components/cover/feedback, feedback_cover.svg, dark-invert - Endstop Cover, components/cover/endstop, electric-switch.svg, dark-invert - Current-Based Cover, components/cover/current_based, flash.svg, dark-invert - Time-Based Cover, components/cover/time_based, timer.svg, dark-invert - Custom Cover, components/cover/custom, language-cpp.svg, dark-invert AM43 Cover, components/cover/am43, am43.jpg - Tuya Cover, components/cover/tuya, tuya.png + Current-Based Cover, components/cover/current_based, flash.svg, dark-invert + Endstop Cover, components/cover/endstop, electric-switch.svg, dark-invert + Feedback Cover, components/cover/feedback, feedback_cover.svg, dark-invert HE60R Cover, components/cover/he60r, he60r.jpg + Time-Based Cover, components/cover/time_based, timer.svg, dark-invert + Tuya Cover, components/cover/tuya, tuya.png + +Text Components +--------------- + +.. imgtable:: + + Text Core, components/text/index, folder-open.svg, dark-invert + Template Text, components/text/template, description.svg, dark-invert + +Valve Components +---------------- + +.. imgtable:: + + Valve Core, components/valve/index, folder-open.svg, dark-invert + Template Valve, components/valve/template, description.svg, dark-invert Text Sensor Components ---------------------- @@ -740,20 +844,19 @@ Text Sensor Components .. imgtable:: Text Sensor Core, components/text_sensor/index, folder-open.svg, dark-invert - Home Assistant, components/text_sensor/homeassistant, home-assistant.svg, dark-invert - MQTT Subscribe Text, components/text_sensor/mqtt_subscribe, mqtt.png - Version, components/text_sensor/version, new-box.svg, dark-invert - WiFi Info, components/text_sensor/wifi_info, network-wifi.svg, dark-invert - Ethernet Info, components/text_sensor/ethernet_info, ethernet.svg, dark-invert - BLE Scanner, components/text_sensor/ble_scanner, bluetooth.svg, dark-invert - Modbus Text Sensor, components/text_sensor/modbus_controller, modbus.png Template Text Sensor, components/text_sensor/template, description.svg, dark-invert - Custom Text Sensor, components/text_sensor/custom, language-cpp.svg, dark-invert + BLE Scanner, components/text_sensor/ble_scanner, bluetooth.svg, dark-invert + Ethernet Info, components/text_sensor/ethernet_info, ethernet.svg, dark-invert + Home Assistant, components/text_sensor/homeassistant, home-assistant.svg, dark-invert + LibreTiny, components/text_sensor/libretiny, libretiny.svg + Modbus Text Sensor, components/text_sensor/modbus_controller, modbus.png + MQTT Subscribe Text, components/text_sensor/mqtt_subscribe, mqtt.png Nextion Text Sensor, components/text_sensor/nextion, nextion.jpg Tuya Text Sensor, components/text_sensor/tuya, tuya.png - WL-134 Pet Tag Sensor , components/text_sensor/wl_134, fingerprint.svg, dark-invert - LibreTiny, components/text_sensor/libretiny, libretiny.svg + Version, components/text_sensor/version, new-box.svg, dark-invert + WiFi Info, components/text_sensor/wifi_info, network-wifi.svg, dark-invert WireGuard, components/wireguard, wireguard_custom_logo.svg + WL-134 Pet Tag Sensor , components/text_sensor/wl_134, fingerprint.svg, dark-invert Climate Components ------------------ @@ -761,16 +864,15 @@ Climate Components .. imgtable:: Climate Core, components/climate/index, folder-open.svg, dark-invert - Bang Bang Controller, components/climate/bang_bang, air-conditioner.svg, dark-invert - Thermostat Controller, components/climate/thermostat, air-conditioner.svg, dark-invert - Custom Climate, components/climate/custom, language-cpp.svg, dark-invert - PID Controller, components/climate/pid, function.svg, dark-invert - IR Remote Climate, components/climate/climate_ir, air-conditioner-ir.svg, dark-invert - Tuya Climate, components/climate/tuya, tuya.png - Midea, components/climate/midea, midea.svg Anova Cooker, components/climate/anova, anova.png + Bang Bang Controller, components/climate/bang_bang, air-conditioner.svg, dark-invert BedJet Climate System, components/climate/bedjet, bedjet.png Haier Climate, components/climate/haier, haier.svg + IR Remote Climate, components/climate/climate_ir, air-conditioner-ir.svg, dark-invert + Midea, components/climate/midea, midea.svg + PID Controller, components/climate/pid, function.svg, dark-invert + Thermostat Controller, components/climate/thermostat, air-conditioner.svg, dark-invert + Tuya Climate, components/climate/tuya, tuya.png Uponor Smatrix Base Pulse Underfloor Heating, components/uponor_smatrix, uponor.svg Number Components @@ -779,8 +881,8 @@ Number Components .. imgtable:: Number Core, components/number/index, folder-open.svg, dark-invert - Modbus Number, components/number/modbus_controller, modbus.png Template Number, components/number/template, description.svg, dark-invert + Modbus Number, components/number/modbus_controller, modbus.png Tuya Number, components/number/tuya, tuya.png Select Components @@ -799,16 +901,8 @@ Lock Components .. imgtable:: Lock Core, components/lock/index, folder-open.svg, dark-invert - Generic Output Lock, components/lock/output, upload.svg, dark-invert Template Lock, components/lock/template, description.svg, dark-invert - -Text Components ---------------- - -.. imgtable:: - - Text Core, components/text/index, folder-open.svg, dark-invert - Template Text, components/text/template, description.svg, dark-invert + Generic Output Lock, components/lock/output, upload.svg, dark-invert Media Player Components ----------------------- @@ -816,6 +910,7 @@ Media Player Components .. imgtable:: Media Player Core, components/media_player/index, folder-open.svg, dark-invert + DFPlayer, components/dfplayer, dfplayer.svg, dark-invert I2S Audio, components/media_player/i2s_audio, i2s_audio.svg Microphone Components @@ -840,24 +935,26 @@ Time Components .. imgtable:: Time Core, components/time/index, clock-outline.svg, dark-invert - Home Assistant Time, components/time/homeassistant, home-assistant.svg, dark-invert - SNTP, components/time/sntp, clock-outline.svg, dark-invert - GPS Time, components/time/gps, crosshairs-gps.svg, dark-invert DS1307 RTC, components/time/ds1307, clock-outline.svg, dark-invert - PCF8563 RTC, components/time/pcf8563, clock-outline.svg, dark-invert + GPS Time, components/time/gps, crosshairs-gps.svg, dark-invert + Home Assistant Time, components/time/homeassistant, home-assistant.svg, dark-invert PCF85063 RTC, components/time/pcf85063, clock-outline.svg, dark-invert + PCF8563 RTC, components/time/pcf8563, clock-outline.svg, dark-invert + SNTP, components/time/sntp, clock-outline.svg, dark-invert -Home Assistant Companion Components ------------------------------------ +Home Assistant Components +------------------------- + +Components specifically for interacting with Home Assistant. .. imgtable:: + Binary Sensor, components/binary_sensor/homeassistant, home-assistant.svg, dark-invert Bluetooth Proxy, components/bluetooth_proxy, bluetooth.svg, dark-invert - Voice Assistant, components/voice_assistant, voice-assistant.svg, dark-invert micro Wake Word, components/micro_wake_word, voice-assistant.svg, dark-invert Sensor, components/sensor/homeassistant, home-assistant.svg, dark-invert Text Sensor, components/text_sensor/homeassistant, home-assistant.svg, dark-invert - Binary Sensor, components/binary_sensor/homeassistant, home-assistant.svg, dark-invert + Voice Assistant, components/voice_assistant, voice-assistant.svg, dark-invert Alarm Control Panel Components @@ -876,81 +973,75 @@ Datetime Components Datetime Core, components/datetime/index, clock-outline.svg, dark-invert Template Datetime, components/datetime/template, description.svg, dark-invert +Energy/Solar Management +----------------------- + +.. imgtable:: + + PipSolar-compatible PV Inverter, components/pipsolar, pipsolar.jpg + Power Supply, components/power_supply, power.svg, dark-invert + Resol VBus, components/vbus, resol_deltasol_bs_plus.jpg + SML, components/sml, sml.svg + SUN-GTIL2 inverter, components/sun_gtil2, sun_1000g2.png + +Electromechanical +----------------- + +.. imgtable:: + + Atlas Scientific Peristaltic Pump, components/ezo_pmp, ezo-pmp.jpg + Grove TB6612FNG, components/grove_tb6612fng, motor.png + Matrix Keypad, components/matrix_keypad, matrix_keypad.jpg + RTTTL Buzzer, components/rtttl, buzzer.jpg + Servo, components/servo, servo.svg + Stepper, components/stepper/index, stepper.svg + +Wireless Communication +---------------------- + +Wireless communication that is **not Wi-Fi.** + +.. imgtable:: + + IR Remote Climate, components/climate/climate_ir, air-conditioner-ir.svg, dark-invert + Remote Receiver, components/remote_receiver, remote.svg, dark-invert + Remote Transmitter, components/remote_transmitter, remote.svg, dark-invert + RF Bridge, components/rf_bridge, rf_bridge.jpg + SIM800L, components/sim800l, sim800l.jpg + Miscellaneous Components ------------------------ .. imgtable:: - Remote Receiver, components/remote_receiver, remote.svg, dark-invert - Remote Transmitter, components/remote_transmitter, remote.svg, dark-invert - Status LED, components/status_led, led-on.svg, dark-invert - Display Menu Core, components/display_menu/index, folder-open.svg, dark-invert - LCD Menu, components/display_menu/lcd_menu, lcd_menu.png - Graphical Display Menu, components/display_menu/graphical_display_menu, graphical_display_menu.jpg - Matrix Keypad, components/matrix_keypad, matrix_keypad.jpg - Wiegand Reader, components/wiegand, wiegand.jpg - HTTP Request, components/http_request, connection.svg, dark-invert - mDNS, components/mdns, radio-tower.svg, dark-invert - - Sun, components/sun, weather-sunny.svg, dark-invert - GPS, components/gps, crosshairs-gps.svg, dark-invert - - Bluetooth Proxy, components/bluetooth_proxy, bluetooth.svg, dark-invert - ESP32 BLE Client, components/ble_client, bluetooth.svg, dark-invert - ESP32 BLE Tracker, components/esp32_ble_tracker, bluetooth.svg, dark-invert - ESP32 BLE Beacon, components/esp32_ble_beacon, bluetooth.svg, dark-invert - - ESP32 Ethernet, components/ethernet, ethernet.svg, dark-invert ESP32 Camera, components/esp32_camera, camera.svg, dark-invert - ESP32 Camera Web Server, components/esp32_camera_web_server, camera.svg, dark-invert - - I²S Audio, components/i2s_audio, i2s_audio.svg - - Stepper, components/stepper/index, stepper.svg - Servo, components/servo, servo.svg - Sprinkler, components/sprinkler, sprinkler-variant.svg, dark-invert - Grove TB6612FNG, components/grove_tb6612fng, motor.png - - PCA6416A I/O Expander, components/pca6416a, pca6416a.svg - PCA9554 I/O Expander, components/pca9554, pca9554a.jpg - PCF8574 I/O Expander, components/pcf8574, pcf8574.jpg - MAX6956 I/O expander - I²C Bus, components/max6956, max6956.jpg - MCP230XX I/O Expander - I²C Bus, components/mcp230xx, mcp230xx.svg - TCA9548A I²C Multiplexer, components/tca9548a, tca9548a.jpg - MCP23SXX I/O Expander - SPI Bus, components/mcp23Sxx, mcp230xx.svg - SX1509 I/O Expander, components/sx1509, sx1509.jpg - SN74HC165 I/O Expander, components/sn74hc165, sn74hc595.jpg - SN74HC595 I/O Expander, components/sn74hc595, sn74hc595.jpg - XL9535 I/O Expander, components/xl9535, xl9535.svg - SIM800L, components/sim800l, sim800l.jpg - DFPlayer, components/dfplayer, dfplayer.svg, dark-invert - Captive Portal, components/captive_portal, wifi-strength-alert-outline.svg, dark-invert - Improv via BLE, components/esp32_improv, improv.svg, dark-invert - Improv via Serial, components/improv_serial, improv.svg, dark-invert - Debug Component, components/debug, bug-report.svg, dark-invert - TM1651 Battery Display, components/tm1651, tm1651_battery_display.jpg - RF Bridge, components/rf_bridge, rf_bridge.jpg - Tuya MCU, components/tuya, tuya.png - Modbus Controller, components/modbus_controller, modbus.png Exposure Notifications, components/exposure_notifications, exposure_notifications.png - RTTTL Buzzer, components/rtttl, buzzer.jpg - Prometheus, components/prometheus, prometheus.svg - PipSolar - compatible PV Inverter, components/pipsolar, pipsolar.jpg + GPS, components/gps, crosshairs-gps.svg, dark-invert Grow Fingerprint Reader, components/fingerprint_grow, fingerprint.svg, dark-invert - SML, components/sml, sml.svg - SUN-GTIL2 inverter, components/sun_gtil2, sun_1000g2.png - Atlas Scientific Peristaltic Pump, components/ezo_pmp, ezo-pmp.jpg - Resol VBus, components/vbus, resol_deltasol_bs_plus.jpg - WireGuard, components/wireguard, wireguard_custom_logo.svg - Demo, components/demo, description.svg, dark-invert - Copy, components/copy, content-copy.svg, dark-invert + Modbus Controller, components/modbus_controller, modbus.png + Sprinkler, components/sprinkler, sprinkler-variant.svg, dark-invert + Status LED, components/status_led, led-on.svg, dark-invert + Sun, components/sun, weather-sunny.svg, dark-invert + Tuya MCU, components/tuya, tuya.png -Additional Custom Components ----------------------------- +Custom Components +----------------- + +**Note: Custom Components are deprecated in favor of** :doc:`components/external_components`! .. imgtable:: Generic Custom Component, custom/custom_component, language-cpp.svg, dark-invert + + Custom Binary Sensor, components/binary_sensor/custom, language-cpp.svg, dark-invert + Custom Climate, components/climate/custom, language-cpp.svg, dark-invert + Custom Cover, components/cover/custom, language-cpp.svg, dark-invert + Custom Light, components/light/custom, language-cpp.svg, dark-invert + Custom Output, components/output/custom, language-cpp.svg, dark-invert + Custom Sensor, components/sensor/custom, language-cpp.svg, dark-invert + Custom Switch, components/switch/custom, language-cpp.svg, dark-invert + Custom Text Sensor, components/text_sensor/custom, language-cpp.svg, dark-invert + Custom I²C Component, custom/i2c, language-cpp.svg, dark-invert Custom SPI Component, custom/spi, language-cpp.svg, dark-invert Custom UART Component, custom/uart, language-cpp.svg, dark-invert diff --git a/schema_doc.py b/schema_doc.py index 36655981a..21042f584 100644 --- a/schema_doc.py +++ b/schema_doc.py @@ -85,6 +85,7 @@ PLATFORMS_TITLES = { "Microphone": "microphone", "Speaker": "speaker", "Alarm Control Panel": "alarm_control_panel", + "Event": "event", } CUSTOM_DOCS = { diff --git a/web-api/index.rst b/web-api/index.rst index 026c7bda6..96e6f793a 100644 --- a/web-api/index.rst +++ b/web-api/index.rst @@ -182,7 +182,7 @@ creating a POST request at ``/light//turn_on?brightness=128&transition=2`` w - **flash**: Flash the color provided by the other properties for a duration in seconds. - **transition**: Transition to the specified color values in this duration in seconds. - **effect**: Set an effect for the light. -- ***color_temp***: Set the color temperature of the light, in mireds. +- **color_temp**: Set the color temperature of the light, in mireds. ``turn_off`` optional URL parameters: @@ -239,9 +239,10 @@ stopped midway. An example GET request for ``/cover/front_window_blinds`` might - **id**: The ID of the cover, prefixed with ``cover-``. - **state**: ``OPEN`` or ``CLOSED``. Any position other than 0.0 is considered open. -- **value**: Current cover position as a float number. +- **value**: Current cover position as a float number. If the cover component does not support cover position reporting, then this will either be 1.0 when open or 0.0 when closed. - **current_operation**: ``OPENING``, ``CLOSING`` or ``IDLE``. - **tilt**: (only if supported by this cover component) tilt angle from 0.0 to 1.0. +- **position**: (only if supported by this cover component) Current cover position as a float number. POST requests on the other hand allow performing actions on the cover, the available methods being ``open``, ``close``, ``stop``, ``toggle`` and ``set``. The following parameters