diff --git a/Doxygen b/Doxygen
index 6a2a45631..9f37feb92 100644
--- a/Doxygen
+++ b/Doxygen
@@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 2021.8.2
+PROJECT_NUMBER = 2021.9.0b1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
diff --git a/Makefile b/Makefile
index f79a84e1c..0f55f542b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
ESPHOME_PATH = ../esphome
-ESPHOME_REF = 2021.8.2
+ESPHOME_REF = 2021.9.0b1
.PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png
diff --git a/_static/changelog-2021.9.0.png b/_static/changelog-2021.9.0.png
new file mode 100644
index 000000000..9395405de
Binary files /dev/null and b/_static/changelog-2021.9.0.png differ
diff --git a/_static/version b/_static/version
index 055002ff2..620d9cc1a 100644
--- a/_static/version
+++ b/_static/version
@@ -1 +1 @@
-2021.8.2
\ No newline at end of file
+2021.9.0b1
\ No newline at end of file
diff --git a/changelog/2021.9.0.rst b/changelog/2021.9.0.rst
new file mode 100644
index 000000000..1aff2947c
--- /dev/null
+++ b/changelog/2021.9.0.rst
@@ -0,0 +1,155 @@
+ESPHome 2021.9.0 - 15th September 2021
+======================================
+
+.. seo::
+ :description: Changelog for ESPHome 2021.9.0.
+ :image: /_static/changelog-2021.9.0.png
+ :author: ESPHome
+ :author_twitter: @esphome_
+
+.. imgtable::
+ :columns: 2
+
+ AirThings BLE, components/sensor/airthings_ble, airthings_logo.png
+ ST7920, components/display/st7920, st7920.jpg
+
+
+
+API Encryption
+--------------
+
+:ghuser:`OttoWinter` has been hard at work adding a layer of encryption to the API which utilises the
+``noise`` protocol. This releases adds the capabilities to ESPHome devices, but Home Assistant (or other clients)
+will need to upgrade their client libraries (e.g. ``aioesphomeapi``) before they can connect and communicate to
+devices with encryption. This is scheduled to be available in Home Assistant 2021.10.
+
+Midea AC
+--------
+
+``platform: midea_ac`` has been changed to ``platform: midea`` in this release and has
+quite a few upgrades. Check the docs for the new features. :doc:`/components/climate/midea`
+
+SDM Meters
+----------
+
+:doc:`SDM Meters` have been fixed to use kWh instead of Wh
+as the energy unit of measurement.
+
+Template Select/Number/Switch
+-----------------------------
+
+The template selects, numbers and switches now have more validations on them preventing weird usage.
+If you do not set a ``lambda`` then you are required to make them either ``optimistic: true``, or
+utilise the ``set_action`` (select/number) / ``turn_on_trigger`` (switch).
+
+
+Full list of changes
+--------------------
+
+New Features
+^^^^^^^^^^^^
+
+- Allow using a git source for a package :esphomepr:`2193` by :ghuser:`jesserockz` (new-feature)
+
+New Components
+^^^^^^^^^^^^^^
+
+- Add st7920 display, :esphomepr:`1440` by :ghuser:`marsjan155` (new-integration)
+- Support for the AirThings Wave Plus :esphomepr:`1656` by :ghuser:`jeromelaban` (new-integration)
+
+Breaking Changes
+^^^^^^^^^^^^^^^^
+
+- Fix SDM energy units to be KILO... :esphomepr:`2206` by :ghuser:`jesserockz` (breaking-change)
+- Reject template select/number/switches that don't handle user input :esphomepr:`2230` by :ghuser:`oxan` (breaking-change)
+- Remove last_reset_type and convert all those sensors to TOTAL_INCREASING :esphomepr:`2233` by :ghuser:`jesserockz` (breaking-change)
+- Midea support v2 :esphomepr:`2188` by :ghuser:`dudanov` (breaking-change)
+
+All changes
+^^^^^^^^^^^
+
+- Minor code cleanup in light components :esphomepr:`2162` by :ghuser:`mmakaay`
+- Add device class update to binary sensor :esphomepr:`2170` by :ghuser:`frenck`
+- Total daily energy methods :esphomepr:`2163` by :ghuser:`nuttytree`
+- Set SDM voltage state class to measurement :esphomepr:`2181` by :ghuser:`jesserockz`
+- Add macros header with more usable Arduino version defines :esphomepr:`2145` by :ghuser:`oxan`
+- Clean-up constant definitions :esphomepr:`2148` by :ghuser:`oxan`
+- Remove double scheduling from addressable lights :esphomepr:`1963` by :ghuser:`oxan`
+- Reduce static RAM usage :esphomepr:`2140` by :ghuser:`oxan`
+- Fix template select log message mentioning number :esphomepr:`2194` by :ghuser:`jesserockz`
+- Add deprecated attribute to some deprecated types/methods :esphomepr:`2185` by :ghuser:`oxan`
+- Store source package in Component for debugging :esphomepr:`2070` by :ghuser:`OttoWinter`
+- ST7789V: Make backlight_pin optional :esphomepr:`2180` by :ghuser:`speijnik`
+- Fix SDM energy units to be KILO... :esphomepr:`2206` by :ghuser:`jesserockz` (breaking-change)
+- Optionally set direction on fan.turn_on action :esphomepr:`2171` by :ghuser:`WeekendWarrior1`
+- Add st7920 display, :esphomepr:`1440` by :ghuser:`marsjan155` (new-integration)
+- Fix css/js file loading for webserver when esphome not executed form config directory :esphomepr:`2207` by :ghuser:`jesserockz`
+- cs_pin made optional for ili9341 :esphomepr:`2219` by :ghuser:`a13ssandr0`
+- Fix Packages when using MQTT :esphomepr:`2210` by :ghuser:`paulmonigatti`
+- Update known boards :esphomepr:`2190` by :ghuser:`oxan`
+- Bump dashboard to 20210826.0 :esphomepr:`2211` by :ghuser:`jesserockz`
+- Remove footer validation for fujitsu_general :esphomepr:`2196` by :ghuser:`marciogranzotto`
+- Glmnet schema 202105 :esphomepr:`2220` by :ghuser:`glmnet`
+- Add H-Bridge fan component :esphomepr:`2212` by :ghuser:`WeekendWarrior1`
+- Bump black from 21.7b0 to 21.8b0 :esphomepr:`2222` by :ghuser:`dependabot[bot]`
+- Bump pytest from 6.2.4 to 6.2.5 :esphomepr:`2223` by :ghuser:`dependabot[bot]`
+- Support for the AirThings Wave Plus :esphomepr:`1656` by :ghuser:`jeromelaban` (new-integration)
+- Fix some lint errors in pylint 2.10.2 :esphomepr:`2226` by :ghuser:`jesserockz`
+- Add transitions to light flash :esphomepr:`2201` by :ghuser:`alexyao2015`
+- iBeacon support for ble_presence :esphomepr:`1627` by :ghuser:`ignisf`
+- Cleanup flash transitions :esphomepr:`2227` by :ghuser:`alexyao2015`
+- Add is_on and is_off conditions for the fan component :esphomepr:`2225` by :ghuser:`nuttytree`
+- Bump pylint from 2.9.6 to 2.10.2 :esphomepr:`2197` by :ghuser:`dependabot[bot]`
+- mqtt_sensor: properly send state_class via MQTT :esphomepr:`2228` by :ghuser:`ayufan`
+- Change uptime's state_class to total_increasing (esphome/issues#2337) :esphomepr:`2205` by :ghuser:`DAVe3283`
+- Expose WHITE/CWWW/RGBCT color modes over MQTT :esphomepr:`2231` by :ghuser:`oxan`
+- Reject template select/number/switches that don't handle user input :esphomepr:`2230` by :ghuser:`oxan` (breaking-change)
+- Fix UARTComponent hardware vs software UART0 conflict :esphomepr:`2229` by :ghuser:`ferbar`
+- Move to use zeroconf library instead of inline copy :esphomepr:`2192` by :ghuser:`jesserockz`
+- Allow using a git source for a package :esphomepr:`2193` by :ghuser:`jesserockz` (new-feature)
+- Remove last_reset_type and convert all those sensors to TOTAL_INCREASING :esphomepr:`2233` by :ghuser:`jesserockz` (breaking-change)
+- Dont dump legacy fields :esphomepr:`2241` by :ghuser:`jesserockz`
+- Fix encoding bug :esphomepr:`2242` by :ghuser:`jesserockz`
+- Light: include ON_OFF capability to BRIGHTNESS ColorMode :esphomepr:`2204` by :ghuser:`jesserockz`
+- LOG_UPDATE_INTERVAL: correctly report "never" :esphomepr:`2240` by :ghuser:`Habbie`
+- Fix runtime exception due to dict typing :esphomepr:`2243` by :ghuser:`alexyao2015`
+- template: select: fix initial_value cannot be used with lambda :esphomepr:`2244` by :ghuser:`ayufan`
+- Add device classes new in HA 2021.9 :esphomepr:`2248` by :ghuser:`oxan`
+- Logger prevent recursive logging :esphomepr:`2251` by :ghuser:`OttoWinter`
+- Add new trigger to fan component `on_speed_set` :esphomepr:`2246` by :ghuser:`dgtal1`
+- Fix fan speed restore issue on boot :esphomepr:`1867` by :ghuser:`wifwucite`
+- Template sensors always publish on update interval :esphomepr:`2224` by :ghuser:`nuttytree`
+- Socket component :esphomepr:`2250` by :ghuser:`OttoWinter`
+- Allow .yml files in dashboard :esphomepr:`2257` by :ghuser:`jesserockz`
+- Bump dashboard to 20210908.0 and fix card names for yml :esphomepr:`2258` by :ghuser:`jesserockz`
+- Fix socket not setting callbacks early enough :esphomepr:`2260` by :ghuser:`OttoWinter`
+- Convert API to use sockets :esphomepr:`2253` by :ghuser:`OttoWinter`
+- Midea support v2 :esphomepr:`2188` by :ghuser:`dudanov` (breaking-change)
+- ccs811: publish firmware version; log bootloader and HW version; fix a bug :esphomepr:`2006` by :ghuser:`Habbie`
+- API encryption :esphomepr:`2254` by :ghuser:`OttoWinter`
+- Revert "Dont dump legacy fields" :esphomepr:`2259` by :ghuser:`jesserockz`
+- pm1006: add support for sending a measurement request :esphomepr:`2214` by :ghuser:`Habbie`
+- SGP40 sensor start-up fix :esphomepr:`2178` by :ghuser:`kbx81`
+- PMSA003i Update state_class and async :esphomepr:`2216` by :ghuser:`sjtrny`
+
+Past Changelogs
+---------------
+
+.. toctree::
+ :maxdepth: 1
+
+ 2021.8.0
+ v1.20.0
+ v1.19.0
+ v1.18.0
+ v1.17.0
+ v1.16.0
+ v1.15.0
+ v1.14.0
+ v1.13.0
+ v1.12.0
+ v1.11.0
+ v1.10.0
+ v1.9.0
+ v1.8.0
+ v1.7.0
diff --git a/changelog/index.rst b/changelog/index.rst
index e457e2f15..eecc2c524 100644
--- a/changelog/index.rst
+++ b/changelog/index.rst
@@ -2,7 +2,7 @@ Changelog
=========
.. redirect::
- :url: /changelog/2021.8.0.html
+ :url: /changelog/2021.9.0.html
.. toctree::
:glob:
diff --git a/components/api.rst b/components/api.rst
index 5a77612bf..50bec505f 100644
--- a/components/api.rst
+++ b/components/api.rst
@@ -30,6 +30,38 @@ Configuration variables:
- **port** (*Optional*, integer): The port to run the API Server on. Defaults to ``6053``.
- **password** (*Optional*, string): The password to protect the API Server with. Defaults to no password.
+- **encryption** (*Optional*): Enable transport encryption of the API layer.
+
+ - **key** (**Required**, string): The pre-shared key for the encryption. This is a 32-byte base64 encoded string.
+ Below you can copy a key randomly generated in your browser:
+
+ .. raw:: html
+
+
+
+
- **services** (*Optional*, list): A list of user-defined services. See :ref:`api-services`.
- **reboot_timeout** (*Optional*, :ref:`time `): The amount of time to wait before rebooting when no
client connects to the API. This is needed because sometimes the low level ESP functions report that
diff --git a/components/binary_sensor/ble_presence.rst b/components/binary_sensor/ble_presence.rst
index d19e05b33..93fe5393f 100644
--- a/components/binary_sensor/ble_presence.rst
+++ b/components/binary_sensor/ble_presence.rst
@@ -26,6 +26,10 @@ Bluetooth Low Energy device.
- platform: ble_presence
service_uuid: '11aa'
name: "ESP32 BLE Tracker Test Service 16 bit"
+ # Presence based on iBeacon UUID
+ - platform: ble_presence
+ ibeacon_uuid: '68586f1e-89c2-11eb-8dcd-0242ac130003'
+ name: "ESP32 BLE Tracker Test Service iBeacon"
.. note::
@@ -39,10 +43,19 @@ Configuration variables:
- **name** (**Required**, string): The name of the binary sensor.
- **mac_address** (*Optional*, MAC Address): The MAC address to track for this
- binary sensor. Either this or ``service_uuid`` has to be present.
+ binary sensor. Note that exactly one of ``mac_address``, ``service_uuid`` or ``ibeacon_uuid``
+ must be present.
- **service_uuid** (*Optional*, string): 16 bit, 32 bit, or 128 bit BLE Service UUID
- which can be tracked if the device randomizes the MAC address. Either
- this or ``mac_address`` has to be present.
+ which can be tracked if the device randomizes the MAC address. Note that exactly one of
+ ``mac_address``, ``service_uuid`` or ``ibeacon_uuid`` must be present.
+- **ibeacon_uuid** (*Optional*, string): The `universally unique identifier `__
+ to identify the beacon that needs to be tracked. Note that exactly one of ``mac_address``,
+ ``service_uuid`` or ``ibeacon_uuid`` must be present.
+- **ibeacon_major** (*Optional*, integer): The iBeacon major identifier of the beacon that needs
+ to be tracked. Usually used to group beacons, for example for grouping all beacons in the
+ same building.
+- **ibeacon_minor** (*Optional*, integer): The iBeacon minor identifier of the beacon that needs
+ to be tracked. Usually used to identify beacons within an iBeacon group.
- **id** (*Optional*, :ref:`config-id`): Manually specify
the ID used for code generation.
- All other options from :ref:`Binary Sensor `.
@@ -68,17 +81,41 @@ boot-up. Then, when a BLE device is discovered, you should see messages like
address type and advertised name. If you don't see these messages, your device is unfortunately
currently not supported.
+.. code-block:: yaml
+
+ # Example configuration entry for finding
+ # Service UUIDs and iBeacon UUIDs and identifiers
+ esp32_ble_tracker:
+
+ logger:
+ level: VERY_VERBOSE
+
+You can increase the :ref:`log level ` to ``VERY_VERBOSE`` to review detailed
+data for each discovered BLE device. This will make ESPHome print Service UUIDs, iBeacon UUIDs,
+iBeacon major and minor identifiers, BLE manufacturer data, RSSI and other data useful for
+debugging purposes. Note that this is useful only during set-up and a less verbose log level
+should be specified afterwards.
+
Please note that devices that show a ``RANDOM`` address type in the logs cannot be used for
-MAC address based tracking, since their MAC-address periodically changes. Instead you can create
-a BLE beacon, set a unique 16 bit, 32 bit or 128 bit Service UUID and track your device based on that.
-Make sure you don't pick a `GATT Service UUID `__,
-otherwise generic services might give you incorrect tracking results.
+MAC address based tracking, since their MAC-address periodically changes. Instead you can:
+
+- Create a BLE beacon, set a unique 16 bit, 32 bit or 128 bit Service UUID and track your device
+ based on that. Make sure you don't pick a `GATT Service UUID
+ `__, otherwise generic services
+ might give you incorrect tracking results.
+
+- Create an iBeacon and track it based on its iBeacon UUID. You can also optionally specify
+ major and minor numbers to match if additional filtering is required. ESPHome offers this
+ functionality via the :doc:`ESP32 Bluetooth Low Energy Beacon `
+ component. Several iOS and Android applications, including the open source Home Assistant
+ mobile application also provide means to create iBeacons.
See Also
--------
- :doc:`/components/esp32_ble_tracker`
+- :doc:`/components/esp32_ble_beacon`
- :doc:`/components/binary_sensor/index`
- :apiref:`ble_presence/ble_presence.h`
- `ESP32 BLE for Arduino `__ by `Neil Kolban `__.
diff --git a/components/climate/midea.rst b/components/climate/midea.rst
new file mode 100644
index 000000000..33093243e
--- /dev/null
+++ b/components/climate/midea.rst
@@ -0,0 +1,299 @@
+Midea Air Conditioner
+=====================
+
+.. seo::
+ :description: Instructions for setting up a Midea climate device
+ :image: air-conditioner.png
+
+The ``midea`` component creates a Midea air conditioner climate device.
+
+.. note::
+
+ This protocol also used by some vendors:
+
+ - `Electrolux `_
+ - `Qlima `_
+ - `Artel `_
+ - `Carrier `_
+ - `Comfee `_
+ - `Inventor `_
+ - and maybe others
+
+ Control is possible with a custom dongle. Example of hardware implementation is `IoT Uni Dongle `_.
+
+.. code-block:: yaml
+
+ # Example configuration entry
+
+ # Disable logging over UART (required)
+ logger:
+ baud_rate: 0
+
+ # UART settings for Midea dongle (required)
+ uart:
+ tx_pin: 1 # hardware dependant
+ rx_pin: 3 # hardware dependant
+ baud_rate: 9600
+
+ # Main settings
+ climate:
+ - platform: midea
+ name: Midea Climate # Use a unique name.
+ transmitter_id: # Optional. Add this option to use IR transmitter.
+ period: 1s # Optional
+ timeout: 2s # Optional
+ num_attempts: 3 # Optional
+ autoconf: true # Autoconfigure most options.
+ beeper: true # Beep on commands.
+ visual: # Optional. Example of visual settings override.
+ min_temperature: 17 °C # min: 17
+ max_temperature: 30 °C # max: 30
+ temperature_step: 0.5 °C # min: 0.5
+ supported_modes: # All capabilities in this section detected by autoconf.
+ - FAN_ONLY # This capability is always used.
+ - HEAT_COOL
+ - COOL
+ - HEAT
+ - DRY
+ custom_fan_modes:
+ - SILENT
+ - TURBO
+ supported_presets: # All capabilities in this section detected by autoconf.
+ - ECO
+ - BOOST
+ - SLEEP # This capability is always used.
+ custom_presets: # All capabilities in this section detected by autoconf.
+ - FREEZE_PROTECTION
+ supported_swing_modes:
+ - VERTICAL # This capability is always used.
+ - HORIZONTAL
+ - BOTH
+ outdoor_temperature: # Optional. Outdoor temperature sensor (may display incorrect values after long inactivity).
+ name: Temp
+ power_usage: # Optional. Power usage sensor (only for devices that support this feature).
+ name: Power
+ humidity_setpoint: # Optional. Indoor humidity sensor (only for devices that support this feature).
+ name: Humidity
+
+Configuration variables:
+------------------------
+
+- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
+- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :doc:`../uart` if you want
+ to use multiple UART buses.
+- **name** (**Required**, string): The name of the climate device.
+- **transmitter_id** (*Optional*, :ref:`config-id`): Set if you use :doc:`../remote_transmitter` component for IR commands transmit.
+- **period** (*Optional*, :ref:`time `): Minimal period between requests to the appliance. Defaults to ``1s``.
+- **timeout** (*Optional*, :ref:`time `): Request response timeout until next request attempt. Defaults to ``2s``.
+- **num_attempts** (*Optional*, integer 1-5): Number of request attempts. Defaults to ``3``.
+- **autoconf** (*Optional*, boolean): Get capabilities automatically. Allows you not to manually define most of the capabilities of the appliance.
+ Defaults to ``True``.
+- **beeper** (*Optional*, boolean): Beeper feedback on command. Defaults to ``False``.
+- **supported_modes** (*Optional*, list): List of supported modes. Possible values are: ``HEAT_COOL``, ``COOL``, ``HEAT``, ``DRY``, ``FAN_ONLY``.
+- **custom_fan_modes** (*Optional*, list): List of supported custom fan modes. Possible values are: ``SILENT``, ``TURBO``.
+- **supported_presets** (*Optional*, list): List of supported presets. Possible values are: ``ECO``, ``BOOST``, ``SLEEP``.
+- **custom_presets** (*Optional*, list): List of supported custom presets. Possible values are: ``FREEZE_PROTECTION``.
+- **supported_swing_modes** (*Optional*, list): List of supported swing modes. Possible values are: ``VERTICAL``, ``HORIZONTAL``, ``BOTH``.
+- **outdoor_temperature** (*Optional*): The information for the outdoor temperature
+ sensor.
+
+ - **name** (**Required**, string): The name of the sensor.
+ - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
+ - All other options from :ref:`Sensor `.
+- **power_usage** (*Optional*): The information for the current power consumption
+ sensor.
+
+ - **name** (**Required**, string): The name of the sensor.
+ - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
+ - All other options from :ref:`Sensor `.
+- **humidity_setpoint** (*Optional*): The information for the humidity indoor
+ sensor (experimental).
+
+ - **name** (**Required**, string): The name of the sensor.
+ - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
+ - All other options from :ref:`Sensor `.
+- All other options from :ref:`Climate `.
+
+Automations
+-----------
+
+.. _midea_ac-power_on_action:
+
+``midea_ac.power_on`` Action
+******************************
+
+This action turn on power. The mode and preset will be restored to the last state before turned off.
+
+.. code-block:: yaml
+
+ on_...:
+ then:
+ - midea_ac.power_on:
+
+.. _midea_ac-power_off_action:
+
+``midea_ac.power_off`` Action
+******************************
+
+This action turn off power.
+
+.. code-block:: yaml
+
+ on_...:
+ then:
+ - midea_ac.power_off:
+
+
+.. _midea_ac-follow_me_action:
+
+``midea_ac.follow_me`` Action
+*****************************
+
+This action transmit IR FollowMe command telling the air conditioner a more accurate
+room temperature value to be used instead of the internal indoor unit sensor.
+
+.. code-block:: yaml
+
+ on_...:
+ then:
+ - midea_ac.follow_me:
+ temperature: !lambda "return x;"
+ beeper: false
+
+Configuration variables:
+
+- **temperature** (**Required**, float, :ref:`templatable `): Set the
+ value of a internal temperature sensor.
+- **beeper** (*Optional*, bool, :ref:`templatable `): set beep on update.
+ Defaults to ``False``
+
+
+.. _midea_ac-display_toggle_action:
+
+``midea_ac.display_toggle`` Action
+**********************************
+
+This action toggle ac screen. Works via UART if supported or :doc:`../remote_transmitter`.
+
+.. code-block:: yaml
+
+ on_...:
+ then:
+ - midea_ac.display_toggle:
+
+
+.. _midea_ac-swing_step_action:
+
+``midea_ac.swing_step`` Action
+******************************
+
+This action adjust the louver by one step. :doc:`../remote_transmitter` required.
+
+.. code-block:: yaml
+
+ on_...:
+ then:
+ - midea_ac.swing_step:
+
+
+.. _midea_ac-beeper_on_action:
+
+``midea_ac.beeper_on`` Action
+******************************
+
+This action turn on beeper feedback.
+
+.. code-block:: yaml
+
+ on_...:
+ then:
+ - midea_ac.beeper_on:
+
+.. _midea_ac-beeper_off_action:
+
+``midea_ac.beeper_off`` Action
+******************************
+
+This action turn off beeper feedback.
+
+.. code-block:: yaml
+
+ on_...:
+ then:
+ - midea_ac.beeper_off:
+
+
+Additional control options using IR commands
+--------------------------------------------
+
+It is possible to use the FollowMe function and some other features available only through IR commands.
+Below is an example of how to send FollowMe commands with the values of your sensor using the :doc:`../remote_transmitter`
+component, as well as control the light of the LED display.
+
+.. code-block:: yaml
+
+ # Example configuration entry
+
+ remote_transmitter:
+ pin: GPIO13 # For iot-uni-stick.
+ carrier_duty_percent: 100% # 50% for IR LED, 100% for direct connect to TSOP IR receiver output.
+
+ sensor:
+ - platform: homeassistant
+ entity_id: sensor.room_sensor # Sensor from HASS
+ internal: true
+ filters:
+ - throttle: 10s
+ - heartbeat: 2min # Maximum interval between updates.
+ - debounce: 1s
+ on_value:
+ midea_ac.follow_me:
+ temperature: !lambda "return x;"
+ beeper: false # Optional. Beep on update.
+
+ # template momentary switches for sending display control command and swing step actions
+ switch:
+ - platform: template
+ name: Display Toggle
+ icon: mdi:theme-light-dark
+ turn_on_action:
+ midea_ac.display_toggle:
+ - platform: template
+ name: Swing Step
+ icon: mdi:tailwind
+ turn_on_action:
+ midea_ac.swing_step:
+
+
+Example of Beeper Control Using a Switch
+----------------------------------------
+
+.. code-block:: yaml
+
+ switch:
+ - platform: template
+ name: Beeper
+ icon: mdi:volume-source
+ optimistic: true
+ turn_on_action:
+ midea_ac.beeper_on:
+ turn_off_action:
+ midea_ac.beeper_off:
+
+Acknowledgments:
+----------------
+
+Thanks to the following people for their contributions to reverse engineering the UART protocol and source code in the following repositories:
+
+* `Mac Zhou `_
+* `NeoAcheron `_
+* `Rene Klootwijk `_
+
+Special thanks to the project `IRremoteESP8266 `_ for describing the IR protocol.
+
+See Also
+--------
+
+- :doc:`/components/climate/index`
+- :apiref:`climate/midea_ac.h`
+- :ghedit:`Edit`
diff --git a/components/climate/midea_ac.rst b/components/climate/midea_ac.rst
deleted file mode 100644
index f6a55daea..000000000
--- a/components/climate/midea_ac.rst
+++ /dev/null
@@ -1,128 +0,0 @@
-Midea Air Conditioner
-=====================
-
-.. seo::
- :description: Instructions for setting up a Midea climate device
- :image: air-conditioner.png
-
-The ``midea_ac`` component creates a Midea air conditioner climate device.
-
-This component requires a auto-loaded ``midea-dongle`` component, that use hardware UART.
-
-.. note::
-
- This protocol also used by some vendors:
-
- - `Electrolux `_
- - `Qlima `_
- - `Artel `_
- - `Carrier `_
- - `Comfee `_
- - `Inventor `_
- - and maybe others
-
- Example of hardware implementation is `Midea Open Dongle `_ in free `KiCad `_ format.
-
-.. code-block:: yaml
-
- # Example configuration entry
-
- # Disable logging over UART (required)
- logger:
- baud_rate: 0
-
- # UART settings for Midea dongle (required)
- uart:
- tx_pin: 1
- rx_pin: 3
- baud_rate: 9600
-
- # Optional (if you want modify settings)
- midea_dongle:
- strength_icon: true
-
- # Main settings
- climate:
- - platform: midea_ac
- name: "My Midea AC"
- visual:
- min_temperature: 18 °C
- max_temperature: 25 °C
- temperature_step: 0.1 °C
- beeper: true
- custom_fan_modes:
- - SILENT
- - TURBO
- preset_eco: true
- preset_sleep: true
- preset_boost: true
- custom_presets:
- - FREEZE_PROTECTION
- swing_horizontal: true
- swing_both: true
- outdoor_temperature:
- name: "Temp"
- power_usage:
- name: "Power"
- humidity_setpoint:
- name: "Hum"
-
-Configuration variables:
-------------------------
-
-- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
-- **midea_dongle_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the ``midea_dongle`` if you want to use multiple devices.
-- **name** (**Required**, string): The name of the climate device.
-- **outdoor_temperature** (*Optional*): The information for the outdoor temperature
- sensor.
-
- - **name** (**Required**, string): The name of the sensor.
- - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- - All other options from :ref:`Sensor `.
-- **power_usage** (*Optional*): The information for the current power consumption
- sensor.
-
- - **name** (**Required**, string): The name of the sensor.
- - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- - All other options from :ref:`Sensor `.
-- **humidity_setpoint** (*Optional*): The information for the humidity indoor
- sensor (experimental).
-
- - **name** (**Required**, string): The name of the sensor.
- - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- - All other options from :ref:`Sensor `.
-- **beeper** (*Optional*, boolean): Beeper feedback on command. Defaults to ``false``.
-- **custom_fan_modes** (*Optional*, list): List of supported custom fan modes. Possible values are: SILENT, TURBO.
-- **preset_eco** (*Optional*, boolean): ECO preset support. Defaults to ``false``.
-- **preset_sleep** (*Optional*, boolean): SLEEP preset support. Defaults to ``false``.
-- **preset_boost** (*Optional*, boolean): BOOST preset support. Defaults to ``false``.
-- **custom_presets** (*Optional*, list): List of supported custom presets. Possible values are: FREEZE_PROTECTION.
-- **swing_horizontal** (*Optional*, boolean): Enable **swing horizontal** option. Defaults to ``false``.
-- **swing_both** (*Optional*, boolean): Enable **swing both** option. Defaults to ``false``.
-- All other options from :ref:`Climate `.
-
-Configuration variables of midea-dongle component:
-**************************************************
-
-- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
-- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :doc:`../uart` if you want
- to use multiple UART buses.
-- **strength_icon** (*Optional*, boolean): Set if your device have signal strength icon
- and you want to use this feature. By default, on connected state, icon show maximum signal quality. Defaults to ``false``.
-
-
-Acknowledgments:
-----------------
-
-Thanks to the following people for their contributions to reverse engineering the UART protocol and source code in the following repositories:
-
-* `Mac Zhou `_
-* `NeoAcheron `_
-* `Rene Klootwijk `_
-
-See Also
---------
-
-- :doc:`/components/climate/index`
-- :apiref:`climate/midea_ac.h`
-- :ghedit:`Edit`
diff --git a/components/display/images/st7920-full.jpg b/components/display/images/st7920-full.jpg
new file mode 100644
index 000000000..744284a0c
Binary files /dev/null and b/components/display/images/st7920-full.jpg differ
diff --git a/components/display/st7789v.rst b/components/display/st7789v.rst
index 89606c15b..a31af4619 100644
--- a/components/display/st7789v.rst
+++ b/components/display/st7789v.rst
@@ -53,10 +53,10 @@ hardwired programming. (OTA updates are of course possible after ESPHome is init
Configuration variables:
************************
-- **backlight_pin** (**Required**, :ref:`Pin Schema `): The display's backlight pin.
- **cs_pin** (**Required**, :ref:`Pin Schema `): The CS pin.
- **dc_pin** (**Required**, :ref:`Pin Schema `): The DC pin.
- **reset_pin** (**Required**, :ref:`Pin Schema `): The RESET pin.
+- **backlight_pin** (*Optional*, :ref:`Pin Schema `): The display's backlight pin.
- **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display.
See :ref:`display-engine` for more information.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``5s``.
diff --git a/components/display/st7920.rst b/components/display/st7920.rst
new file mode 100644
index 000000000..9c43ffadd
--- /dev/null
+++ b/components/display/st7920.rst
@@ -0,0 +1,64 @@
+ST7920 LCD Graphic Display
+==========================
+
+.. seo::
+ :description: Instructions for setting up ST7920 LCD display drivers.
+ :image: st7920.jpg
+
+.. _st7920:
+
+Usage
+-----
+
+The ``st7920`` display platform allows you to use
+ST7920 (`datasheet `__,
+`electrodragon `__)
+displays with ESPHome. Note that this component is for displays that are connected via the 3-Wire :ref:`SPI bus `.
+It's a monochrome LCD graphic display.
+
+.. figure:: images/st7920-full.jpg
+ :align: center
+ :width: 75.0%
+
+ ST7920 LCD Graphic Display
+
+Connect D5 to the E pin you chose for the :ref:`SPI bus `, connect D7 to the R/W pin and ``RS`` to some GPIO pins on the ESP.
+For SPI communication it's important to connect PSB on the LCD to GND.
+
+.. code-block:: yaml
+
+ # Example configuration entry
+ spi:
+ clk_pin: D5
+ mosi_pin: D7
+
+ display:
+ - platform: st7920
+ cs_pin:
+ number: 4
+ inverted: true
+ lambda: |-
+ it.print(0, 0, id(font), "Hello World!");
+
+
+Configuration variables:
+************************
+
+- **cs_pin** (**Required**, :ref:`Pin Schema `): Sometimes also called ``RS``. For ST7920 should be inverted.
+- **width** (**Required**, int): The "width" of a screen. Defaults to 128.
+- **height** (**Required**, int): The "height" of a screen. Defaults to 64;
+- **rotation** (*Optional*): Set the rotation of the display. Everything you draw in ``lambda:`` will be rotated
+ by this option. One of ``0°`` (default), ``90°``, ``180°``, ``270°``.
+- **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display.
+ See :ref:`display-engine` for more information.
+- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``60s``.
+- **pages** (*Optional*, list): Show pages instead of a single lambda. See :ref:`display-pages`.
+- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
+
+
+See Also
+--------
+
+- :doc:`index`
+- :apiref:`st7920/st7920.h`
+- :ghedit:`Edit`
diff --git a/components/esp32_ble_beacon.rst b/components/esp32_ble_beacon.rst
index d339303b3..220ce9830 100644
--- a/components/esp32_ble_beacon.rst
+++ b/components/esp32_ble_beacon.rst
@@ -74,6 +74,7 @@ See Also
--------
- :doc:`esp32_ble_tracker`
+- :doc:`binary_sensor/ble_presence`
- :apiref:`esp32_ble_beacon/esp32_ble_beacon.h`
- `ESP32 BLE for Arduino `__ by `Neil Kolban `__.
- :ghedit:`Edit`
diff --git a/components/fan/hbridge.rst b/components/fan/hbridge.rst
new file mode 100644
index 000000000..5a5a051ba
--- /dev/null
+++ b/components/fan/hbridge.rst
@@ -0,0 +1,77 @@
+H-bridge Fan
+============
+
+.. seo::
+ :description: Instructions for setting up hbridge controlled fans (or motors).
+ :image: fan.png
+
+The `'hbridge`' fan platform allows you to use a compatible `h-bridge` (L298N, DRV8871, MX1508, BTS7960, L9110S, DRV8833, TB6612, etc.) to control a fan (or motor).
+
+.. figure:: images/L298N_module.jpg
+ :align: center
+ :target: `kuongshun`_
+ :width: 50.0%
+
+ L298N H-bridge module. Image by `kuongshun`_.
+
+.. _kuongshun: https://kuongshun.com/products/l298n-stepper-motor-driver-board-red
+
+.. figure:: images/fan-ui.png
+ :align: center
+ :width: 80.0%
+
+.. code-block:: yaml
+
+ # Example configuration entry
+ fan:
+ - platform: hbridge
+ output: my_output_1
+ name: "Living Room Fan"
+ pin_a: motor_forward_pin
+ pin_b: motor_reverse_pin
+ # enable_pin: motor_enable
+ decay_mode: slow # slow decay mode (braking) or fast decay (coasting).
+
+Configuration variables:
+------------------------
+
+- **pin_a** (**Required**, :ref:`config-id`): The id of the
+ :ref:`float output