From 59e03981a45a1b2778855812b898058a812f73f1 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 16 Feb 2019 23:25:23 +0100 Subject: [PATCH] Update next docs --- .github/PULL_REQUEST_TEMPLATE.md | 8 +- .gitlab-ci.yml | 46 ---- changelog/v1.7.0.rst | 4 +- components/api.rst | 4 +- components/binary_sensor/custom.rst | 8 +- .../binary_sensor/esp32_ble_tracker.rst | 4 - components/binary_sensor/gpio.rst | 26 ++- components/binary_sensor/index.rst | 12 +- components/binary_sensor/remote_receiver.rst | 2 +- components/binary_sensor/template.rst | 53 ++++- components/cover/index.rst | 4 +- components/cover/template.rst | 77 +++++-- components/debug.rst | 6 +- components/deep_sleep.rst | 6 +- components/display/index.rst | 40 ++-- components/display/lcd_gpio.rst | 2 +- components/display/lcd_pcf8574.rst | 2 +- components/display/max7219.rst | 6 +- components/display/nextion.rst | 4 +- components/display/ssd1306_i2c.rst | 2 +- components/display/ssd1306_spi.rst | 2 +- components/display/waveshare_epaper.rst | 8 +- components/esp32_ble_beacon.rst | 8 +- components/esp32_ble_tracker.rst | 4 +- components/{esphomeyaml.rst => esphome.rst} | 120 +++++----- components/ethernet.rst | 7 +- components/i2c.rst | 6 +- components/light/binary.rst | 2 +- components/light/fastled_clockless.rst | 2 +- components/light/fastled_spi.rst | 2 +- components/light/index.rst | 10 +- components/light/monochromatic.rst | 14 +- components/light/neopixelbus.rst | 2 +- components/light/rgb.rst | 16 +- components/logger.rst | 4 +- components/mqtt.rst | 35 ++- components/my9231.rst | 9 +- components/ota.rst | 47 ++-- components/output/custom.rst | 8 +- components/output/esp8266_pwm.rst | 16 +- components/output/gpio.rst | 2 +- components/output/index.rst | 4 +- components/output/ledc.rst | 13 +- components/pca9685.rst | 2 +- components/pcf8574.rst | 8 +- components/pn532.rst | 4 +- components/rdm6300.rst | 4 +- components/remote_receiver.rst | 3 +- components/remote_transmitter.rst | 2 +- components/sensor/ads1115.rst | 2 +- components/sensor/apds9960.rst | 2 +- components/sensor/bh1750.rst | 4 +- components/sensor/bme280.rst | 2 +- components/sensor/bme680.rst | 2 +- components/sensor/bmp085.rst | 2 +- components/sensor/bmp280.rst | 4 +- components/sensor/cse7766.rst | 2 +- components/sensor/custom.rst | 60 ++--- components/sensor/dht.rst | 2 +- components/sensor/dht12.rst | 2 +- components/sensor/duty_cycle.rst | 2 +- components/sensor/esp32_hall.rst | 2 +- components/sensor/hdc1080.rst | 2 +- components/sensor/hlw8012.rst | 4 +- components/sensor/hmc5883l.rst | 2 +- components/sensor/homeassistant.rst | 2 +- components/sensor/htu21d.rst | 2 +- components/sensor/hx711.rst | 4 +- components/sensor/ina219.rst | 6 +- components/sensor/ina3221.rst | 2 +- components/sensor/index.rst | 16 +- components/sensor/max31855.rst | 2 +- components/sensor/max6675.rst | 2 +- components/sensor/mhz19.rst | 2 +- components/sensor/misc/custom-empty.h | 4 +- components/sensor/mpu6050.rst | 2 +- components/sensor/mqtt_subscribe.rst | 4 +- components/sensor/ms5611.rst | 2 +- components/sensor/pmsx003.rst | 2 +- components/sensor/rotary_encoder.rst | 6 +- components/sensor/sht3xd.rst | 2 +- components/sensor/tcs34725.rst | 2 +- components/sensor/template.rst | 40 +++- components/sensor/tsl2561.rst | 4 +- components/sensor/ultrasonic.rst | 4 +- components/sensor/xiaomi_miflora.rst | 6 +- components/sensor/xiaomi_mijia.rst | 6 +- components/spi.rst | 4 +- components/status_led.rst | 6 +- components/stepper/index.rst | 4 +- components/switch/custom.rst | 8 +- components/switch/gpio.rst | 71 +++++- components/switch/index.rst | 2 +- components/switch/output.rst | 2 +- components/switch/remote_transmitter.rst | 21 +- components/switch/restart.rst | 2 +- components/switch/template.rst | 56 ++++- components/switch/uart.rst | 2 +- components/text_sensor/custom.rst | 8 +- components/text_sensor/homeassistant.rst | 2 +- components/text_sensor/mqtt_subscribe.rst | 2 +- components/text_sensor/template.rst | 43 +++- components/text_sensor/version.rst | 4 +- components/time.rst | 18 +- components/uart.rst | 4 +- components/web_server.rst | 8 +- components/wifi.rst | 35 +-- conf.py | 15 +- cookbook/bme280_environment.rst | 2 +- cookbook/bruh.rst | 6 +- cookbook/dual-r2-cover.rst | 5 +- cookbook/garage-door.rst | 3 +- cookbook/h801.rst | 4 +- cookbook/pir.rst | 6 +- cookbook/power_meter.rst | 6 +- cookbook/relay.rst | 4 +- cookbook/sonoff-fishpond-pump.rst | 13 +- cookbook/temt6000.rst | 2 +- custom/custom_component.rst | 14 +- custom/i2c.rst | 8 +- custom/spi.rst | 8 +- custom/uart.rst | 10 +- devices/esp32.rst | 10 +- devices/esp8266.rst | 12 +- devices/nodemcu_esp32.rst | 10 +- devices/nodemcu_esp8266.rst | 12 +- devices/sonoff.rst | 11 +- devices/sonoff_4ch.rst | 40 ++-- devices/sonoff_4ch.yaml | 3 +- devices/sonoff_basic.rst | 30 +-- devices/sonoff_s20.rst | 54 ++--- devices/sonoff_s20.yaml | 3 +- guides/automations.rst | 35 +-- guides/changelog.rst | 2 +- guides/cli.rst | 69 +++--- guides/configuration-types.rst | 53 +++-- guides/contributing.rst | 35 ++- guides/faq.rst | 206 ++++-------------- guides/getting_started_command_line.rst | 129 ++++------- guides/getting_started_hassio.rst | 117 +++------- guides/migrate_espeasy.rst | 10 +- guides/migrate_espurna.rst | 10 +- guides/migrate_sonoff_tasmota.rst | 8 +- index.rst | 11 +- web-api/index.rst | 10 +- 145 files changed, 1067 insertions(+), 1119 deletions(-) delete mode 100644 .gitlab-ci.yml rename components/{esphomeyaml.rst => esphome.rst} (67%) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5012a00c4..cf9a6cd18 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,9 +3,9 @@ **Related issue (if applicable):** fixes -**Pull request in [esphomeyaml](https://github.com/OttoWinter/esphomeyaml) with YAML changes (if applicable):** OttoWinter/esphomeyaml# -**Pull request in [esphomelib](https://github.com/OttoWinter/esphomelib) with C++ framework changes (if applicable):** OttoWinter/esphomelib# +**Pull request in [esphome](https://github.com/esphome/esphome) with YAML changes (if applicable):** esphome/esphome# +**Pull request in [esphome-core](https://github.com/esphome/esphome-core) with C++ framework changes (if applicable):** esphome/esphome-core# ## Checklist: - - [ ] The documentation change has been tested and compiles correctly. - - [ ] Branch: `next` is for changes and new documentation that will go public with the next esphomelib release. Fixes, changes and adjustments for the current release should be created against `current`. + + - [ ] Branch: `next` is for changes and new documentation that will go public with the next ESPHome release. Fixes, changes and adjustments for the current release should be created against `current`. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 13efcdb7b..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -.deploy: &deploy - tags: - - esphomedocs - before_script: - - mkdir -p /root/.ssh - - echo "$PRIVATE_KEY" | tr -d '\r' >/root/.ssh/id_rsa - - chmod 600 /root/.ssh/id_rsa - - ssh-keyscan -t rsa github.com >>/root/.ssh/known_hosts - - git config --global user.email "$GITHUB_EMAIL" - - git config --global user.name "$GITHUB_NAME" - - git worktree prune - - rm -rf ../esphomelib _build/html/ - script: - - mkdir -p _build/html - - git fetch --force git@github.com:${TARGET_REPO}.git gh-pages:gh-pages - - git worktree add _build/html gh-pages - - make ../esphomelib - - make html - - make convertimages - - git -C _build/html add --all - - git -C _build/html commit -m "Deploy to gh-pages" - - git -C _build/html push -f git@github.com:${TARGET_REPO}.git gh-pages - cache: - paths: - - _build/doctrees - -deploy-release: - <<: *deploy - variables: - TARGET_REPO: OttoWinter/esphomedocs - PRIVATE_KEY: ${GITHUB_PRIVATE_KEY} - CNAME: esphomelib.com - BASE_URL: https://esphomelib.com - only: - - current - -deploy-beta: - <<: *deploy - variables: - TARGET_REPO: OttoWinter/esphomedocs-beta - PRIVATE_KEY: ${GITHUB_BETA_PRIVATE_KEY} - CNAME: beta.esphomelib.com - BASE_URL: https://beta.esphomelib.com - only: - - rc diff --git a/changelog/v1.7.0.rst b/changelog/v1.7.0.rst index f3fb9a1d6..1cd7d500b 100644 --- a/changelog/v1.7.0.rst +++ b/changelog/v1.7.0.rst @@ -54,7 +54,7 @@ New Components - The new :doc:`remote receiver ` and :doc:`remote transmitter ` components now allows you to use any 433MHz - receivers and senders with esphomelib. Currently, you will need to use the ``raw`` data as described in + receivers and senders with ESPHome. Currently, you will need to use the ``raw`` data as described in :ref:`this guide `, but in the future more protocols will be supported out of the box. New Features @@ -134,7 +134,7 @@ Other Contributions - Fix deprecation of board_flash_mode parameter (`esphomeyaml/#41`_) by `@aequitas`_ - Support specifying hostname/ip as --upload-port (`esphomeyaml/#36`_) by `@aequitas`_ -- DHT11 sensor doesn't work with esphomelib (`esphomelib/#88`_) by `@ayavilevich`_ +- DHT11 sensor doesn't work with ESPHome (`esphomelib/#88`_) by `@ayavilevich`_ - tsl2561: wrong i2c function for channel 1 (`esphomelib/#81`_) by `@schumar`_ - No need to wait after Wire.requestFrom(). (`esphomelib/#80`_) by `@Koepel`_ - I2CComponent::write_byte_16 writes 0 words (`esphomelib/#78`_) by `@schumar`_ diff --git a/components/api.rst b/components/api.rst index 98ecc0216..b588d4e32 100644 --- a/components/api.rst +++ b/components/api.rst @@ -28,10 +28,10 @@ Configuration variables: Migrating from MQTT to Native API Setup in Home Assistant --------------------------------------------------------- -The native API is the best way to use esphomelib together with Home Assistant - it's fast, +The native API is the best way to use ESPHome together with Home Assistant - it's fast, highly efficient and requires almost zero setup (whereas MQTT requires you to set up an MQTT broker first). -If you've previously used esphomelib with Home Assistant via MQTT and have enabled MQTT discovery, +If you've previously used ESPHome with Home Assistant via MQTT and have enabled MQTT discovery, the upgrade process is unfortunately not just swapping out the ``mqtt`` for ``api`` in your configuration: Home Assistant's `entity registry `__ complicates things a bit. If you don't follow these steps, all your new native API entities will have a trailing diff --git a/components/binary_sensor/custom.rst b/components/binary_sensor/custom.rst index 4a1df12d7..2649afa10 100644 --- a/components/binary_sensor/custom.rst +++ b/components/binary_sensor/custom.rst @@ -1,7 +1,7 @@ Custom Binary Sensor ==================== -This integration can be used to create custom binary sensors in esphomelib +This integration can be used to create custom binary sensors in ESPHome using the C++ (Arduino) API. Please first read :doc:`/components/sensor/custom` guide, @@ -13,8 +13,8 @@ same as the gpio binary sensor. .. code-block:: cpp - #include "esphomelib.h" - using namespace esphomelib; + #include "esphome.h" + using namespace esphome; class MyCustomBinarySensor : public PollingComponent, public binary_sensor::BinarySensor { public: @@ -41,7 +41,7 @@ And in YAML: .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: includes: - my_binary_sensor.h diff --git a/components/binary_sensor/esp32_ble_tracker.rst b/components/binary_sensor/esp32_ble_tracker.rst index 7f34504bb..620052847 100644 --- a/components/binary_sensor/esp32_ble_tracker.rst +++ b/components/binary_sensor/esp32_ble_tracker.rst @@ -49,10 +49,6 @@ the logs to see discovered Bluetooth Low Energy devices. # Example configuration entry for finding MAC addresses esp32_ble_tracker: -After adding that to your configuration, you will need to re-flash the ESP32 over USB, as esphomeyaml -needs to repartition the flash memory of the ESP in order to allow for the increased firmware size that -the BLE stack requires. - Using the configuration above, first you should see a ``Starting scan...`` debug message at boot-up. Then, when a BLE device is discovered, you should see messages like ``Found device AC:37:43:77:5F:4C`` together with some information about their diff --git a/components/binary_sensor/gpio.rst b/components/binary_sensor/gpio.rst index aec908dc9..9578aae39 100644 --- a/components/binary_sensor/gpio.rst +++ b/components/binary_sensor/gpio.rst @@ -2,7 +2,7 @@ GPIO Binary Sensor ================== .. seo:: - :description: Instructions for setting up GPIO binary sensors with esphomelib. + :description: Instructions for setting up GPIO binary sensors with ESPHome. :image: pin.png The GPIO Binary Sensor platform allows you to use any input pin on your @@ -30,19 +30,23 @@ Configuration variables: - All other options from :ref:`Binary Sensor ` and :ref:`MQTT Component `. -.. note:: +Activating internal pullups +--------------------------- - For some applications such as reed switches you need to set the pin mode to ``INPUT_PULLUP`` - like this: +If you're hooking up a button without an external pullup or see lots of ON/OFF events +in the log output all the time, this often means the GPIO pin is floating. - .. code-block:: yaml +For these cases you need to manually enable the pull-up (or pull-down) resistors on the ESP, +you can do so with the :ref:`Pin Schema `. - binary_sensor: - - platform: gpio - pin: - number: D2 - mode: INPUT_PULLUP - name: ... +.. code-block:: yaml + + binary_sensor: + - platform: gpio + pin: + number: D2 + mode: INPUT_PULLUP + name: ... Inverting Values ---------------- diff --git a/components/binary_sensor/index.rst b/components/binary_sensor/index.rst index 7bd320c22..cb4e67b2f 100644 --- a/components/binary_sensor/index.rst +++ b/components/binary_sensor/index.rst @@ -5,7 +5,7 @@ Binary Sensor Component :description: Information about the base representation of all binary sensors. :image: folder-open.png -With esphomelib you can use different types of binary sensors. They will +With ESPHome you can use different types of binary sensors. They will automatically appear in the Home Assistant front-end and have several configuration options. @@ -57,7 +57,7 @@ Automations: Binary Sensor Filters --------------------- -With binary sensor filters you can customize how esphomelib handles your binary sensor values even more. +With binary sensor filters you can customize how ESPHome handles your binary sensor values even more. They are similar to :ref:`Sensor Filters `. .. code-block:: yaml @@ -75,7 +75,6 @@ They are similar to :ref:`Sensor Filters `. } else { return {}; } - - heartbeat: 5s Supported filters: @@ -91,15 +90,12 @@ Supported filters: - **lambda**: Specify any :ref:`lambda ` for more complex filters. The input value from the binary sensor is ``x`` and you can return ``true`` for ON, ``false`` for OFF, and ``{}`` to stop the filter chain. -- **heartbeat**: Periodically send out the last received value from the binary sensor with the given - interval. All state changes are still immediately published. Binary Sensor Automation ------------------------ -The triggers for binary sensors in esphomeyaml use the lingo from computer mouses. This naming might not -perfectly fit every use case, but at least makes the naming consistent. For example, a ``press`` is triggered -in the first moment when the button on your mouse is pushed down. +The triggers for binary sensors in ESPHome use the lingo from computer mouses. +For example, a ``press`` is triggered in the first moment when the button on your mouse is pushed down. You can access the current state of the binary sensor in :ref:`lambdas ` using ``id(binary_sensor_id).state``. diff --git a/components/binary_sensor/remote_receiver.rst b/components/binary_sensor/remote_receiver.rst index f3c8ecb25..4428d52cd 100644 --- a/components/binary_sensor/remote_receiver.rst +++ b/components/binary_sensor/remote_receiver.rst @@ -55,7 +55,7 @@ Configuration variables: pin: 5 carrier_duty_percent: 100% - Supporting the RF Bridge chip directly is currently only a long-term goal for esphomelib. + Supporting the RF Bridge chip directly is currently only a long-term goal for ESPHome. See Also diff --git a/components/binary_sensor/template.rst b/components/binary_sensor/template.rst index 29aff4764..7c101d351 100644 --- a/components/binary_sensor/template.rst +++ b/components/binary_sensor/template.rst @@ -18,12 +18,7 @@ a binary sensor. - platform: template name: "Garage Door Open" lambda: |- - if (isnan(id(ultrasonic_sensor1).state)) { - // isnan checks if the ultrasonic sensor echo - // has timed out, resulting in a NaN (not a number) state - // in that case, return {} to indicate that we don't know. - return {}; - } else if (id(ultrasonic_sensor1).state > 30) { + if (id(ultrasonic_sensor1).state > 30) { // Garage Door is open. return true; } else { @@ -35,21 +30,61 @@ Possible return values of the lambda: - ``return true;`` if the binary sensor should be ON. - ``return false;`` if the binary sensor should be OFF. - - ``return {};`` if the last state should be repeated. + - ``return {};`` if the state is not known (use last known state) Configuration variables: ------------------------ - **name** (**Required**, string): The name of the binary sensor. -- **lambda** (**Required**, :ref:`lambda `): +- **lambda** (*Optional*, :ref:`lambda `): Lambda to be evaluated repeatedly to get the current state of the binary sensor. - Only state *changes* will be published to MQTT. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor ` and :ref:`MQTT Component `. +.. _binary_sensor-template-publish_action: + +``binary_sensor.template.publish`` Action +----------------------------------------- + +You can also publish a state to a template binary sensor from elsewhere in your YAML file +with the ``binary_sensor.template.publish`` action. + +.. code-block:: yaml + + # Example configuration entry + binary_sensor: + - platform: template + name: "Garage Door Open" + id: template_bin + + # in some trigger + on_...: + - binary_sensor.template.publish: + id: template_bin + state: ON + + # Templated + - binary_sensor.template.publish: + id: template_bin + state: !lambda 'return id(some_sensor).state > 30;' + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the template binary sensor. +- **state** (**Required**, boolean, :ref:`templatable `): + The state to publish. + +.. note:: + + This action can also be written in lambdas: + + .. code-block:: cpp + + id(template_bin).publish_state(true); + See Also -------- diff --git a/components/cover/index.rst b/components/cover/index.rst index 16dc8b7ba..382dababe 100644 --- a/components/cover/index.rst +++ b/components/cover/index.rst @@ -2,10 +2,10 @@ Cover Component =============== .. seo:: - :description: Instructions for setting up base covers in esphomelib. + :description: Instructions for setting up base covers in ESPHome. :image: folder-opn.png -The ``cover`` component is a generic representation of covers in esphomelib/yaml. +The ``cover`` component is a generic representation of covers in ESPHome. A cover can (currently) either be *closed* or *open* and supports three types of commands: *open*, *close* and *stop*. diff --git a/components/cover/template.rst b/components/cover/template.rst index 05f65dc76..0c329f17f 100644 --- a/components/cover/template.rst +++ b/components/cover/template.rst @@ -2,7 +2,7 @@ Template Cover ============== .. seo:: - :description: Instructions for setting up template covers in esphomelib. + :description: Instructions for setting up template covers in ESPHome. :image: description.png The ``template`` cover platform allows you to create simple covers out of just a few @@ -43,23 +43,64 @@ Possible return values for the optional lambda: Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the cover. -- **lambda** (*Optional*, :ref:`lambda `): - Lambda to be evaluated repeatedly to get the current state of the cover. - Only state *changes* will be published to MQTT. -- **optimistic** (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode, - any command sent to the template cover will immediately update the reported state and no lambda - needs to be used. Defaults to ``false``. -- **open_action** (*Optional*, :ref:`Action `): The action that should - be performed when the remote (like Home Assistant's frontend) requests the cover to be opened. -- **close_action** (*Optional*, :ref:`Action `): The action that should - be performed when the remote requests the cover to be closed. -- **stop_action** (*Optional*, :ref:`Action `): The action that should - be performed when the remote requests the cover to stopped. -- **id** (*Optional*, - :ref:`config-id`): Manually specify - the ID used for code generation. -- All other options from :ref:`MQTT Component `. +- **name** (**Required**, string): The name of the cover. +- **lambda** (*Optional*, :ref:`lambda `): + Lambda to be evaluated repeatedly to get the current state of the cover. +- **open_action** (*Optional*, :ref:`Action `): The action that should + be performed when the remote (like Home Assistant's frontend) requests the cover to be opened. +- **close_action** (*Optional*, :ref:`Action `): The action that should + be performed when the remote requests the cover to be closed. +- **stop_action** (*Optional*, :ref:`Action `): +- **optimistic** (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode, + any command sent to the template cover 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 cover 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``. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- All other options from :ref:`MQTT Component `. + + +.. _cover-template-publish_action: + +``cover.template.publish`` Action +--------------------------------- + +You can also publish a state to a template cover from elsewhere in your YAML file +with the ``cover.template.publish`` action. + +.. code-block:: yaml + + # Example configuration entry + cover: + - platform: template + name: "Template Cover" + id: template_cov + + # in some trigger + on_...: + - cover.template.publish: + id: template_cov + state: OPEN + + # Templated + - cover.template.publish: + id: template_cov + state: !lambda 'return cover::COVER_OPEN;' + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the template cover. +- **state** (**Required**, :ref:`templatable `): + The state to publish. One of ``OPEN``, ``CLOSED``. + +.. note:: + + This action can also be written in lambdas: + + .. code-block:: cpp + + id(template_cov).publish_state(cover::COVER_OPEN); See Also -------- diff --git a/components/debug.rst b/components/debug.rst index f42c41bfd..40664858d 100644 --- a/components/debug.rst +++ b/components/debug.rst @@ -2,11 +2,11 @@ Debug Component =============== .. seo:: - :description: Instructions for setting up the debug component in esphomelib + :description: Instructions for setting up the debug component in ESPHome :image: bug-report.png -The ``debug`` component can be used to debug problems with esphomelib. At startup, it prints -a bunch of useful information like reset reason, free heap size, esphomelib version and so on. +The ``debug`` component can be used to debug problems with ESPHome. At startup, it prints +a bunch of useful information like reset reason, free heap size, ESPHome version and so on. .. figure:: images/debug.png :align: center diff --git a/components/deep_sleep.rst b/components/deep_sleep.rst index eafea83c5..b1fa1caa0 100644 --- a/components/deep_sleep.rst +++ b/components/deep_sleep.rst @@ -10,7 +10,7 @@ ESP8266/ESP32 after a certain amount of time. This is especially useful with nod on batteries and therefore need to conserve as much energy as possible. To use ``deep_sleep`` first specify how long the node should be active, i.e. how long it should -check sensor values and report them, using the ``run_duration`` and ``run_cycles`` options. If you +check sensor values and report them, using the ``run_duration`` options. If you use both in your configuration, any time either one of them is finished, the node will go into deep sleep mode. @@ -34,8 +34,6 @@ Configuration variables: ------------------------ - **run_duration** (*Optional*, :ref:`config-time`): The time duration the node should be active, i.e. run code. -- **run_cycles** (*Optional*, int): The number of ``loop()`` cycles to go through before - entering deep sleep mode. Note: for advanced use-cases with custom code only. - **sleep_duration** (*Optional*, :ref:`config-time`): The time duration to stay in deep sleep mode. - **wakeup_pin** (*Optional*, :ref:`Pin Schema `): Only on ESP32. A pin to wake up to once in deep sleep mode. Use the inverted property to wake up @@ -73,7 +71,7 @@ ESP32 Wakeup Pin Mode --------------------- On the ESP32, you have the option of waking up on any RTC pin. However, there's one scenario that you need -to tell esphomelib how to handle: What if the wakeup pin is already in the state with which it would wake up +to tell ESPHome how to handle: What if the wakeup pin is already in the state with which it would wake up when the deep sleep should start? There are three ways of handling this using the ``wakeup_pin_mode`` option: - ``IGNORE`` (Default): Ignore the fact that we will immediately exit the deep sleep mode because the wakeup diff --git a/components/display/index.rst b/components/display/index.rst index b53034671..e5f0ed067 100644 --- a/components/display/index.rst +++ b/components/display/index.rst @@ -5,7 +5,7 @@ Display Component :description: Instructions for setting up the display integration. :image: folder-open.png -The ``display`` component houses esphomelib's powerful rendering and display +The ``display`` component houses ESPHome's powerful rendering and display engine. Fundamentally, there are these types of displays: - Text based displays like :doc:`7-Segment displays ` or @@ -14,10 +14,10 @@ engine. Fundamentally, there are these types of displays: - Binary displays which can toggle ON/OFF any pixel, like :doc:`E-Paper displays ` or :doc:`OLED displays `. -For the last type, esphomelib and esphomeyaml have a powerful rendering engine that can do +For the last type, ESPHome has a powerful rendering engine that can do many things like draw some basic shapes, print text with any font you want, or even show images. -To achieve all this flexibility displays tie in directly into esphomeyaml's :ref:`lambda system `. +To achieve all this flexibility displays tie in directly into ESPHome's :ref:`lambda system `. So when you want to write some text or sensor values to the screen you will be writing in C++ code using an API that is designed to @@ -29,13 +29,13 @@ using an API that is designed to Display Rendering Engine ------------------------ -In this section we will be discussing how to use esphomelib's display rendering engine from esphomeyaml +In this section we will be discussing how to use ESPHome's display rendering engine from ESPHome and some basic commands. Please note that this only applies to displays that can control each pixel individually. -So, first a few basics: When setting up a display platform in esphomeyaml there will be a configuration -option called ``lambda:`` which will be called every time esphomelib wants to re-render the display. -In there, you can write code like in any :ref:`lambda ` in esphomeyaml. Display +So, first a few basics: When setting up a display platform in ESPHome there will be a configuration +option called ``lambda:`` which will be called every time ESPHome wants to re-render the display. +In there, 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. .. code-block:: yaml @@ -67,7 +67,7 @@ the rendering engine is always first specify the ``x`` coordinate and then the ` Basic Shapes ************ -Now that you know a bit more about esphomelib's coordinate system, let's draw some basic shapes like lines, rectangles +Now that you know a bit more about ESPHome's coordinate system, let's draw some basic shapes like lines, rectangles and circles: .. code-block:: yaml @@ -90,7 +90,7 @@ and circles: All the above methods can optionally also be called with an argument at the end which specifies in which color to draw. Currently, only ``COLOR_ON`` (the default if color is not given) and ``COLOR_OFF`` are supported because -esphomelib only has implemented binary displays. +ESPHome only has implemented binary displays. .. code-block:: yaml @@ -128,12 +128,12 @@ You can view the full API documentation for the rendering engine in the "API Ref Drawing Static Text ******************* -The rendering engine also has a powerful font drawer which integrates seamlessly into esphomeyaml. +The rendering engine also has a powerful font drawer which integrates seamlessly into ESPHome. Whereas in most arduino display projects you have to use one of a few pre-defined fonts in very -specific sizes, with esphomeyaml you have the option to use **any** truetype (``.ttf``) font file +specific sizes, with ESPHome you have the option to use **any** truetype (``.ttf``) font file at **any** size! Granted the reason for it is actually not having to worry about the licensing of font files :) -To use fonts you first have to define a font object in your esphomeyaml configuration file. Just grab +To use fonts you first have to define a font object in your ESPHome configuration file. Just grab a ``.ttf`` file from somewhere on the Internet and create a ``font:`` section in your configuration: .. code-block:: yaml @@ -164,9 +164,9 @@ Configuration variables: .. note:: - To use fonts you will need to have the python ``pillow`` package installed, as esphomeyaml uses that package + To use fonts you will need to have the python ``pillow`` package installed, as ESPHome uses that package to translate the truetype files into an internal format. If you're running this as a Hass.io add-on or with - the official esphomeyaml docker image, it should already be installed. Otherwise you need to install it using + the official ESPHome docker image, it should already be installed. Otherwise you need to install it using ``pip2 install pillow``. @@ -181,10 +181,10 @@ Then, in your display code just reference the font like so: // Print the string "Hello World!" at [0,10] it.print(0, 10, id(my_font), "Hello World!"); -By default, esphomelib will *align* the text at the top left. That means if you enter the coordinates +By default, ESPHome will *align* the text at the top left. That means if you enter the coordinates ``[0,10]`` for your text, the top left of the text will be at ``[0,10]``. If you want to draw some text at the right side of the display, it is however sometimes useful to choose a different **text alignment**. -When you enter ``[0,10]`` you're really telling esphomelib that it should position the **anchor point** of the text +When you enter ``[0,10]`` you're really telling ESPHome that it should position the **anchor point** of the text at ``[0,10]``. When using a different alignment, like ``TOP_RIGHT``, the text will be positioned left of the anchor pointed, so that, as the name implies, the anchor point is a the *top right* corner of the text. @@ -218,7 +218,7 @@ Formatted Text ************** Static text by itself is not too impressive. What we really want is to display *dynamic* content like sensor values -on the display!. That's where ``printf`` comes in. ``printf`` is a formatting engine from the C era and esphomelib +on the display!. That's where ``printf`` comes in. ``printf`` is a formatting engine from the C era and ESPHome chose to use because ... well, I'm too lazy to create a fully-fledged format engine where the existing stuff is way better documented :) @@ -244,7 +244,7 @@ stuff after it is encountered, it is magically replaced by the argument after th Every time you type a percent sign ``%`` in a printf format string, it will treat the following letters as a format tag until a so-called "specifier" is encountered (in this case ``f``). You can read more about it `here `__, -but for esphomelib there are really just a few things you need to know. +but for ESPHome there are really just a few things you need to know. Let's break ``%.1f`` down: @@ -311,7 +311,7 @@ use any string you pass it, like ``"ON"`` or ``"OFF"``. Displaying Time *************** -With esphomelib you can also display the current time using the NTP protocol. Please see the example :ref:`here `. +With ESPHome you can also display the current time using the NTP protocol. Please see the example :ref:`here `. Images ^^^^^^ @@ -334,7 +334,7 @@ Configuration variables: .. note:: To use images you will need to have the python ``pillow`` package installed. - If you're running this as a Hass.io add-on or with the official esphomeyaml docker image, it should already be + If you're running this as a Hass.io add-on or with the official ESPHome docker image, it should already be installed. Otherwise you need to install it using ``pip2 install pillow``. And then later in code: diff --git a/components/display/lcd_gpio.rst b/components/display/lcd_gpio.rst index 91473b5b1..4263ee905 100644 --- a/components/display/lcd_gpio.rst +++ b/components/display/lcd_gpio.rst @@ -6,7 +6,7 @@ GPIO Character-Based LCD Display :image: lcd.jpg The ``lcd_gpio`` display platform allows you to use standard character-based LCD displays like `this one `__ -with esphomelib. This integration is only for LCD displays that display individual characters on a screen (usually 16-20 columns +with ESPHome. This integration is only for LCD displays that display individual characters on a screen (usually 16-20 columns and 2-4 rows), and not for LCD displays that can control each pixel individually. Also, this is the GPIO version of the LCD integration where each of the data pins of the LCD needs a dedicated GPIO pin on the ESP. These LCD displays are also commonly sold with a PCF8574 chip which only need two lines to the ESP, for that see :doc:`lcd_pcf8574`. diff --git a/components/display/lcd_pcf8574.rst b/components/display/lcd_pcf8574.rst index adfca07e5..ae481a504 100644 --- a/components/display/lcd_pcf8574.rst +++ b/components/display/lcd_pcf8574.rst @@ -6,7 +6,7 @@ PCF8574 Character-Based LCD Display :image: lcd.jpg The ``lcd_pcf8574`` display platform allows you to use standard character-based LCD displays like `this one `__ -with esphomelib. This integration is only for LCD displays that display individual characters on a screen (usually 16-20 columns +with ESPHome. This integration is only for LCD displays that display individual characters on a screen (usually 16-20 columns and 2-4 rows), and not for LCD displays that can control each pixel individually. This version of the LCD integration is for LCD displays with an PCF8574 connected to all the data pins. This has diff --git a/components/display/max7219.rst b/components/display/max7219.rst index 13de14fd8..6e20aedf5 100644 --- a/components/display/max7219.rst +++ b/components/display/max7219.rst @@ -7,7 +7,7 @@ MAX7219 7-Segment Display The ``max7219`` display platform allows you to use MAX7219 7-segment display drivers (`datasheet `__, `hobbycomponents `__) -with esphomelib. Please note that this integration is *only* for 7-segment display, not matrix configurations. +with ESPHome. Please note that this integration is *only* for 7-segment display, not matrix configurations. .. figure:: images/max7219-full.jpg :align: center @@ -63,7 +63,7 @@ The MAX7219 has a similar API to the fully fledged :ref:`display-engine`, but it as with all other displays. In this case however, ``it`` is an MAX7219 instance (see API Reference). The most basic operation with the MAX7219 is wiring a simple number to the screen as in the configuration example -at the top of this page. But even though you're passing in a string (here ``"01234567"``), esphomelib converts it +at the top of this page. But even though you're passing in a string (here ``"01234567"``), ESPHome converts it into a representation that the MAX7219 can understand: The exact pixels that should be turned on. And of course, not all characters can be represented. You can see a full list of characters :ref:`below `. @@ -72,7 +72,7 @@ beginning which can be used to print the text at a specific position. This argum means the first character of the first MAX7219. For example to start the first character of your text at the end of the first MAX7219, you would write ``it.print(7, "0");``. -Also note that the ``.`` (dot) character is special because when esphomelib encounters it in the string the dot +Also note that the ``.`` (dot) character is special because when ESPHome encounters it in the string the dot segment of the previous position will be enabled. .. code-block:: yaml diff --git a/components/display/nextion.rst b/components/display/nextion.rst index 3eed9fb30..878707d8a 100644 --- a/components/display/nextion.rst +++ b/components/display/nextion.rst @@ -12,7 +12,7 @@ Nextion TFT LCD Display The ``nextion`` display platform allows you to use Nextion LCD displays (`datasheet `__, `iTead `__) -with esphomelib. +with ESPHome. .. figure:: images/nextion-full.jpg :align: center @@ -55,7 +55,7 @@ Configuration variables: Rendering Lambda ---------------- -With Nextion displays, a dedicated chip on the display itself does the whole rendering. esphomelib can only +With Nextion displays, a dedicated chip on the display itself does the whole rendering. ESPHome can only send *instructions* to the display to tell it *how* to render something and *what* to render. First, you need to use the `Nextion Editor `__ to diff --git a/components/display/ssd1306_i2c.rst b/components/display/ssd1306_i2c.rst index fadf6e283..d320184d5 100644 --- a/components/display/ssd1306_i2c.rst +++ b/components/display/ssd1306_i2c.rst @@ -8,7 +8,7 @@ SSD1306 OLED Display over I²C The ``ssd1306_i2c`` display platform allows you to use SSD1306 (`datasheet `__, `Adafruit `__) and SH1106 (`datasheet `__, `electrodragon `__) -displays with esphomelib. Note that this component is for displays that are connected via the :ref:`I²C Bus `. +displays with ESPHome. Note that this component is for displays that are connected via the :ref:`I²C Bus `. If your SSD1306 or SH1106 is connected via the 4-Wire :ref:`SPI bus `, see :doc:`ssd1306_spi`. .. figure:: images/ssd1306-full.jpg diff --git a/components/display/ssd1306_spi.rst b/components/display/ssd1306_spi.rst index 4be9ae6d8..ce64c130b 100644 --- a/components/display/ssd1306_spi.rst +++ b/components/display/ssd1306_spi.rst @@ -8,7 +8,7 @@ SSD1306 OLED Display over SPI The ``ssd1306_spi`` display platform allows you to use SSD1306 (`datasheet `__, `Adafruit `__) and SH1106 (`datasheet `__, `electrodragon `__) -displays with esphomelib. Note that this component is for displays that are connected via the 4-Wire :ref:`SPI bus `. +displays with ESPHome. Note that this component is for displays that are connected via the 4-Wire :ref:`SPI bus `. If your SSD1306 or SH1106 is connected via the :ref:`I²C Bus `, see :doc:`ssd1306_i2c`. .. figure:: images/ssd1306-full.jpg diff --git a/components/display/waveshare_epaper.rst b/components/display/waveshare_epaper.rst index 6953befba..fb1e18ece 100644 --- a/components/display/waveshare_epaper.rst +++ b/components/display/waveshare_epaper.rst @@ -2,12 +2,12 @@ Waveshare E-Paper Display ========================= .. seo:: - :description: Instructions for setting up Waveshare E-Paper displays in esphomelib. + :description: Instructions for setting up Waveshare E-Paper displays in ESPHome. :image: waveshare_epaper.jpg The ``waveshare_epaper`` display platform allows you to use some E-Paper displays sold by `Waveshare `__ -with esphomelib. Similar modules sold by other vendors might also work but not have been tested yet. Currently only +with ESPHome. Similar modules sold by other vendors might also work but not have been tested yet. Currently only single-color E-Ink displays are implemented and of those only a few modules. .. figure:: images/waveshare_epaper-full.jpg @@ -16,12 +16,12 @@ 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 esphomelib 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 integration 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. ==================== ===================== ===================== -**E-Paper Pin** **ESP Pin** **esphomelib Option** +**E-Paper Pin** **ESP Pin** **ESPHome Option** -------------------- --------------------- --------------------- ``VCC`` ``3.3V`` N/A -------------------- --------------------- --------------------- diff --git a/components/esp32_ble_beacon.rst b/components/esp32_ble_beacon.rst index e2df7fa01..04b175f8e 100644 --- a/components/esp32_ble_beacon.rst +++ b/components/esp32_ble_beacon.rst @@ -36,8 +36,8 @@ Advanced options: Setting Up ---------- -First, you'll need to set up the configuration for esphomeyaml. Just copy above configuration and -change the UUID to something unique. For example, you can copy below randomly generated UUID: +First, you'll need to set up the configuration for ESPHome. Just copy the configuration above and +change the UUID to something unique. For example, you can copy this randomly generated UUID: .. raw:: html @@ -55,9 +55,7 @@ change the UUID to something unique. For example, you can copy below randomly ge document.getElementById("ble-uuid").value = guid(); -Then, just compile and flash the ESP32. Note that esphomeyaml needs to increase the size of the code -partitions of the ESP32 because BLE can take up a lot of space. It does this automatically, but you need -to flash the ESP32 via USB when enabling or disabling this component. +Then, just compile and flash the ESP32. When everything is set up correctly, you should see a show up using your iBeacon scanner of choice. On iPhones, this should already work from the bluetooth screen (not tested), on Android, you will need to use an app like diff --git a/components/esp32_ble_tracker.rst b/components/esp32_ble_tracker.rst index 4f66a646e..cd91aca1d 100644 --- a/components/esp32_ble_tracker.rst +++ b/components/esp32_ble_tracker.rst @@ -2,14 +2,14 @@ ESP32 Bluetooth Low Energy Tracker Hub ====================================== .. seo:: - :description: Instructions for setting up ESP32 bluetooth low energy device trackers using esphomelib. + :description: Instructions for setting up ESP32 bluetooth low energy device trackers using ESPHome. :image: bluetooth.png The ``esp32_ble_tracker`` component creates a global hub so that you can track bluetooth low energy devices using your ESP32 node. See :ref:`Setting up devices ` -for information on how you can find out the MAC address of a device and track it using esphomelib. +for information on how you can find out the MAC address of a device and track it using ESPHome. .. code-block:: yaml diff --git a/components/esphomeyaml.rst b/components/esphome.rst similarity index 67% rename from components/esphomeyaml.rst rename to components/esphome.rst index 6177c4a66..85fe965df 100644 --- a/components/esphomeyaml.rst +++ b/components/esphome.rst @@ -1,11 +1,11 @@ -esphomeyaml Core Configuration -============================== +ESPHome Core Configuration +========================== .. seo:: - :description: Instructions for setting up the core esphomeyaml configuration. + :description: Instructions for setting up the core ESPHome configuration. :image: cloud-circle.png -Here you specify some core information that esphomeyaml needs to create +Here you specify some core information that ESPHome needs to create firmwares. Most importantly, this is the section of the configuration where you specify the **name** of the node, the **platform** and **board** you’re using. @@ -13,7 +13,7 @@ where you specify the **name** of the node, the **platform** and .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: name: livingroom platform: ESP32 board: nodemcu-32s @@ -26,8 +26,8 @@ Configuration variables: can use the same name. It can also only contain upper/lowercase characters, digits and underscores. - **platform** (**Required**, string): The platform your board is on, - either ``ESP32`` or ``ESP8266``. See :ref:`esphomeyaml-arduino_version`. -- **board** (**Required**, string): The board esphomeyaml should + either ``ESP32`` or ``ESP8266``. See :ref:`esphome-arduino_version`. +- **board** (**Required**, string): The board ESPHome should specify for platformio. For the ESP32, choose the appropriate one from `this list `__ and use `this list `__ @@ -35,17 +35,15 @@ Configuration variables: Advanced options: -- **esphomelib_version** (*Optional*): The version of the C++ `esphomelib framework `__ - to use. See :ref:`esphomeyaml-esphomelib_version`. +- **esphome_core_version** (*Optional*): The version of the C++ `ESPHome-Core framework `__ + to use. See :ref:`esphome-esphome_core_version`. - **arduino_version** (*Optional*): The version of the arduino framework to link the project against. - See :ref:`esphomeyaml-arduino_version`. -- **build_path** (*Optional*, string): Customize where esphomeyaml will store the build files - for your node. By default, esphomeyaml puts all platformio project files under a folder ``/``, + See :ref:`esphome-arduino_version`. +- **build_path** (*Optional*, string): Customize where ESPHome will store the build files + for your node. By default, ESPHome puts all platformio project files under a folder ``/``, but you can customize this behavior using this option. - **platformio_options** (*Optional*, mapping): Additional options to pass over to platformio in the - platformio.ini file. See :ref:`esphomeyaml-platformio_options`. -- **libraries** (*Optional*, list): Additional `platformio libraries `__ to - include in the build. Mostly for custom code. + platformio.ini file. See :ref:`esphome-platformio_options`. - **use_custom_code** (*Optional*, boolean): Whether to configure the project for writing custom components. This sets up some flags so that custom code should compile correctly - **includes** (*Optional*, list of files): A list of files to include in the main (auto-generated) sketch file @@ -53,91 +51,93 @@ Advanced options: is in. - **libraries** (*Optional*, list of libraries): A list of `platformio libraries `__ to include in the project. See `platformio lib install `__. +- **board_flash_mode** (*Optional*, string): The `SPI flash mode `__ + to use for the board. One of ``qio``, ``qout``, ``dio`` and ``dout``. Defaults to ``dout``. Automations: - **on_boot** (*Optional*, :ref:`Automation `): An automation to perform - when the node starts. See :ref:`esphomeyaml-on_boot`. + when the node starts. See :ref:`esphome-on_boot`. - **on_shutdown** (*Optional*, :ref:`Automation `): An automation to perform - right before the node shuts down. See :ref:`esphomeyaml-on_shutdown`. + right before the node shuts down. See :ref:`esphome-on_shutdown`. - **on_loop** (*Optional*, :ref:`Automation `): An automation to perform - on each ``loop()`` iteration. See :ref:`esphomeyaml-on_loop`. + on each ``loop()`` iteration. See :ref:`esphome-on_loop`. -.. _esphomeyaml-esphomelib_version: +.. _esphome-esphome_core_version: -``esphomelib_version`` +``esphome_core_version`` ---------------------- -With the ``esphomelib_version`` parameter you can tell esphomeyaml which version of the C++ framework +With the ``esphome_core_version`` parameter you can tell ESPHome which version of the C++ framework to use when compiling code. For example, you can configure using the most recent (potentially unstable) -version of esphomelib straight from github. Or you can configure the use of a local copy of esphomelib +version of ESPHome straight from github. Or you can configure the use of a local copy of esphome-core using this configuration option. -First, you can configure the use of either the latest esphomelib stable release (``latest``), +First, you can configure the use of either the latest esphome-core stable release (``latest``), the latest development code from GitHub (``dev``), or a specific version number (``1.8.0``). .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: # ... - # Use the latest esphomelib stable release - esphomelib_version: latest + # Use the latest ESPHome stable release + esphome_core_version: latest # Or use the latest code from github - esphomelib_version: dev + esphome_core_version: dev # Use a specific version number - esphomelib_version: 1.8.0 + esphome_core_version: 1.8.0 -Alternatively, if you want to develop for esphomelib, you can download the -`latest code from GitHub `__, extract the contents, -and point esphomeyaml to your local copy. Then you can modify the esphomelib to your needs or to fix bugs. +Alternatively, if you want to develop for ESPHome, you can download the +`latest code from GitHub `__, extract the contents, +and point ESPHome to your local copy. Then you can modify the ESPHome to your needs or to fix bugs. .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: # ... - # Use a local copy of esphomelib - esphomelib_version: - local: path/to/esphomelib + # Use a local copy of ESPHome + esphome_core_version: + local: path/to/esphome-core -And last, you can make esphomeyaml use a specific branch/commit/tag from a remote git repository: +And last, you can make ESPHome use a specific branch/commit/tag from a remote git repository: .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: # ... # Use a specific commit/branch/tag from a remote repository - esphomelib_version: - # Repository defaults to https://github.com/OttoWinter/esphomelib.git - repository: https://github.com/OttoWinter/esphomelib.git + esphome_core_version: + # Repository defaults to https://github.com/esphome/esphome-core.git + repository: https://github.com/esphome/esphome-core.git branch: master - esphomelib_version: - repository: https://github.com/somebody/esphomelib.git + esphome_core_version: + repository: https://github.com/somebody/esphome-core.git commit: d27bac9263e8a0a5a00672245b38db3078f8992c - esphomelib_version: - repository: https://github.com/OttoWinter/esphomelib.git + esphome_core_version: + repository: https://github.com/esphome/esphome-core.git tag: v1.8.0 -.. _esphomeyaml-arduino_version: +.. _esphome-arduino_version: ``arduino_version`` ------------------- -esphomelib uses the arduino framework internally to handle all low-level interactions like +ESPHome uses the arduino framework internally to handle all low-level interactions like initializing the WiFi driver and so on. Unfortunately, every arduino framework version often has its own quirks and bugs, especially concerning WiFi performance. With the ``arduino_version`` -option you can tell esphomeyaml which arduino framework to use for compiling. +option you can tell ESPHome which arduino framework to use for compiling. .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: # ... # Default: use the recommended version, usually this equals # the latest version. @@ -158,17 +158,11 @@ list of arduino frameworks `here `_ * `2.4.2 `__ (the latest version) * `2.4.1 `__ * `2.4.0 `__ -* `2.3.0 `__ (tasmota uses this) - -.. warning:: - - Over-the-Air update passwords do not work with the arduino framework - version 2.3.0 For the ESP32, there's currently only one arduino framework version: `1.0.0 `__. -.. _esphomeyaml-on_boot: +.. _esphome-on_boot: ``on_boot`` ----------- @@ -178,7 +172,7 @@ is already set up. You can however change this using the ``priority`` parameter. .. code-block:: yaml - esphomeyaml: + esphome: # ... on_boot: priority: -10 @@ -202,7 +196,7 @@ Configuration variables: - See :ref:`Automation `. -.. _esphomeyaml-on_shutdown: +.. _esphome-on_shutdown: ``on_shutdown`` --------------- @@ -217,7 +211,7 @@ too many WiFi/MQTT connection attempts, Over-The-Air updates being applied or th .. code-block:: yaml - esphomeyaml: + esphome: # ... on_shutdown: then: @@ -225,7 +219,7 @@ too many WiFi/MQTT connection attempts, Over-The-Air updates being applied or th Configuration variables: See :ref:`Automation `. -.. _esphomeyaml-on_loop: +.. _esphome-on_loop: ``on_loop`` ----------- @@ -234,19 +228,19 @@ This automation will be triggered on every ``loop()`` iteration (usually around .. code-block:: yaml - esphomeyaml: + esphome: # ... on_loop: then: # do something -.. _esphomeyaml-platformio_options: +.. _esphome-platformio_options: ``platformio_options`` ---------------------- Platformio supports a number of options in its ``platformio.ini`` file. With the ``platformio_options`` -parameter you can tell esphomeyaml what options to pass into the ``env`` section of the platformio file +parameter you can tell ESPHome what options to pass into the ``env`` section of the platformio file (Note you can also do this by editing the ``platformio.ini`` file manually). You can view a full list of platformio options here: https://docs.platformio.org/en/latest/projectconf/section_env.html @@ -254,7 +248,7 @@ You can view a full list of platformio options here: https://docs.platformio.org .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: # ... platformio_options: upload_speed: 115200 diff --git a/components/ethernet.rst b/components/ethernet.rst index baec829a7..b60dcc7d2 100644 --- a/components/ethernet.rst +++ b/components/ethernet.rst @@ -2,7 +2,7 @@ Ethernet Component ================== .. seo:: - :description: Instructions for setting up the Ethernet configuration for your ESP32 node in esphomelib. + :description: Instructions for setting up the Ethernet configuration for your ESP32 node in ESPHome. :image: ethernet.png :keywords: Ethernet, ESP32 @@ -11,7 +11,7 @@ Ethernet Component This integration is experimental as I don't have the hardware to test it (yet). If you can verify it works (or if it doesn't), notify me on `discord `__. -This core esphomelib component sets up ethernet connections for ESP32s. +This core ESPHome component sets up ethernet connections for ESP32s. Ethernet for ESP8266 is not supported. .. code-block:: yaml @@ -59,9 +59,6 @@ Configuration variables: - **dns1** (*Optional*, IPv4 address): The main DNS server to use. - **dns2** (*Optional*, IPv4 address): The backup DNS server to use. -- **hostname** (*Optional*, string): Manually set the hostname of the - node. Can only be 63 long at max and must only contain alphanumeric - characters plus dashes and underscores. - **domain** (*Optional*, string): Set the domain of the node hostname used for uploading. For example, if it's set to ``.local``, all uploads will be sent to ``.local``. Defaults to ``.local``. diff --git a/components/i2c.rst b/components/i2c.rst index 2b4af6c0b..d4ef4eb4d 100644 --- a/components/i2c.rst +++ b/components/i2c.rst @@ -4,7 +4,7 @@ I²C Bus ======= .. seo:: - :description: Instructions for setting up the i2c bus to communicate with 2-wire devices in esphomelib + :description: Instructions for setting up the i2c bus to communicate with 2-wire devices in ESPHome :image: i2c.png :keywords: i2c, iic, bus @@ -29,7 +29,7 @@ Configuration variables: - **scl** (*Optional*, :ref:`config-pin`): The pin for the clock line of the i²c bus. Defaults to the default of your board (usually GPIO22 for ESP32 and GPIO5 for ESP8266). -- **scan** (*Optional*, boolean): If esphomelib should do a search of the i2c address space on startup. +- **scan** (*Optional*, boolean): If ESPHome should do a search of the i2c address space on startup. Note that this can slow down startup and is only recommended for when setting up new sensors. Defaults to ``False``. - **frequency** (*Optional*, float): Set the frequency the i²c bus should operate on. @@ -37,7 +37,7 @@ Configuration variables: .. note:: If you're using the ESP32 and i2c frequently is showing errors in the logs, try with the latest - version of the Arduino framework. See :ref:`esphomeyaml-arduino_version` for information on how to do this. + version of the Arduino framework. See :ref:`esphome-arduino_version` for information on how to do this. See Also -------- diff --git a/components/light/binary.rst b/components/light/binary.rst index 4b0d7af51..63827cc79 100644 --- a/components/light/binary.rst +++ b/components/light/binary.rst @@ -2,7 +2,7 @@ Binary Light ============ .. seo:: - :description: Instructions for setting up binary ON/OFF lights in esphomelib. + :description: Instructions for setting up binary ON/OFF lights in ESPHome. :image: lightbulb.png The ``binary`` light platform creates a simple ON/OFF-only light from a diff --git a/components/light/fastled_clockless.rst b/components/light/fastled_clockless.rst index 8d0dfcd23..31783f3af 100644 --- a/components/light/fastled_clockless.rst +++ b/components/light/fastled_clockless.rst @@ -6,7 +6,7 @@ FastLED Clockless Light :image: color_lens.png The ``fastled_clockless`` light platform allows you to create RGB lights -in esphomelib for a :ref:`number of supported chipsets `. +in ESPHome for a :ref:`number of supported chipsets `. Clockless FastLED lights differ from the :doc:`fastled_spi` in that they only have a single data wire to connect, and not separate data and clock wires. diff --git a/components/light/fastled_spi.rst b/components/light/fastled_spi.rst index 20d13e593..47fc1115e 100644 --- a/components/light/fastled_spi.rst +++ b/components/light/fastled_spi.rst @@ -6,7 +6,7 @@ FastLED SPI Light :image: color_lens.png The ``fastled_spi`` light platform allows you to create RGB lights -in esphomelib for a :ref:`number of supported chipsets `. +in ESPHome for a :ref:`number of supported chipsets `. SPI FastLED lights differ from the :doc:`fastled_clockless` in that they require two pins to be connected, one for a data and one for a clock signal diff --git a/components/light/index.rst b/components/light/index.rst index 395c0f47e..136c93635 100644 --- a/components/light/index.rst +++ b/components/light/index.rst @@ -2,10 +2,10 @@ Light Component =============== .. seo:: - :description: Instructions for setting up lights and light effects in esphomelib. + :description: Instructions for setting up lights and light effects in ESPHome. :image: folder-open.png -The ``light`` domain in esphomeyaml lets you create lights that will +The ``light`` domain in ESPHome lets you create lights that will automatically be shown in Home Assistant’s frontend and have many features such as RGB colors, transitions, flashing and effects. @@ -144,11 +144,11 @@ Configuration options: Light Effects ------------- -esphomelib also offers a bunch of light effects you can use for your lights. The defaults for the -effect parameters are made to work well on their own but of course esphomelib gives you the option to manually change +ESPHome also offers a bunch of light effects you can use for your lights. The defaults for the +effect parameters are made to work well on their own but of course ESPHome gives you the option to manually change these parameters. -With esphomelib's light effects system you're basically creating a bunch of entries for the effects dropdown in +With ESPHome's light effects system you're basically creating a bunch of entries for the effects dropdown in Home Assistant. If you wish to have several variants of the same effect you can of course also create multiple entries with each having a unique name like so: diff --git a/components/light/monochromatic.rst b/components/light/monochromatic.rst index 2ae84c30b..19a17422b 100644 --- a/components/light/monochromatic.rst +++ b/components/light/monochromatic.rst @@ -26,6 +26,12 @@ 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: ------------------------ @@ -40,14 +46,6 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`MQTT Component `. -.. note:: - - The ``monochromatic`` light platform only works with ``float`` - :ref:`outputs ` that can output any light intensity percentage like the - :doc:`ESP32 LEDC ` or - :doc:`ESP8266 PWM ` components and does **not** work with output - platforms like the :doc:`/components/output/gpio`. - See Also -------- diff --git a/components/light/neopixelbus.rst b/components/light/neopixelbus.rst index 4681562de..3468f4f1f 100644 --- a/components/light/neopixelbus.rst +++ b/components/light/neopixelbus.rst @@ -6,7 +6,7 @@ Neopixelbus Light :image: color_lens.png The ``neopixelbus`` light platform allows you to create RGB lights -in esphomelib for a individually addressable lights like NeoPixel or WS2812. +in ESPHome for a individually addressable lights like NeoPixel or WS2812. It is very similar to the :doc:`fastled_clockless` and :doc:`fastled_spi` platforms; in fact most addressable lights are supported through both light platforms. The diff --git a/components/light/rgb.rst b/components/light/rgb.rst index eccfadf4f..e3cf3ecb9 100644 --- a/components/light/rgb.rst +++ b/components/light/rgb.rst @@ -2,7 +2,7 @@ RGB Light ========= .. seo:: - :description: Instructions for setting up RGB lights in esphomelib. + :description: Instructions for setting up RGB lights in ESPHome. :image: rgb.png The ``rgb`` light platform creates an RGB light from 3 :ref:`float output components ` @@ -28,6 +28,13 @@ 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 + Configuration variables: ------------------------ @@ -43,13 +50,6 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`MQTT Component `. -.. note:: - - The RGB light platform only works with ``float`` :ref:`outputs ` that - can output any light intensity percentage like the :doc:`ESP32 LEDC ` or - :doc:`ESP8266 PWM ` components and does **not** work with output - platforms like the :doc:`/components/output/gpio`. - See Also -------- diff --git a/components/logger.rst b/components/logger.rst index b883ac68e..dfc9bd8e1 100644 --- a/components/logger.rst +++ b/components/logger.rst @@ -2,7 +2,7 @@ Logger Component ================ .. seo:: - :description: Instructions for setting up the central logging component in esphomelib. + :description: Instructions for setting up the central logging component in ESPHome. :image: file-document-box.png The logger component automatically logs all log messages through the @@ -50,7 +50,7 @@ Possible log levels are (sorted by severity): - ``WARN`` - With this log level, warnings and errors are logged. Warnings are issues like invalid readings from - sensors that esphomelib can recover from. Color: yellow + sensors that ESPHome can recover from. Color: yellow - ``INFO`` diff --git a/components/mqtt.rst b/components/mqtt.rst index c2fed62b8..dd095eb34 100644 --- a/components/mqtt.rst +++ b/components/mqtt.rst @@ -2,12 +2,12 @@ MQTT Client Component ===================== .. seo:: - :description: Instructions for setting up the MQTT client to communicate with the local network in esphomelib. + :description: Instructions for setting up the MQTT client to communicate with the local network in ESPHome. :image: mqtt.png :keywords: MQTT The MQTT Client Component sets up the MQTT connection to your broker and -is currently required for esphomelib to work. In most cases, you will +is currently required for ESPHome to work. In most cases, you will just be able to copy over the `MQTT section `__ of your Home Assistant configuration. @@ -69,7 +69,7 @@ Configuration variables: MQTTMessage ----------- -With the MQTT Message schema you can tell esphomeyaml how a specific MQTT message should be sent. +With the MQTT Message schema you can tell ESPHome how a specific MQTT message should be sent. It is used in several places like last will and birth messages or MQTT log options. .. code-block:: yaml @@ -110,9 +110,9 @@ The ``log_topic`` has an additional configuration option: Using with Home Assistant ------------------------- -Using esphomelib with Home Assistant is easy, simply setup an MQTT +Using ESPHome with Home Assistant is easy, simply setup an MQTT broker (like `mosquitto `__) and point both your -Home Assistant installation and esphomelib to that broker. Next, enable +Home Assistant installation and ESPHome to that broker. Next, enable discovery in your Home Assistant configuration with the following: .. code-block:: yaml @@ -122,23 +122,22 @@ discovery in your Home Assistant configuration with the following: broker: ... discovery: True -And that should already be it 🎉 All devices defined through -esphomelib/esphomeyaml should show up automatically in the entities -section of Home Assistant. +And that should already be it 🎉 All devices defined through ESPHome should show up automatically +in the entities section of Home Assistant. When adding new entities, you might run into trouble with old entities still appearing in Home Assistant’s front-end. This is because in order to have Home Assistant “discover” your devices on restart, all discovery MQTT messages need to be retained. Therefore the old entities will also re-appear on every Home Assistant restart even though they’re in -esphomeyaml anymore. +ESPHome anymore. -To fix this, esphomeyaml has a simple helper script that purges stale +To fix this, ESPHome has a simple helper script that purges stale retained messages for you: .. code-block:: bash - esphomeyaml configuration.yaml clean-mqtt + esphome configuration.yaml clean-mqtt This will remove all retained messages with the topic ``/+/NODE_NAME/#``. If you want to purge on another @@ -149,7 +148,7 @@ topic, simply add ``--topic `` to the command. Defaults -------- -By default, esphomelib will prefix all messages with your node name or +By default, ESPHome will prefix all messages with your node name or ``topic_prefix`` if you have specified it manually. The client id will automatically be generated by using your node name and adding the MAC address of your device to it. Next, discovery is enabled by default with @@ -158,7 +157,7 @@ Home Assistant’s default prefix ``homeassistant``. If you want to prefix all MQTT messages with a different prefix, like ``home/living_room``, you can specify a custom ``topic_prefix`` in the configuration. That way, you can use your existing wildcards like -``home/+/#`` together with esphomelib. All other features of esphomelib +``home/+/#`` together with ESPHome. All other features of ESPHome (like availability) should still work correctly. .. _mqtt-last_will_birth: @@ -166,7 +165,7 @@ configuration. That way, you can use your existing wildcards like Last Will And Birth Messages ---------------------------- -esphomelib (and esphomeyaml) uses the `last will +ESPHome uses the `last will testament `__ and birth message feature of MQTT to achieve availability reporting for Home Assistant. If the node is not connected to MQTT, Home Assistant @@ -176,7 +175,7 @@ will show all its entities as unavailable (a feature 😉). :align: center :width: 50.0% -By default, esphomelib will send a retained MQTT message to +By default, ESPHome will send a retained MQTT message to ``/status`` with payload ``online``, and will tell the broker to send a message ``/status`` with payload ``offline`` if the connection drops. @@ -215,11 +214,11 @@ update the fingerprints variable. Additionally, SHA1 is known to be partially in and with some computing power the fingerprint can be faked. To get this fingerprint, first put the broker and port options in the configuration and -then run the ``mqtt-fingerprint`` script of esphomeyaml to get the certificate: +then run the ``mqtt-fingerprint`` script of ESPHome to get the certificate: .. code-block:: bash - esphomeyaml livingroom.yaml mqtt-fingerprint + esphome livingroom.yaml mqtt-fingerprint > SHA1 Fingerprint: a502ff13999f8b398ef1834f1123650b3236fc07 > Copy above string into mqtt.ssl_fingerprints section of livingroom.yaml @@ -235,7 +234,7 @@ then run the ``mqtt-fingerprint`` script of esphomeyaml to get the certificate: MQTT Component Base Configuration --------------------------------- -All components in esphomelib that do some sort of communication through +All components in ESPHome that do some sort of communication through MQTT can have some overrides for specific options. .. code-block:: yaml diff --git a/components/my9231.rst b/components/my9231.rst index d916cf57c..d93724fc1 100644 --- a/components/my9231.rst +++ b/components/my9231.rst @@ -2,14 +2,14 @@ MY9231/MY9291 LED driver Component ================================== .. seo:: - :description: Instructions for setting up MY9231 and MY9291 LED drives in esphomelib. + :description: Instructions for setting up MY9231 and MY9291 LED drives in ESPHome. :image: my9231.png :keywords: MY9231, MY9291, Sonoff B1, Ai-thinker AiLight WiFi light bulb, Arilux E27 Smart Bulb The MY9231/MY9291 component represents a MY9231/MY9291 LED diver chain (`MY9231 description `__, `MY9291 description `__) in -esphomelib. Communication is done with two GPIO pins (DI and DCKI) and multiple +ESPHome. Communication is done with two GPIO pins (DI and DCKI) and multiple driver chips can be chained. There are two models with different number of output channels (MY9291 with 4 channels and MY9231 with 3 channels). They are popular driver chips used in smart light blubs: @@ -26,7 +26,7 @@ global ``my9231`` hub and give it an id, and then define the One of the features of the MY9231/MY9291 driver is that the chips remember their state after a power cycling. Unfortunately, the - state of the driver can not be read. Therefore, if esphomelib can + state of the driver can not be read. Therefore, if ESPHome can not restore the previous state, it will result in a mismatch of the driver output and the internal state (= MQTT state). So you can configure the behaviour on boot time: @@ -85,11 +85,10 @@ complete configuration for a Sonoff B1 looks like: .. code-block:: yaml - esphomeyaml: + esphome: name: platform: ESP8266 board: esp01_1m - board_flash_mode: dout wifi: ssid: diff --git a/components/ota.rst b/components/ota.rst index 9d8240b76..df68d0e94 100644 --- a/components/ota.rst +++ b/components/ota.rst @@ -8,26 +8,11 @@ OTA Update Component With the OTA (Over The Air) update component you can upload your firmware binaries to your node without having to use an USB cable for -uploads. esphomeyaml natively supports this through its ``run`` and +uploads. ESPHome natively supports this through its ``run`` and ``upload`` helper scripts. -.. note:: - Please be aware that ESP8266 modules must be reset after a serial - upload before OTA can work. - When you are trying to conduct an OTA update and receive an error message - ``Bad Answer: ERR: ERROR[11]: Invalid bootstrapping`` the reason is - very likely that power-cycling the ESP module is required once after - the serial upload. - - -Optionally, you can also define a password to use for OTA updates so -that an intruder isn’t able to upload any firmware to the ESP without -having hardware access to it. This password is also hashed -automatically, so an intruder can’t extract the password from the -binary. - -esphomelib also supports an “OTA safe mode”. If for some reason your -node gets into a boot loop, esphomelib will automatically try to detect +ESPHome also has an "OTA safe mode". If for some reason your +node gets into a boot loop, ESPHome will automatically try to detect this and will go over into a safe mode after 10 unsuccessful boot attempts. In that mode, all components are disabled and only Serial Logging+WiFi+OTA are initialized, so that you can upload a new binary. @@ -49,14 +34,25 @@ Configuration variables: to ``3232`` for the ESP32 and ``8266`` for the ESP8266. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +.. note:: + + Please be aware that ESP8266 modules must be reset after a serial + upload before OTA can work. + When you are trying to conduct an OTA update and receive an error message + ``Bad Answer: ERR: ERROR[11]: Invalid bootstrapping`` the reason is + very likely that power-cycling the ESP module is required once after + the serial upload. + Updating the password: ---------------------- -Since the password is used both for compiling and uploading the regular ``esphomeyaml run`` won't work of course. This issue can be worked around by executing the operations separately through a ``on_boot`` trigger: +Since the password is used both for compiling and uploading the regular ``esphome run`` +won't work of course. This issue can be worked around by executing the operations separately +through a ``on_boot`` trigger: .. code-block:: yaml - esphomeyaml: + esphome: on_boot: - lambda: |- id(ota).set_auth_password("New password"); @@ -64,17 +60,6 @@ Since the password is used both for compiling and uploading the regular ``esphom password: "Old password" id: ota -.. note:: - - If you get errors like - - .. code:: - - ERROR [esphomeyaml.espota] Failed - ERROR [esphomeyaml.espota] Host livingroom.local Not Found - - when attempting to upload via OTA, please try setting a :ref:`manual IP for WiFi `. - See Also -------- diff --git a/components/output/custom.rst b/components/output/custom.rst index f1fbd38cf..af84ed036 100644 --- a/components/output/custom.rst +++ b/components/output/custom.rst @@ -2,7 +2,7 @@ Custom Output ============= This integration can be used to create custom binary and float :doc:`outputs ` -in esphomelib using the C++ (Arduino) API. +in ESPHome using the C++ (Arduino) API. Please first read :doc:`/components/sensor/custom` guide, the same principles apply here. @@ -11,8 +11,8 @@ same as the :doc:`ESP8266 software PWM output `. .. code-block:: cpp - #include "esphomelib.h" - using namespace esphomelib; + #include "esphome.h" + using namespace esphome; class MyCustomFloatOutput : public Component, public output::FloatOutput { public: @@ -49,7 +49,7 @@ And in YAML: .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: includes: - my_output.h diff --git a/components/output/esp8266_pwm.rst b/components/output/esp8266_pwm.rst index 33dea630c..b8939008e 100644 --- a/components/output/esp8266_pwm.rst +++ b/components/output/esp8266_pwm.rst @@ -6,13 +6,9 @@ ESP8266 Software PWM Output :image: pwm.png The ESP8266 Software PWM platform allows you to use a software PWM on -the pins GPIO0-GPIO16 on your ESP8266. As this is only a software PWM -and not a hardware PWM (like the :doc:`ESP32 LEDC PWM `) and has a key -disadvantage: There can be a noticeable amount of flickering with increased WiFi -activity. - -If you need a stable PWM signal, it’s definitely recommended to use the -successor of the ESP8266, the ESP32, and its :doc:`ESP32 LEDC PWM ` instead. +the pins GPIO0-GPIO16 on your ESP8266. Note that this is a software PWM, +so there can be some flickering during periods of high wifi activity. Hardware PWMs +like the one on the ESP32 (see :doc:`ledc`) are preferred. .. code-block:: yaml @@ -23,6 +19,12 @@ successor of the ESP8266, the ESP32, and its :doc:`ESP32 LEDC PWM ` instea frequency: 1000 Hz id: pwm_output + # Example usage in a light + light: + - platform: monochromatic + output: pwm_output + name: "Kitchen Light" + Configuration variables: ------------------------ diff --git a/components/output/gpio.rst b/components/output/gpio.rst index a277c2c41..98255ad60 100644 --- a/components/output/gpio.rst +++ b/components/output/gpio.rst @@ -7,7 +7,7 @@ GPIO Output The GPIO output component is quite simple: It exposes a single GPIO pin as an output component. Note that output components are **not** switches and -will not show up in Home Assistant. See :doc:`/esphomeyaml/components/switch/gpio`. +will not show up in Home Assistant. See :doc:`/components/switch/gpio`. .. code-block:: yaml diff --git a/components/output/index.rst b/components/output/index.rst index 9fc1e120d..05c506b64 100644 --- a/components/output/index.rst +++ b/components/output/index.rst @@ -4,11 +4,11 @@ Output Component ================ .. seo:: - :description: Instructions for setting up generic outputs in esphomelib + :description: Instructions for setting up generic outputs in ESPHome :image: folder-open.png Each platform of the ``output`` domain exposes some output to -esphomelib. These are grouped into two categories: ``binary`` outputs +ESPHome. These are grouped into two categories: ``binary`` outputs (that can only be ON/OFF) and ``float`` outputs (like PWM, can output any rational value between 0 and 1). diff --git a/components/output/ledc.rst b/components/output/ledc.rst index de7320000..a7420f528 100644 --- a/components/output/ledc.rst +++ b/components/output/ledc.rst @@ -14,9 +14,15 @@ of the ESP32 as an output component. # Example configuration entry output: - platform: ledc - pin: 19 + pin: GPIO19 id: gpio_19 + # Example usage in a light + light: + - platform: monochromatic + output: gpio_19 + name: "Kitchen Light" + Configuration variables: ------------------------ @@ -26,10 +32,13 @@ Configuration variables: channel’s timer. Two LEDC channels always share the same timer and therefore also the same frequency. Defaults to 1000Hz. - **bit_depth** (*Optional*, int): The bit depth to use for the LEDC channel. Defaults to 12. +- 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. -- All other options from :ref:`Output `. See Also -------- diff --git a/components/pca9685.rst b/components/pca9685.rst index 397b2bcc4..9ad6334f8 100644 --- a/components/pca9685.rst +++ b/components/pca9685.rst @@ -8,7 +8,7 @@ PCA9685 PWM Component The PCA9685 component represents a PCA9685 12-bit PWM driver (`datasheet `__, -`adafruit `__) in esphomelib. It +`adafruit `__) in ESPHome. It uses :ref:`I²C Bus ` for communication. To use the channels of this components, you first need to setup the diff --git a/components/pcf8574.rst b/components/pcf8574.rst index 2b110a514..13eb31fa5 100644 --- a/components/pcf8574.rst +++ b/components/pcf8574.rst @@ -2,17 +2,17 @@ PCF8574 I/O Expander ==================== .. seo:: - :description: Instructions for setting up PCA8574 digital port expanders in esphomelib. + :description: Instructions for setting up PCA8574 digital port expanders in ESPHome. :image: pcf8574.jpg :keywords: Xiaomi, Mi Flora, BLE, Bluetooth The PCF8574 component allows you to use PCF8574 or PCF8575 I/O expanders (`datasheet `__, -`Sparkfun`_) in esphomeyaml. It uses :ref:`I²C Bus ` for communication. +`Sparkfun`_) in ESPHome. It uses :ref:`I²C Bus ` for communication. Once configured, you can use any of the 8 pins (PCF8574) or 16 pins (PCF8575) as -pins for your projects. Within esphomelib they emulate a real internal GPIO pin -and can therefore be used with many of esphomelib's components such as the GPIO +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. Any option accepting a :ref:`Pin Schema ` can theoretically be used, but some more diff --git a/components/pn532.rst b/components/pn532.rst index 80de61dc3..2dd645465 100644 --- a/components/pn532.rst +++ b/components/pn532.rst @@ -2,13 +2,13 @@ PN532 NFC/RFID Controller Hub ============================= .. seo:: - :description: Instructions for setting up PN532 NFC tag readers in esphomelib + :description: Instructions for setting up PN532 NFC tag readers in ESPHome :image: pn532.jpg :keywords: PN532, NFC, RFID The ``pn532`` component allows you to use PN532 NFC/RFID controllers (`datasheet `__, `adafruit `__) -with esphomelib. This component is a global hub that establishes the connection to the PN532 via :ref:`SPI ` and +with ESPHome. This component is a global hub that establishes the connection to the PN532 via :ref:`SPI ` and outputs its data. Using the :doc:`PN532 binary sensors ` you can then create individual binary sensors that track if an NFC/RFID tag is currently detected by the PN532. diff --git a/components/rdm6300.rst b/components/rdm6300.rst index a63299d45..6789c57f5 100644 --- a/components/rdm6300.rst +++ b/components/rdm6300.rst @@ -2,13 +2,13 @@ RDM6300 NFC/RFID Hub ==================== .. seo:: - :description: Instructions for setting up RDM6300 NFC/RFID tag readers in esphomelib. + :description: Instructions for setting up RDM6300 NFC/RFID tag readers in ESPHome. :image: rdm6300.jpg :keywords: RDM6300, NFC, RFID The ``rdm6300`` component allows you to use RDM6300 NFC/RFID controllers (`datasheet `__, `iTead `__) -with esphomelib. This component is a global hub that establishes the connection to the RDM6300 via :ref:`UART ` and +with ESPHome. This component is a global hub that establishes the connection to the RDM6300 via :ref:`UART ` and translates the received data. Using the :doc:`RDM6300 binary sensors ` you can then create individual binary sensors that track if an NFC/RFID tag is currently detected by the RDM6300. diff --git a/components/remote_receiver.rst b/components/remote_receiver.rst index 338b6f959..0ac739e05 100644 --- a/components/remote_receiver.rst +++ b/components/remote_receiver.rst @@ -2,7 +2,7 @@ Remote Receiver Component ========================= .. seo:: - :description: Instructions for setting up remote receivers in esphomelib. + :description: Instructions for setting up remote receivers in ESPHome. :image: remote.png :keywords: RF, infrared @@ -35,6 +35,7 @@ Configuration variables: - **samsung**: Decode and dump Samsung infrared codes. - **sony**: Decode and dump Sony infrared codes. - **rc_switch**: Decode and dump RCSwitch RF codes. + - **rc5**: Decode and dump RC5 IR codes. - **raw**: Print all remote codes in their raw form. Useful for using arbitrary protocols. - **tolerance** (*Optional*, int): The percentage that the remote signal lengths can deviate in the diff --git a/components/remote_transmitter.rst b/components/remote_transmitter.rst index 009166664..355ad4bcb 100644 --- a/components/remote_transmitter.rst +++ b/components/remote_transmitter.rst @@ -2,7 +2,7 @@ Remote Transmitter Component ============================ .. seo:: - :description: Instructions for setting up remote transmitters in esphomelib + :description: Instructions for setting up remote transmitters in ESPHome :image: remote.png :keywords: RF, infrared diff --git a/components/sensor/ads1115.rst b/components/sensor/ads1115.rst index cdfc6db0b..c1e29853c 100644 --- a/components/sensor/ads1115.rst +++ b/components/sensor/ads1115.rst @@ -7,7 +7,7 @@ ADS1115 Sensor :keywords: ADS1115 The ``ads1115`` sensor allows you to use your ADS1115 sigma-delta ADC -sensors (`datasheet `__, `Adafruit`_) with esphomelib. +sensors (`datasheet `__, `Adafruit`_) with ESPHome. First, setup a :doc:`ADS1115 Hub ` for your ADS1115 sensor and then use this sensor platform to create individual sensors that will report the voltage to Home Assistant. diff --git a/components/sensor/apds9960.rst b/components/sensor/apds9960.rst index 71ef06024..22c3800fe 100644 --- a/components/sensor/apds9960.rst +++ b/components/sensor/apds9960.rst @@ -7,7 +7,7 @@ APDS9960 Sensor The ``apds9960`` sensor platform allows you to use your APDS9960 RGB and gesture sensors (`datasheet `__, -`Sparkfun`_) with esphomelib. +`Sparkfun`_) with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. diff --git a/components/sensor/bh1750.rst b/components/sensor/bh1750.rst index ded6f43b0..73333b6b9 100644 --- a/components/sensor/bh1750.rst +++ b/components/sensor/bh1750.rst @@ -2,13 +2,13 @@ BH1750 Ambient Light Sensor =========================== .. seo:: - :description: Instructions for setting up BH1750 ambient light sensors in esphomelib. + :description: Instructions for setting up BH1750 ambient light sensors in ESPHome. :image: bh1750.jpg :keywords: BH1750 The ``bh1750`` sensor platform allows you to use your BH1750 (`datasheet `__, `Aliexpress`_, `mklec`_) -ambient light sensor with esphomelib. The :ref:`I²C bus ` is required to be set up in +ambient light sensor with ESPHome. The :ref:`I²C bus ` is required to be set up in your configuration for this sensor to work. .. figure:: images/bh1750-full.jpg diff --git a/components/sensor/bme280.rst b/components/sensor/bme280.rst index cf6e72c6a..d33f6c897 100644 --- a/components/sensor/bme280.rst +++ b/components/sensor/bme280.rst @@ -8,7 +8,7 @@ BME280 Temperature+Pressure+Humidity Sensor The ``bme280`` sensor platform allows you to use your BME280 (`datasheet `__, -`Adafruit`_) temperature, pressure and humidity sensors with esphomelib. The :ref:`I²C ` is +`Adafruit`_) temperature, pressure and humidity sensors with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. .. figure:: images/bme280-full.jpg diff --git a/components/sensor/bme680.rst b/components/sensor/bme680.rst index 560dd0c32..f4e0d58ef 100644 --- a/components/sensor/bme680.rst +++ b/components/sensor/bme680.rst @@ -8,7 +8,7 @@ BME680 Temperature+Pressure+Humidity+Gas Sensor The ``bme680`` sensor platform allows you to use your BME680 (`datasheet `__, -`Adafruit`_) temperature, pressure and humidity sensors with esphomelib. The :ref:`I²C ` is required to be set up in +`Adafruit`_) temperature, pressure and humidity sensors with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. .. figure:: images/bme680-full.jpg diff --git a/components/sensor/bmp085.rst b/components/sensor/bmp085.rst index 96d9ff9ae..298fea206 100644 --- a/components/sensor/bmp085.rst +++ b/components/sensor/bmp085.rst @@ -11,7 +11,7 @@ The BMP085 sensor platform allows you to use your BMP085 `adafruit `__) and BMP180 (`datasheet `__, `adafruit `__) temperature and -pressure sensors with esphomelib. The :ref:`I²C ` is required to be set up in +pressure sensors with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. .. figure:: images/bmp180-full.jpg diff --git a/components/sensor/bmp280.rst b/components/sensor/bmp280.rst index 430577cb7..9028844e0 100644 --- a/components/sensor/bmp280.rst +++ b/components/sensor/bmp280.rst @@ -2,13 +2,13 @@ BMP280 Temperature+Pressure Sensor ================================== .. seo:: - :description: Instructions for setting up BMP280 temperature and pressure sensors with esphomelib + :description: Instructions for setting up BMP280 temperature and pressure sensors with ESPHome :image: bmp280.jpg :keywords: BMP280 The ``bmp280`` sensor platform allows you to use your BMP280 (`datasheet `__, -`Adafruit`_) temperature and pressure sensors with esphomelib. The :ref:`I²C ` is +`Adafruit`_) temperature and pressure sensors with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. .. figure:: images/bmp280-full.jpg diff --git a/components/sensor/cse7766.rst b/components/sensor/cse7766.rst index ddebf4e06..1a6434691 100644 --- a/components/sensor/cse7766.rst +++ b/components/sensor/cse7766.rst @@ -8,7 +8,7 @@ CSE7766 Power Sensor The ``cse7766`` sensor platform allows you to use your CSE7766 voltage/current and power sensors (`datasheet `__) sensors with -esphomelib. This sensor is commonly found in Sonoff POW R2. +ESPHome. This sensor is commonly found in Sonoff POW R2. As the communication with the CSE7766 done using UART, you need to have an :ref:`UART bus ` in your configuration with the ``rx_pin`` connected to the CSE7766. diff --git a/components/sensor/custom.rst b/components/sensor/custom.rst index 1ecfe1b47..3caf08240 100644 --- a/components/sensor/custom.rst +++ b/components/sensor/custom.rst @@ -2,25 +2,25 @@ Custom Sensor Component ======================= .. seo:: - :description: Instructions for setting up Custom C++ sensors with esphomelib. + :description: Instructions for setting up Custom C++ sensors with ESPHome. :image: language-cpp.png :keywords: C++, Custom .. warning:: - While I do try to keep the esphomeyaml configuration options as stable as possible - and back-port them, the esphomelib API is less stable. If something in the APIs needs + 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. -So, you just set up esphomelib for your ESP32/ESP8266, but sadly esphomelib is missing a sensor integration +So, you just set up ESPHome for your ESP32/ESP8266, but sadly ESPHome is missing a sensor integration 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 esphomelib has a really simple API for you to create your own **custom sensors** 🎉 +That's why ESPHome has a really simple API for you to create your own **custom sensors** 🎉 In this guide, we will go through creating a custom sensor component for the `BMP180 `__ pressure sensor (we will only do the pressure part, temperature is more or less the same). During this guide, you will learn how to 1. define a custom sensor -esphomelib can use 2. go over how to register the sensor so that it will be shown inside Home Assistant and -3. leverage an existing arduino library for the BMP180 with esphomelib. +ESPHome can use 2. go over how to register the sensor so that it will be shown inside Home Assistant and +3. leverage an existing arduino library for the BMP180 with ESPHome. .. note:: @@ -39,12 +39,12 @@ before, don't worry, at the end of this guide you can just copy the example sour - learning the intricacies of C++ classes won't be required. Before you can create your own custom sensors, let's first take a look at the basics: How sensors (and components) -are structured in the esphomelib ecosystem. +are structured in the ESPHome ecosystem. -In esphomelib, a **sensor** is some hardware device (like a BMP180) that periodically +In ESPHome, a **sensor** is some hardware device (like a BMP180) that periodically sends out numbers, for example a temperature sensor that periodically publishes its temperature **state**. -Another important abstraction in esphomelib is the concept of a **component**. In esphomelib, +Another important abstraction in ESPHome is the concept of a **component**. In ESPHome, a **component** is an object with a *lifecycle* managed by the :cpp:class:`Application` class. What does this mean? Well if you've coded in Arduino before you might know the two special methods ``setup()`` and ``loop()``. ``setup()`` is called one time when the node boots up and ``loop()`` is called @@ -57,9 +57,9 @@ So, let's now take a look at some code: This is an example of a custom component .. code-block:: cpp - #include "esphomelib.h" + #include "esphome.h" - using namespace esphomelib; + using namespace esphome; class MyCustomSensor : public Component, public sensor::Sensor { public: @@ -71,8 +71,8 @@ So, let's now take a look at some code: This is an example of a custom component } }; -In the first two lines, we're importing esphomelib so you can use the APIs and telling the compiler that -we want to use the esphomelib "namespace" (you don't need to know what this is now, it's basically just +In the first two lines, we're importing ESPHome so you can use the APIs and telling the compiler that +we want to use the esphome "namespace" (you don't need to know what this is now, it's basically just there to have a clean, well-structured codebase). Let's now also take a closer look at this line, which you might not be too used to when writing Arduino code: @@ -120,7 +120,7 @@ just :cpp:class:`Component`. Additionally, we now have a new line: the construct know much about constructors here, so to simplify let's just say this is where we "initialize" the custom sensor. In this constructor we're telling the compiler that we want :cpp:class:`PollingComponent` to be instantiated with an -*update interval* of 15s, or 15000 milliseconds (esphomelib uses milliseconds internally). +*update interval* of 15s, or 15000 milliseconds (ESPHome uses milliseconds internally). Let's also now make our sensor actually publish values in the ``update()`` method: @@ -134,7 +134,7 @@ Let's also now make our sensor actually publish values in the ``update()`` metho }; Every time ``update`` is called we will now **publish** a new value to the frontend. -The rest of esphomelib will then take care of processing this value and ultimately publishing it +The rest of ESPHome will then take care of processing this value and ultimately publishing it to the outside world (for example using MQTT). Step 2: Registering the custom sensor @@ -145,11 +145,11 @@ Actually ... it does nothing because it's never included nor instantiated. First, create a new file called ``my_custom_sensor.h`` in your configuration directory and copy the source code from above into that file. -Then in the YAML config, *include* that file in the top-level ``esphomeyaml`` section like this: +Then in the YAML config, *include* that file in the top-level ``esphome`` section like this: .. code-block:: yaml - esphomeyaml: + esphome: # ... [Other options] includes: - my_custom_sensor.h @@ -172,14 +172,14 @@ Next, create a new ``custom`` sensor platform entry like this: Let's break this down: - First, we specify a :ref:`lambda ` that will be used to **instantiate** our sensor class. This will - be called on boot to register our sensor in esphomelib. + be called on boot to register our sensor in ESPHome. - In this lambda, we're first creating a new instance of our custom class (``new MyCustomSensor()``) and then assigning it to a variable called ``my_sensor``. Note: This uses a feature in the C++ standard, ``auto``, to make our lives easier. We could also have written ``MyCustomSensor *my_sensor = new MyCustomSensor()`` -- Next, as our custom class inherits from Component, we need to **register** it - otherwise esphomelib will not know +- Next, as our custom class inherits from Component, we need to **register** it - otherwise ESPHome will not know about it and won't call our ``setup()`` and ``update`` methods! - Finally, we ``return`` the custom sensor - don't worry about the curly braces ``{}``, we'll cover that later. -- After that, we just let *esphomeyaml* know about our newly created sensor too using the ``sensors:`` block. Additionally, +- After that, we just let ESPHome know about our newly created sensor too using the ``sensors:`` block. Additionally, here we're also assigning the sensor a name. Now all that's left to do is upload the code and let it run :) @@ -196,7 +196,7 @@ Step 3: BMP180 support Let's finally make this custom sensor useful by adding the BMP180 aspect into it! Sure, printing ``42`` is a nice number but it won't help with home automation :D -A great feature of esphomelib is that you don't need to code everything yourself. You can use any existing arduino +A great feature of ESPHome is that you don't need to code everything yourself. You can use any existing arduino library to do the work for you! Now for this example we'll use the `Adafruit BMP085 Library `__ library to implement support for the BMP085 sensor. But you can find other libraries too on the @@ -207,7 +207,7 @@ in your global ``libraries``: .. code-block:: yaml - esphomeyaml: + esphome: includes: - my_custom_sensor.h libraries: @@ -217,10 +217,10 @@ Next, include the library at the top of your custom sensor file you created prev .. code-block:: cpp - #include "esphomelib.h" + #include "esphome.h" #include "Adafruit_BMP085.h" - using namespace esphomelib; + using namespace esphome; // ... @@ -255,7 +255,7 @@ we will communicate with the sensor. In our custom ``setup()`` function we're *initializing* the library (using ``.begin()``) and in ``update()`` we're reading the pressure and publishing it using ``publish_state``. -For esphomeyaml we can use the previous YAML. So now if you upload the firmware, you'll see the sensor +For ESPHome we can use the previous YAML. So now if you upload the firmware, you'll see the sensor reporting actual pressure values! Hooray 🎉! Step 4: Additional Overrides @@ -263,10 +263,10 @@ Step 4: Additional Overrides There's a slight problem with our code: It does print the values fine, **but** if you look in Home Assistant you'll see a) the value has no **unit** attached to it and b) the value will be rounded to the next integer. -This is because esphomelib doesn't know these infos, it's only passed a floating point value after all. +This is because ESPHome doesn't know these infos, it's only passed a floating point value after all. We *could* fix that in our custom sensor class (by overriding the ``unit_of_measurement`` and ``accuracy_decimals`` -methods), but here we have the full power of esphomeyaml, so let's use that: +methods), but here we have the full power of ESPHome, so let's use that: .. code-block:: yaml @@ -290,7 +290,7 @@ Bonus: Sensors With Multiple Output Values The ``Sensor`` class doesn't fit every use-case. Sometimes, (as with the BMP180), a sensor can expose multiple values (temperature *and* pressure, for example). -Doing so in esphomelib is a bit more difficult. Basically, we will have to change our sensor +Doing so in ESPHome is a bit more difficult. Basically, we will have to change our sensor model to have a **component** that reads out the values and then multiple **sensors** that represent the individual sensor measurements. @@ -350,7 +350,7 @@ Our YAML configuration needs an update too: unit_of_measurement: hPa accuracy_decimals: 2 -In ``lambda`` the return statement has changed: Because we have *two* sensors now we must tell esphomeyaml +In ``lambda`` the return statement has changed: Because we have *two* sensors now we must tell ESPHome about both of them. We do this by returning them as an array of values in the curly braces. ``sensors:`` has also changed a bit: Now that we have multiple sensors, each of them needs an entry here. diff --git a/components/sensor/dht.rst b/components/sensor/dht.rst index b216a9855..69b003b7d 100644 --- a/components/sensor/dht.rst +++ b/components/sensor/dht.rst @@ -15,7 +15,7 @@ The DHT Temperature+Humidity sensor allows you to use your DHT11 `adafruit `__) and RHT03 (`datasheet `__, `sparkfun `__) -sensors with esphomelib. +sensors with ESPHome. .. figure:: images/dht-full.jpg :align: center diff --git a/components/sensor/dht12.rst b/components/sensor/dht12.rst index cb8e51bce..c4418a3da 100644 --- a/components/sensor/dht12.rst +++ b/components/sensor/dht12.rst @@ -8,7 +8,7 @@ DHT12 Temperature+Humidity Sensor The ``dht12`` Temperature+Humidity sensor allows you to use your DHT12 (`datasheet `__, -`electrodragon`_) i2c-based sensor with esphomelib. This sensor is also called AM2320 by some sellers. +`electrodragon`_) i2c-based sensor with ESPHome. This sensor is also called AM2320 by some sellers. .. figure:: images/dht12-full.jpg :align: center diff --git a/components/sensor/duty_cycle.rst b/components/sensor/duty_cycle.rst index 01f145c42..4ad881cd6 100644 --- a/components/sensor/duty_cycle.rst +++ b/components/sensor/duty_cycle.rst @@ -2,7 +2,7 @@ Duty Cycle Sensor ================= .. seo:: - :description: Instructions for setting up duty cycle sensors in esphomelib + :description: Instructions for setting up duty cycle sensors in ESPHome :image: percent.png The duty cycle sensor allows you to measure for what percentage of time a signal diff --git a/components/sensor/esp32_hall.rst b/components/sensor/esp32_hall.rst index d7ed7ec4d..c934066e0 100644 --- a/components/sensor/esp32_hall.rst +++ b/components/sensor/esp32_hall.rst @@ -42,7 +42,7 @@ Configuration variables: Therefore the values could very well be off by orders of magnitude. Besides, this sensor should only be used to detect sudden high changes in the magnetic field. - If you have a real magnetic field calibration setup and want to contribute your values to esphomelib, + If you have a real magnetic field calibration setup and want to contribute your values to ESPHome, please feel free to do so 😺. See Also diff --git a/components/sensor/hdc1080.rst b/components/sensor/hdc1080.rst index a3026ee5a..e4b6ca460 100644 --- a/components/sensor/hdc1080.rst +++ b/components/sensor/hdc1080.rst @@ -9,7 +9,7 @@ HDC1080 Temperature+Humidity Sensor The HDC1080 Temperature+Humidity sensor allows you to use your HDC1080 (`datasheet `__, `adafruit `__) sensors with -esphomelib. The :ref:`I²C Bus ` is +ESPHome. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. .. figure:: images/hdc1080-full.jpg diff --git a/components/sensor/hlw8012.rst b/components/sensor/hlw8012.rst index 26958bd66..4cb8c7b77 100644 --- a/components/sensor/hlw8012.rst +++ b/components/sensor/hlw8012.rst @@ -8,13 +8,13 @@ HLW8012 Power Sensor The ``hlw8012`` sensor platform allows you to use your HLW8012 voltage/current and power sensors (`datasheet `__) sensors with -esphomelib. This sensor is commonly found in Sonoff POWs. +ESPHome. This sensor is commonly found in Sonoff POWs. 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 the SEL pin, one can choose between which mode to use. -esphomelib will continuously cycle the state of the SEL pin to measure current *and* voltage, though both cannot +ESPHome will continuously cycle the state of the SEL pin to measure current *and* voltage, though both cannot be measured at the same exact points in time. .. code-block:: yaml diff --git a/components/sensor/hmc5883l.rst b/components/sensor/hmc5883l.rst index 36ac83129..99735f464 100644 --- a/components/sensor/hmc5883l.rst +++ b/components/sensor/hmc5883l.rst @@ -9,7 +9,7 @@ HMC5883L Magnetometer The ``hmc5883l`` allows you to use your HMC5883L triple-axis magnetometers (`datasheet `__, `Adafruit`_) with -esphomelib. The :ref:`I²C Bus ` is +ESPHome. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. .. _Adafruit: https://www.adafruit.com/product/1746 diff --git a/components/sensor/homeassistant.rst b/components/sensor/homeassistant.rst index 1e65c3e65..1451dd985 100644 --- a/components/sensor/homeassistant.rst +++ b/components/sensor/homeassistant.rst @@ -2,7 +2,7 @@ Homeassistant Sensor ==================== .. seo:: - :description: Instructions for setting up homeassistant sensors with esphomelib that import states from your homeassistant instance. + :description: Instructions for setting up homeassistant sensors with ESPHome that import states from your homeassistant instance. :image: home-assistant.png The ``homeassistant`` sensor platform allows you to create a sensors that import diff --git a/components/sensor/htu21d.rst b/components/sensor/htu21d.rst index 7f7d596b2..5a90e972a 100644 --- a/components/sensor/htu21d.rst +++ b/components/sensor/htu21d.rst @@ -9,7 +9,7 @@ HTU21D Temperature+Humidity Sensor The HTU21D Temperature+Humidity sensor allows you to use your HTU21D (`datasheet `__, `adafruit `__) sensors with -esphomelib. The :ref:`I²C Bus ` is +ESPHome. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. .. figure:: images/htu21d-full.jpg diff --git a/components/sensor/hx711.rst b/components/sensor/hx711.rst index 12ca022fb..e314ba02d 100644 --- a/components/sensor/hx711.rst +++ b/components/sensor/hx711.rst @@ -2,13 +2,13 @@ HX711 Load Cell Amplifier ========================= .. seo:: - :description: Instructions for setting up HX711 load cell amplifiers with esphomelib + :description: Instructions for setting up HX711 load cell amplifiers with ESPHome :image: hx711.png :keywords: HX711 The ``hx711`` sensor platform allows you to use your HX711 load cell amplifier -(`datasheet `__, `Sparkfun`_) with esphomelib +(`datasheet `__, `Sparkfun`_) with ESPHome .. figure:: images/hx711-full.jpg :align: center diff --git a/components/sensor/ina219.rst b/components/sensor/ina219.rst index 4d25ea48d..2c4f809b8 100644 --- a/components/sensor/ina219.rst +++ b/components/sensor/ina219.rst @@ -9,7 +9,7 @@ INA219 DC Current Sensor The ``ina219`` sensor platform allows you to use your INA219 High Side DC Current Sensor (`datasheet `__, `Adafruit`_) sensors with -esphomelib. The :ref:`I²C Bus ` is +ESPHome. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. @@ -50,9 +50,9 @@ Configuration variables: - **address** (*Optional*, int): Manually specify the i^2c address of the sensor. Defaults to ``0x40``. - **shunt_resistance** (*Optional*, float): The value of the shunt resistor on the board for current calculation. Defaults to ``0.1 ohm``. -- **max_voltage** (*Optional*, float): The maximum bus voltage you are expecting. esphomelib will use this to +- **max_voltage** (*Optional*, float): The maximum bus voltage you are expecting. ESPHome will use this to configure the sensor optimally. Defaults to ``32V`` (the max). -- **max_current** (*Optional*, float): The maximum current you are expecting. esphomelib will use this to +- **max_current** (*Optional*, float): The maximum current you are expecting. ESPHome will use this to configure the sensor optimally. Defaults to ``3.2A``. - **current** (*Optional*): Use the current value of the sensor in amperes. All options from :ref:`Sensor ` and :ref:`MQTT Component `. diff --git a/components/sensor/ina3221.rst b/components/sensor/ina3221.rst index 735a356de..9e0a0150c 100644 --- a/components/sensor/ina3221.rst +++ b/components/sensor/ina3221.rst @@ -9,7 +9,7 @@ INA3221 3-Channel DC Current Sensor The ``ina3221`` sensor platform allows you to use your INA3221 3-Channel DC Current Sensor (`datasheet `__, `switchdoc`_) sensors with -esphomelib. The :ref:`I²C Bus ` is +ESPHome. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. diff --git a/components/sensor/index.rst b/components/sensor/index.rst index aa503864f..cec9fb2bd 100644 --- a/components/sensor/index.rst +++ b/components/sensor/index.rst @@ -2,10 +2,10 @@ Sensor Component ================ .. seo:: - :description: Instructions for setting up sensor components in esphomelib. + :description: Instructions for setting up sensor components in ESPHome. :image: folder-open.png -esphomelib has support for many different sensors. Each of them is a +ESPHome has support for many different sensors. Each of them is a platform of the ``sensor`` domain and each sensor has several base configuration options. @@ -14,7 +14,7 @@ configuration options. Base Sensor Configuration ------------------------- -All sensors in esphomeyaml/esphomelib have a name and some other +All sensors in ESPHome have a name and some other optional configuration options. By default, the sensor platform will chose appropriate values for all of these by default, but you can always override them if you want to. @@ -81,13 +81,9 @@ Automations: Sensor Filters -------------- -esphomeyaml/esphomelib allow you to do some basic pre-processing of +ESPHome allows you to do some basic pre-processing of sensor values before they’re sent to Home Assistant. This is for example -useful if you want to apply some average over the last few values to -relief Home Assistant’s state machine and keep the history graphs in the -front-end a bit more clean. More sophisticated filters should be done -with Home Assistant's `filter -sensor `__. +useful if you want to apply some average over the last few values. .. code-block:: yaml @@ -178,7 +174,7 @@ Example: Converting Celsius to Fahrenheit While I personally don’t like the Fahrenheit temperature scale, I do understand that having temperature values appear in the fahrenheit unit -is quite useful to some users. esphomelib uses the celsius temperature +is quite useful to some users. ESPHome uses the celsius temperature unit internally, and I’m not planning on making converting between the two simple (😉), but you can use this filter to convert celsius values to fahrenheit. diff --git a/components/sensor/max31855.rst b/components/sensor/max31855.rst index 417d0d2a8..a79b5bc47 100644 --- a/components/sensor/max31855.rst +++ b/components/sensor/max31855.rst @@ -6,7 +6,7 @@ MAX31855 K-Type Thermocouple Temperature Sensor :image: max31855.jpg The ``max31855`` temperature sensor allows you to use your max31855 thermocouple -temperature sensor (`datasheet `__) with esphomelib +temperature sensor (`datasheet `__) with ESPHome As the communication with the MAX66775 is done using SPI, you need to have an :ref:`spi bus ` in your configuration with the **miso_pin** set (mosi is not required). diff --git a/components/sensor/max6675.rst b/components/sensor/max6675.rst index c045dfddd..91f269858 100644 --- a/components/sensor/max6675.rst +++ b/components/sensor/max6675.rst @@ -6,7 +6,7 @@ MAX6675 K-Type Thermocouple Temperature Sensor :image: max6675.jpg The ``max6675`` temperature sensor allows you to use your max6675 thermocouple -temperature sensor (`datasheet `__, `sainsmart`_) with esphomelib +temperature sensor (`datasheet `__, `sainsmart`_) with ESPHome .. figure:: images/max6675-full.jpg :align: center diff --git a/components/sensor/mhz19.rst b/components/sensor/mhz19.rst index 8d45f643c..cd4551848 100644 --- a/components/sensor/mhz19.rst +++ b/components/sensor/mhz19.rst @@ -7,7 +7,7 @@ MH-Z19 CO_2 and Temperature Sensor :keywords: mh-z19 The ``mhz19`` sensor platform allows you to use MH-Z19 CO_2 and temperature sensors -(`refspace`_) with esphomelib. +(`refspace`_) with ESPHome. .. figure:: images/mhz19-full.jpg :align: center diff --git a/components/sensor/misc/custom-empty.h b/components/sensor/misc/custom-empty.h index 04786e356..b1bfe4cc9 100644 --- a/components/sensor/misc/custom-empty.h +++ b/components/sensor/misc/custom-empty.h @@ -1,6 +1,6 @@ -#include "esphomelib.h" +#include "esphome.h" -using namespace esphomelib; +using namespace esphome; class MyCustomSensor : public PollingComponent, public sensor::Sensor { public: diff --git a/components/sensor/mpu6050.rst b/components/sensor/mpu6050.rst index fc114dbf5..7a8e7528a 100644 --- a/components/sensor/mpu6050.rst +++ b/components/sensor/mpu6050.rst @@ -8,7 +8,7 @@ MPU6050 Accelerometer/Gyroscope Sensor The ``mpu6050`` sensor platform allows you to use your MPU6050 Accelerometer/Gyroscope (`datasheet `__, `Sparkfun`_) sensors with -esphomelib. The :ref:`I²C Bus ` is +ESPHome. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. This component only does some basic filtering and no calibration. Due to the complexity of diff --git a/components/sensor/mqtt_subscribe.rst b/components/sensor/mqtt_subscribe.rst index 8a53cb411..aa7d29be9 100644 --- a/components/sensor/mqtt_subscribe.rst +++ b/components/sensor/mqtt_subscribe.rst @@ -6,13 +6,13 @@ MQTT Subscribe Sensor :image: mqtt.png :keywords: MQTT -The ``mqtt_subscribe`` sensor platform allows you to get external data into esphomelib. +The ``mqtt_subscribe`` sensor platform allows you to get external data into ESPHome. 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 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 esphomelib ecosystem. +text sensor for importing arbitrary text into the ESPHome ecosystem. .. code-block:: yaml diff --git a/components/sensor/ms5611.rst b/components/sensor/ms5611.rst index a40154eac..25f4ce1da 100644 --- a/components/sensor/ms5611.rst +++ b/components/sensor/ms5611.rst @@ -8,7 +8,7 @@ MS5611 Atmospheric Pressure Sensor The ``ms5611`` sensor platform allows you to use your MS5611 atmospheric pressure sensors (`datasheet `__, -`hobbytronics`_) temperature and pressure sensors with esphomelib. The :ref:`I²C ` is +`hobbytronics`_) temperature and pressure sensors with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. .. figure:: images/ms5611-full.jpg diff --git a/components/sensor/pmsx003.rst b/components/sensor/pmsx003.rst index 3acdbaa4d..755a9826c 100644 --- a/components/sensor/pmsx003.rst +++ b/components/sensor/pmsx003.rst @@ -12,7 +12,7 @@ PMSX003 Particulate Matter Sensor The ``pmsx003`` sensor platform allows you to use your PMS5003, PMS7003, ... particulate matter (`datasheet `__) -sensors with esphomelib. +sensors with ESPHome. As the communication with the PMSX003 is done using UART, you need to have an :ref:`UART bus ` in your configuration with the ``rx_pin`` connected to the SEND/TX pin diff --git a/components/sensor/rotary_encoder.rst b/components/sensor/rotary_encoder.rst index 641c6cc1b..a1760b00e 100644 --- a/components/sensor/rotary_encoder.rst +++ b/components/sensor/rotary_encoder.rst @@ -6,7 +6,7 @@ Rotary Encoder Sensor :image: rotary_encoder.jpg The ``rotary_encoder`` sensor platform allows you to use any continuous-rotation -rotary encoders with esphomeyaml. These devices usually have two pins with which +rotary encoders with ESPHome. These devices usually have two pins with which they encode the rotation. Every time the knob of the rotary encoder is turned, the signals of the two pins go HIGH and LOW in turn. See `this Arduino article `__ to gain @@ -23,7 +23,7 @@ a better understanding of these sensors. :align: center :width: 75.0% -To use rotary encoders in esphomeyaml, first identify the two pins encoding th step value. +To use rotary encoders in ESPHome, first identify the two pins encoding th step value. These are often called ``CLK`` and ``DT`` as in above image. Note if the values this sensor outputs go in the wrong direction, you can just swap these two pins. @@ -54,7 +54,7 @@ Debouncing Output ----------------- This sensor can output a lot of values in a short period of time when turning the knob. -In order to not put too much stress on your network connection, you can leverage esphomelib's +In order to not put too much stress on your network connection, you can leverage ESPHome's sensor filters. The following will only send out values if the last input value is at least 0.1s seconds old *or* if the new rotary encoder value has changed by 10 from the previous value. diff --git a/components/sensor/sht3xd.rst b/components/sensor/sht3xd.rst index fee18035b..948b34984 100644 --- a/components/sensor/sht3xd.rst +++ b/components/sensor/sht3xd.rst @@ -8,7 +8,7 @@ SHT3X-D Temperature+Humidity Sensor The ``sht3xd`` sensor platform Temperature+Humidity sensor allows you to use your Sensiron SHT31-D (`datasheet `__, `Adafruit`_ ) sensors with -esphomelib. The :ref:`I²C Bus ` is +ESPHome. The :ref:`I²C Bus ` is required to be set up in your configuration for this sensor to work. .. _Adafruit: https://www.adafruit.com/product/2857 diff --git a/components/sensor/tcs34725.rst b/components/sensor/tcs34725.rst index 0ca4679c4..5df530a61 100644 --- a/components/sensor/tcs34725.rst +++ b/components/sensor/tcs34725.rst @@ -8,7 +8,7 @@ TCS34725 RGB Color Sensor The ``tcs34725`` sensor platform allows you to use your TCS34725 RGB color sensors (`datasheet `__, -`Adafruit`_) temperature and pressure sensors with esphomelib. The :ref:`I²C ` is +`Adafruit`_) temperature and pressure sensors with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. .. figure:: images/tcs34725-full.jpg diff --git a/components/sensor/template.rst b/components/sensor/template.rst index 327b146c0..3396b73f0 100644 --- a/components/sensor/template.rst +++ b/components/sensor/template.rst @@ -2,7 +2,7 @@ Template Sensor =============== .. seo:: - :description: Instructions for setting up template sensors with esphomelib. + :description: Instructions for setting up template sensors with ESPHome. :image: description.png The ``template`` sensor platform allows you to create a sensor with templated values @@ -40,14 +40,46 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor ` and :ref:`MQTT Component `. +.. _sensor-template-publish_action: + +``sensor.template.publish`` Action +---------------------------------- + +You can also publish a state to a template sensor from elsewhere in your YAML file +with the ``sensor.template.publish`` action. + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: template + name: "Template Sensor" + id: template_sens + + # in some trigger + on_...: + - sensor.template.publish: + id: template_sens + state: 42.0 + + # Templated + - sensor.template.publish: + id: template_sens + state: !lambda 'return 42.0;' + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the template sensor. +- **state** (**Required**, float, :ref:`templatable `): + The state to publish. + .. note:: - You can use the ``publish_state()`` method to set the value of a template - sensor from other automations: + This action can also be written in lambdas: .. code-block:: cpp - id(my_sensor).publish_state(42.0); + id(template_sens).publish_state(42.0); See Also -------- diff --git a/components/sensor/tsl2561.rst b/components/sensor/tsl2561.rst index 58fbd820e..6ebe3973b 100644 --- a/components/sensor/tsl2561.rst +++ b/components/sensor/tsl2561.rst @@ -2,14 +2,14 @@ TSL2561 Ambient Light Sensor ============================ .. seo:: - :description: Instructions for setting up TSL2561 ambient light sensors in esphomelib. + :description: Instructions for setting up TSL2561 ambient light sensors in ESPHome. :image: tsl2561.jpg :keywords: TSL2561 The ``tsl2561`` sensor platform allows you to use your TSL2561 (`datasheet `__, `Adafruit`_) -ambient light sensor with esphomelib. The :ref:`I²C ` is required to be set up in +ambient light sensor with ESPHome. The :ref:`I²C ` is required to be set up in your configuration for this sensor to work. .. figure:: images/tsl2561-full.jpg diff --git a/components/sensor/ultrasonic.rst b/components/sensor/ultrasonic.rst index 03ad09346..e318127a7 100644 --- a/components/sensor/ultrasonic.rst +++ b/components/sensor/ultrasonic.rst @@ -2,14 +2,14 @@ Ultrasonic Distance Sensor ========================== .. seo:: - :description: Instructions for setting up ultrasonic distance measurement sensors in esphomelib. + :description: Instructions for setting up ultrasonic distance measurement sensors in ESPHome. :image: ultrasonic.jpg :keywords: ultrasonic, hc-sr04 The ultrasonic distance sensor allows you to use simple ultrasonic sensors like the HC-SR04 (`datasheet `__, -`sparkfun `__) with esphomelib +`sparkfun `__) with ESPHome to measure distances. These sensors usually can’t measure anything more than about two meters and may sometimes make some annoying clicking sounds. diff --git a/components/sensor/xiaomi_miflora.rst b/components/sensor/xiaomi_miflora.rst index b4a4948f4..a51d0f969 100644 --- a/components/sensor/xiaomi_miflora.rst +++ b/components/sensor/xiaomi_miflora.rst @@ -2,14 +2,14 @@ Xiaomi MiFlora BLE Sensor ========================= .. seo:: - :description: Instructions for setting up Xiaomi Mi Flora bluetooth-based plant monitors in esphomelib. + :description: Instructions for setting up Xiaomi Mi Flora bluetooth-based plant monitors in ESPHome. :image: xiaomi_miflora.jpg :keywords: Xiaomi, Mi Flora, BLE, Bluetooth The ``xiaomi_miflora`` sensor platform lets you track the output of Xiaomi MiFlora Bluetooth Low Energy devices using the :doc:`/components/esp32_ble_tracker`. This component will track the temperature, humidity and optionally the battery level of the MiFlora device every time the sensor -sends out a BLE broadcast. Note that contrary to other implementations, esphomelib can track as many +sends out a BLE broadcast. Note that contrary to other implementations, ESPHome can track as many MiFlora devices at once as you want. .. code-block:: yaml @@ -71,7 +71,7 @@ Setting Up Devices Before you can even scan for the MiFlora sensor, you need to activate it using the Flower Care app. Set it up there and you'll be able to discover it. -To set up Xiaomi MiFlora devices you first need to find their MAC Address so that esphomelib can +To set up Xiaomi MiFlora devices you first need to find their MAC Address so that ESPHome can identify them. So first, create a simple configuration without any ``xiaomi_miflora`` entries like so: .. code-block:: yaml diff --git a/components/sensor/xiaomi_mijia.rst b/components/sensor/xiaomi_mijia.rst index fe21a1bee..45f29cb57 100644 --- a/components/sensor/xiaomi_mijia.rst +++ b/components/sensor/xiaomi_mijia.rst @@ -2,14 +2,14 @@ Xiaomi MiJia BLE Sensor ======================= .. seo:: - :description: Instructions for setting up Xiaomi Mi Jia bluetooth-based temperature and humidity sensors in esphomelib. + :description: Instructions for setting up Xiaomi Mi Jia bluetooth-based temperature and humidity sensors in ESPHome. :image: xiaomi_miflora.jpg :keywords: Xiaomi, Mi Jia, BLE, Bluetooth The ``xiaomi_mijia`` sensor platform lets you track the output of Xiaomi MiJia Bluetooth Low Energy devices using the :doc:`/components/esp32_ble_tracker`. This component will track the temperature, humidity and optionally the battery level of the MiJia device every time the sensor -sends out a BLE broadcast. Note that contrary to other implementations, esphomelib can track as many +sends out a BLE broadcast. Note that contrary to other implementations, ESPHome can track as many MiJia devices at once as you want. .. figure:: images/xiaomi_mijia-full.jpg @@ -63,7 +63,7 @@ Configuration variables: Setting Up Devices ------------------ -To set up Xiaomi MiJia devices you first need to find their MAC Address so that esphomelib can +To set up Xiaomi MiJia devices you first need to find their MAC Address so that ESPHome can identify them. So first, create a simple configuration without any ``xiaomi_mijia`` entries like so: .. code-block:: yaml diff --git a/components/spi.rst b/components/spi.rst index 72f38fa92..4ac1b66a2 100644 --- a/components/spi.rst +++ b/components/spi.rst @@ -4,7 +4,7 @@ SPI Bus ======= .. seo:: - :description: Instructions for setting up an SPI bus in esphomelib + :description: Instructions for setting up an SPI bus in ESPHome :image: spi.png :keywords: SPI @@ -21,7 +21,7 @@ SPI is a very common high-speed protocol for a lot of devices. The SPI bus usual In some cases one of **MOSI** or **MISO** do not exist as the receiving device only accepts data or sends data. -To set up SPI devices in esphomelib, you first need to place a top-level SPI hub like below which defines what pins to +To set up SPI devices in ESPHome, you first need to place a top-level SPI hub like below which defines what pins to use for the functions described above. The **CS** pins are then individually managed by the components. The ``spi:`` component also accepts a list of buses if you want to have multiple SPI buses with your ESP (though this should rarely be necessary, as the SPI bus can be shared by the devices). diff --git a/components/status_led.rst b/components/status_led.rst index ddd23d77c..c092525ca 100644 --- a/components/status_led.rst +++ b/components/status_led.rst @@ -2,16 +2,16 @@ Status LED ========== .. seo:: - :description: Instructions for setting up status LEDs in esphomelib to monitor the status of an ESP. + :description: Instructions for setting up status LEDs in ESPHome to monitor the status of an ESP. :image: led-on.png -The ``status_led`` hooks into all esphomelib components and can indicate the status of +The ``status_led`` hooks into all ESPHome components and can indicate the status of 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. - Blink quickly (multiple times per second) when an **error** is active. Errors indicate that - esphomelib has found an error while setting up. In most cases, esphomelib will still try to + 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. - Stay off otherwise. diff --git a/components/stepper/index.rst b/components/stepper/index.rst index 323fb6dae..56aac90d1 100644 --- a/components/stepper/index.rst +++ b/components/stepper/index.rst @@ -2,11 +2,11 @@ Stepper Component ================= .. seo:: - :description: Instructions for setting up stepper motor drivers in esphomelib + :description: Instructions for setting up stepper motor drivers in ESPHome :image: folder-open.png :keywords: stepper motor, stepper driver, a4988 -The ``stepper`` component allows you to use stepper motors with esphomelib. +The ``stepper`` component allows you to use stepper motors with ESPHome. Currently only the A4988 stepper driver (`datasheet `__) and ULN2003 (`datasheet `__) are supported. diff --git a/components/switch/custom.rst b/components/switch/custom.rst index b1bbbd24a..25464e173 100644 --- a/components/switch/custom.rst +++ b/components/switch/custom.rst @@ -1,7 +1,7 @@ Custom Switch ============= -This integration can be used to create custom switches in esphomelib +This integration can be used to create custom switches in ESPHome using the C++ (Arduino) API. Please first read :doc:`/components/sensor/custom` guide, @@ -12,8 +12,8 @@ same as the gpio switch implementation. .. code-block:: cpp - #include "esphomelib.h" - using namespace esphomelib; + #include "esphome.h" + using namespace esphome; // namespace is called 'switch_' because 'switch' is a reserved keyword class MyCustomSwitch : public Component, public switch_::Switch { @@ -39,7 +39,7 @@ And in YAML: .. code-block:: yaml # Example configuration entry - esphomeyaml: + esphome: includes: - my_switch.h diff --git a/components/switch/gpio.rst b/components/switch/gpio.rst index 491d7b791..d90bcd642 100644 --- a/components/switch/gpio.rst +++ b/components/switch/gpio.rst @@ -2,7 +2,7 @@ GPIO Switch =========== .. seo:: - :description: Instructions for setting up GPIO pin switches in esphomelib that control GPIO outputs. + :description: Instructions for setting up GPIO pin switches in ESPHome that control GPIO outputs. :image: pin.png The ``gpio`` switch platform allows you to use any pin on your node as a @@ -35,8 +35,14 @@ Configuration variables: - ``ALWAYS_OFF`` - Always initialize the pin as OFF on bootup. - ``ALWAYS_ON`` - Always initialize the pin as ON on bootup. +- **interlock** (*Optional*, list): A list of other GPIO switches in an interlock group. See + :ref:`switch-gpio-interlocking`. + - All other options from :ref:`Switch ` and :ref:`MQTT Component `. +Active Low Switch +----------------- + To create an active-low switch (one that is turned off by default), use the :ref:`Pin Schema `: .. code-block:: yaml @@ -48,9 +54,15 @@ To create an active-low switch (one that is turned off by default), use the :ref number: 25 inverted: yes -To create momentary switches, for example switches that toggle a pin for a moment, you can use :doc:`template switches