diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5224afbe5..daa239940 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout source code - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.1.0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c9431c34c..ac9abb35e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.0.2 + - uses: actions/checkout@v3.1.0 - name: Set up Python 3.8 uses: actions/setup-python@v4 with: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 65c990cf3..7fbfe33a3 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -16,7 +16,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v5 + - uses: actions/stale@v6 with: days-before-pr-stale: 60 days-before-pr-close: 7 @@ -35,7 +35,7 @@ jobs: close-issues: runs-on: ubuntu-latest steps: - - uses: actions/stale@v5 + - uses: actions/stale@v6 with: days-before-pr-stale: -1 days-before-pr-close: -1 diff --git a/Doxygen b/Doxygen index ef0af197a..6ffc42b4e 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 = 2022.8.2 +PROJECT_NUMBER = 2022.9.3 # 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 c71ea74d8..f33f58911 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ESPHOME_PATH = ../esphome -ESPHOME_REF = 2022.8.2 +ESPHOME_REF = 2022.9.3 .PHONY: html html-strict cleanhtml deploy help live-html Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify diff --git a/_static/changelog-2022.9.0.png b/_static/changelog-2022.9.0.png new file mode 100644 index 000000000..c55d8f798 Binary files /dev/null and b/_static/changelog-2022.9.0.png differ diff --git a/_static/version b/_static/version index b4b2ebf69..6cfd5aff8 100644 --- a/_static/version +++ b/_static/version @@ -1 +1 @@ -2022.8.2 \ No newline at end of file +2022.9.3 \ No newline at end of file diff --git a/changelog/2022.8.0.rst b/changelog/2022.8.0.rst index e43362797..0ffbd59bc 100644 --- a/changelog/2022.8.0.rst +++ b/changelog/2022.8.0.rst @@ -63,6 +63,11 @@ Release 2022.8.2 - September 6 - Ignore NaN states in the integration component :esphomepr:`3767` by :ghuser:`anatoly-savchenkov` - Update modbus_controller.cpp :esphomepr:`3768` by :ghuser:`Avirsaam` +Release 2022.8.3 - September 6 +------------------------------ + +- Fix HA addon auth using HA credentials :esphomepr:`3758` by :ghuser:`jesserockz` + Full list of changes -------------------- diff --git a/changelog/2022.9.0.rst b/changelog/2022.9.0.rst new file mode 100644 index 000000000..c148f816a --- /dev/null +++ b/changelog/2022.9.0.rst @@ -0,0 +1,187 @@ +ESPHome 2022.9.0 - 21st September 2022 +====================================== + +.. seo:: + :description: Changelog for ESPHome 2022.9.0. + :image: /_static/changelog-2022.9.0.png + :author: Jesse Hills + :author_twitter: @jesserockz + +.. imgtable:: + :columns: 4 + + DPS310, components/sensor/dps310, dps310.jpg + MCP9600, components/sensor/mcp9600, mcp9600.jpg + TM1621, components/display/tm1621, tm1621.jpg + MPL3115A2, components/sensor/mpl3115a2, mpl3115a2.jpg + uFire EC sensor, components/sensor/ufire_ec, ufire_ec.png + uFire ISE sensor, components/sensor/ufire_ise, ufire_ise.png + Factory Reset Switch, components/switch/factory_reset, restart-alert.svg + Factory Reset Button, components/button/factory_reset, restart-alert.svg + TM1638, components/display/tm1638, tm1638.jpg + BL0942, components/sensor/bl0942, bl0942.png + + +ESPHome Editor +-------------- + +The editor used in ESPHome has been swapped out for Monaco thanks to :ghuser:`glmnet`. He has +been working hard to make the experience of writing your YAML configurations easier and it now +supports auto completion with popups to show you more information. + +Factory Reset +------------- + +A new Factory Reset switch and button has been added this release, allowing resetting of information such +as counters, restored values, and more importantly, the wifi credentials of a device that has been set up +using the captive portal such as pre-flashed devices you would have purchased. + +Bluetooth Active Connections +---------------------------- + +ESPHome 2022.9.3 adds active connections to the ``bluetooth_proxy`` component allowing Home Assistant +to connect to and control supported devices. + +Release 2022.9.1 - September 22 +------------------------------- + +- Revert "fix spi timing issues" :esphomepr:`3838` by :ghuser:`jesserockz` + +Release 2022.9.2 - September 29 +------------------------------- + +- Bump dashboard to 20220925.0 :esphomepr:`3846` by :ghuser:`glmnet` + +Release 2022.9.3 - October 6 +---------------------------- + +- Bluetooth Proxy active connections :esphomepr:`3817` by :ghuser:`jesserockz` + +Full list of changes +-------------------- + +New Components +^^^^^^^^^^^^^^ + +- Add dps310 sensor support :esphomepr:`3704` by :ghuser:`kbx81` (new-integration) +- Support for MCP9600 Thermocouple Amplifier :esphomepr:`3700` by :ghuser:`MrEditor97` (new-integration) +- Add support to tm1621 display :esphomepr:`3737` by :ghuser:`Philippe12` (new-integration) +- u-fire EC sensor :esphomepr:`3774` by :ghuser:`pvizeli` (new-integration) +- Add support for MPL3115A2 Pressure/Altitude and Temperature Sensor :esphomepr:`3371` by :ghuser:`kbickar` (new-integration) +- Add support for BL0942 voltage, current, energy and power Sensor :esphomepr:`3777` by :ghuser:`dbuezas` (new-integration) +- Add Factory Reset button and switch :esphomepr:`3724` by :ghuser:`anatoly-savchenkov` (new-integration) +- Add support for TM1638 Led and Key component :esphomepr:`3340` by :ghuser:`skykingjwc` (new-integration) +- Add uFire ISE sensor :esphomepr:`3789` by :ghuser:`pvizeli` (new-integration) + +Beta Changes +^^^^^^^^^^^^ + +- null initialize total sensor for pulse counter :esphomepr:`3803` by :ghuser:`RoboMagus` +- Sim800l add calls, multiline sms and ussd :esphomepr:`3630` by :ghuser:`glmnet` +- Unify 'nullptr' initalization of class members; :esphomepr:`3805` by :ghuser:`RoboMagus` +- Initialize all child sensors to nullptr :esphomepr:`3808` by :ghuser:`jesserockz` +- Remove floating point calculation from ac_dimmer ISR :esphomepr:`3770` by :ghuser:`Azimath` +- split pronto codes if they are too long :esphomepr:`3812` by :ghuser:`ssieb` +- [BME280] raise standby time :esphomepr:`3804` by :ghuser:`h3ndrik` +- Make sprinkler reset_resume() method public :esphomepr:`3824` by :ghuser:`kbx81` +- Bump dashboard to 20220919.1 :esphomepr:`3828` by :ghuser:`balloob` +- Fix-esphome-validation-line-number :esphomepr:`3815` by :ghuser:`glmnet` +- Bump dashboard to 20220920.0 :esphomepr:`3831` by :ghuser:`balloob` +- Bump dashboard to 20220920.1 :esphomepr:`3834` by :ghuser:`glmnet` + +All changes +^^^^^^^^^^^ + +- support modifying the apds9960 settings :esphomepr:`3708` by :ghuser:`ssieb` +- Add support for pvvx mithermometer display via ble client :esphomepr:`3333` by :ghuser:`puuu` +- Improve OTA error messages adding return codes :esphomepr:`3698` by :ghuser:`IgnacioHR` +- Send CR also for commands for sim800l :esphomepr:`3719` by :ghuser:`ssieb` +- hydreon_rgxx: Support lens_bad, em_sat and temperature :esphomepr:`3642` by :ghuser:`functionpointer` +- wifi: support 802.11k and 802.11v :esphomepr:`3600` by :ghuser:`stintel` +- Add final validate for i2c with mix/max frequency :esphomepr:`3727` by :ghuser:`jesserockz` +- Add dps310 sensor support :esphomepr:`3704` by :ghuser:`kbx81` (new-integration) +- Let favicon be cached :esphomepr:`3729` by :ghuser:`slovdahl` +- Add bitmap font support :esphomepr:`3573` by :ghuser:`justfalter` +- add log messages for bad pronto codes :esphomepr:`3738` by :ghuser:`ssieb` +- add color compare operator's :esphomepr:`3730` by :ghuser:`nielsnl68` +- Support for MCP9600 Thermocouple Amplifier :esphomepr:`3700` by :ghuser:`MrEditor97` (new-integration) +- Support high update rates and fix several bugs in the cse7766 component. :esphomepr:`3675` by :ghuser:`fhriley` +- Add Prometheus metrics relabeling :esphomepr:`3734` by :ghuser:`jangrewe` +- mcp23017: read output latch registers during setup :esphomepr:`3744` by :ghuser:`andyboeh` +- Captive portal show nearby WiFi with no ssid configured :esphomepr:`3748` by :ghuser:`anatoly-savchenkov` +- Remove unnecessary schema extension on template button :esphomepr:`3753` by :ghuser:`jesserockz` +- Tidy up switch schemas :esphomepr:`3754` by :ghuser:`jesserockz` +- Add IP101 support to Ethernet component :esphomepr:`3751` by :ghuser:`kbx81` +- Add BedJet Fan child component :esphomepr:`3735` by :ghuser:`jhansche` +- ibeacon support for the ble_rssi sensor :esphomepr:`3745` by :ghuser:`wjtje` +- Add AEHA IR Protocol :esphomepr:`3726` by :ghuser:`hazi` +- Add sum type to binary_sensor_map :esphomepr:`3541` by :ghuser:`fbrthld` +- Bump aioesphomeapi from 10.11.0 to 10.13.0 :esphomepr:`3740` by :ghuser:`dependabot[bot]` +- Bump pylint from 2.14.5 to 2.15.0 :esphomepr:`3746` by :ghuser:`dependabot[bot]` +- Esp32 pulsecounter optional pcnt :esphomepr:`3691` by :ghuser:`RoboMagus` +- Bump black from 22.6.0 to 22.8.0 :esphomepr:`3760` by :ghuser:`dependabot[bot]` +- Various ili9341 fixes :esphomepr:`3756` by :ghuser:`nielsnl68` +- Add the same docker tags as used in HA :esphomepr:`3752` by :ghuser:`andrey-yantsen` +- Bump pytest from 7.1.1 to 7.1.3 :esphomepr:`3766` by :ghuser:`dependabot[bot]` +- Remove unneeded line (spi component adds it) :esphomepr:`3778` by :ghuser:`jesserockz` +- Move crc16 to helpers :esphomepr:`3780` by :ghuser:`jesserockz` +- YAML linting :esphomepr:`3779` by :ghuser:`jesserockz` +- Add support to tm1621 display :esphomepr:`3737` by :ghuser:`Philippe12` (new-integration) +- u-fire EC sensor :esphomepr:`3774` by :ghuser:`pvizeli` (new-integration) +- Add support for MPL3115A2 Pressure/Altitude and Temperature Sensor :esphomepr:`3371` by :ghuser:`kbickar` (new-integration) +- Add support for BL0942 voltage, current, energy and power Sensor :esphomepr:`3777` by :ghuser:`dbuezas` (new-integration) +- Bump pylint from 2.15.0 to 2.15.2 :esphomepr:`3785` by :ghuser:`dependabot[bot]` +- Add Factory Reset button and switch :esphomepr:`3724` by :ghuser:`anatoly-savchenkov` (new-integration) +- [MPU6050] Support devices with WHOAMI 0x98 :esphomepr:`3784` by :ghuser:`CarlosGS` +- Bump zeroconf from 0.39.0 to 0.39.1 :esphomepr:`3782` by :ghuser:`dependabot[bot]` +- Add support for TM1638 Led and Key component :esphomepr:`3340` by :ghuser:`skykingjwc` (new-integration) +- Remove status_set_error from ufire_ec :esphomepr:`3792` by :ghuser:`pvizeli` +- Bump frenck/action-yamllint from 1.2.0 to 1.3.0 :esphomepr:`3798` by :ghuser:`dependabot[bot]` +- esp32_ble_tracker continuous and one shot scanning modes :esphomepr:`3649` by :ghuser:`jonofmac` +- Add stop action for ble scanning :esphomepr:`3799` by :ghuser:`jesserockz` +- Add Prometheus Service Discovery for online devices :esphomepr:`3788` by :ghuser:`cznewt` +- Allow ble tracker to subscribe to ota start and stop the scanning :esphomepr:`3800` by :ghuser:`jesserockz` +- Add uFire ISE sensor :esphomepr:`3789` by :ghuser:`pvizeli` (new-integration) +- fix spi timing issues :esphomepr:`3763` by :ghuser:`IgnacioHR` +- null initialize total sensor for pulse counter :esphomepr:`3803` by :ghuser:`RoboMagus` +- Sim800l add calls, multiline sms and ussd :esphomepr:`3630` by :ghuser:`glmnet` +- Unify 'nullptr' initalization of class members; :esphomepr:`3805` by :ghuser:`RoboMagus` +- Initialize all child sensors to nullptr :esphomepr:`3808` by :ghuser:`jesserockz` +- Remove floating point calculation from ac_dimmer ISR :esphomepr:`3770` by :ghuser:`Azimath` +- split pronto codes if they are too long :esphomepr:`3812` by :ghuser:`ssieb` +- [BME280] raise standby time :esphomepr:`3804` by :ghuser:`h3ndrik` +- Make sprinkler reset_resume() method public :esphomepr:`3824` by :ghuser:`kbx81` +- Bump dashboard to 20220919.1 :esphomepr:`3828` by :ghuser:`balloob` +- Fix-esphome-validation-line-number :esphomepr:`3815` by :ghuser:`glmnet` +- Bump dashboard to 20220920.0 :esphomepr:`3831` by :ghuser:`balloob` +- Bump dashboard to 20220920.1 :esphomepr:`3834` by :ghuser:`glmnet` + +Past Changelogs +--------------- + +- :doc:`2022.8.0` +- :doc:`2022.6.0` +- :doc:`2022.5.0` +- :doc:`2022.4.0` +- :doc:`2022.3.0` +- :doc:`2022.2.0` +- :doc:`2022.1.0` +- :doc:`2021.12.0` +- :doc:`2021.11.0` +- :doc:`2021.10.0` +- :doc:`2021.9.0` +- :doc:`2021.8.0` +- :doc:`v1.20.0` +- :doc:`v1.19.0` +- :doc:`v1.18.0` +- :doc:`v1.17.0` +- :doc:`v1.16.0` +- :doc:`v1.15.0` +- :doc:`v1.14.0` +- :doc:`v1.13.0` +- :doc:`v1.12.0` +- :doc:`v1.11.0` +- :doc:`v1.10.0` +- :doc:`v1.9.0` +- :doc:`v1.8.0` +- :doc:`v1.7.0` diff --git a/changelog/index.rst b/changelog/index.rst index ff1d3bebd..db152813d 100644 --- a/changelog/index.rst +++ b/changelog/index.rst @@ -2,7 +2,7 @@ Changelog ========= .. redirect:: - :url: /changelog/2022.8.0.html + :url: /changelog/2022.9.0.html .. toctree:: :glob: diff --git a/components/binary_sensor/hydreon_rgxx.rst b/components/binary_sensor/hydreon_rgxx.rst index 8c220f303..844b9a0ca 100644 --- a/components/binary_sensor/hydreon_rgxx.rst +++ b/components/binary_sensor/hydreon_rgxx.rst @@ -40,7 +40,23 @@ Configuration variables: - **too_cold** (*Optional*): ``true`` if the sensor reports being too cold. Hydreon only mentions this feature for the RG-9. - - **name** (**Required**, string): The name for the voltage sensor. + - **name** (**Required**, string): The name for the sensor. + + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + + - All other options from :ref:`Binary Sensor `. + +- **lens_bad** (*Optional*): ``true`` if the sensor reports the lens being bad. + + - **name** (**Required**, string): The name for the sensor. + + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + + - All other options from :ref:`Binary Sensor `. + +- **em_sat** (*Optional*): ``true`` if the sensor reports the Emitter being saturated. + + - **name** (**Required**, string): The name for the sensor. - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. diff --git a/components/bluetooth_proxy.rst b/components/bluetooth_proxy.rst index 39f6c1c47..3e5bb8b44 100644 --- a/components/bluetooth_proxy.rst +++ b/components/bluetooth_proxy.rst @@ -5,7 +5,7 @@ Bluetooth Proxy :description: Instructions for setting up the Bluetooth Proxy in ESPHome. :image: bluetooth.svg -Home Assistant can expand it's Bluetooth reach by communicating through +Home Assistant can expand its Bluetooth reach by communicating through the Bluetooth proxy component in ESPHome. Place your ESPHome devices close to the Bluetooth devices that you want to interact with for the best experience. @@ -14,15 +14,32 @@ If you're looking to create a device that is just a Bluetooth Proxy, see our `Bl The Bluetooth proxy depends on :doc:`esp32_ble_tracker` so make sure to add that to your configuration. +.. note:: + + Bluetooth proxy requires Home Assistant 2022.9 or later. + +.. note:: + + The Bluetooth proxy of ESPHome currently only provides Home Assistant with passive sensor + data that is advertised by certain devices. Not all devices are supported and ESPHome does not decode or keep a list. + To find out if your device is supported, please search for it in the `Home Assistant Integrations `__ list. + + The Individual device integrations in Home Assistant (such as BTHome) will receive the data from the Bluetooth Integration in Home Assistant + which automatically aggregates all ESPHome bluetooth proxies with any USB Bluetooth Adapters you might have. + +Configuration: +-------------- + .. code-block:: bluetooth_proxy: -No configuration variables. +- **active** (*Optional*, boolean): Enables proxying active connections. Defaults to ``false``. Requires Home Assistant 2022.10 or later. See Also -------- - :doc:`esp32_ble_tracker` - :apiref:`bluetooth_proxy/bluetooth_proxy.h` +- BTHome ``__ - :ghedit:`Edit` diff --git a/components/button/factory_reset.rst b/components/button/factory_reset.rst new file mode 100644 index 000000000..03e1bfe09 --- /dev/null +++ b/components/button/factory_reset.rst @@ -0,0 +1,51 @@ +Factory Reset Button +==================== + +.. seo:: + :description: Instructions for setting up buttons that can remotely invalidate all ESPHome preferences stored in flash and reboot ESP. + :image: restart.svg + +The ``factory_reset`` button allows you to remotely invalidate (reset) all ESPHome :ref:`preferences ` stored in flash memory and reboot your node. +After reboot all states, parameters and variables will be reinitialized with their default values. This is useful: + +- for devices preflashed with ESPHome to reset behavior back to factory state +- in case of moving a device to a new environment or starting a new use-case (e.g. reset counters or state) +- for privacy concerns when giving away a device + +.. note:: + + **USE WITH GREAT CAUTION!** All credentials, global variables, counters and saved states stored in non-volatile memory will be lost with no chance of recovering them. + Even raw reading of flash memory with ``esptool`` will not help, since data is physically erased from flash memory. + + For devices configured using :doc:`captive portal `, this will reset WiFi settings as well, thus making such devices offline. + You'll need to be in close proximity to your device to configure it again using a built-in WiFi access point and captive portal. + + +.. figure:: images/factory-rst-ui.png + :align: center + :width: 80.0% + +.. code-block:: yaml + + # Example configuration entry + button: + - platform: factory_reset + name: Restart with Factory Default Settings + +Configuration variables: +------------------------ + +- **name** (**Required**, string): The name of the button. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- All other options from :ref:`Button `. + +See Also +-------- + +- :doc:`shutdown` +- :doc:`restart` +- :doc:`safe_mode` +- :doc:`/components/switch/factory_reset` +- :doc:`template` +- :apiref:`factory_reset/factory_reset_button.h` +- :ghedit:`Edit` diff --git a/components/button/images/factory-rst-ui.png b/components/button/images/factory-rst-ui.png new file mode 100644 index 000000000..d0f14a928 Binary files /dev/null and b/components/button/images/factory-rst-ui.png differ diff --git a/components/button/restart.rst b/components/button/restart.rst index 9f7f1ce2f..03be784b7 100644 --- a/components/button/restart.rst +++ b/components/button/restart.rst @@ -25,6 +25,9 @@ Configuration variables: See Also -------- +- :doc:`shutdown` +- :doc:`safe_mode` +- :doc:`factory_reset` - :doc:`/components/switch/restart` - :doc:`template` - :apiref:`restart/button/restart_button.h` diff --git a/components/button/safe_mode.rst b/components/button/safe_mode.rst index 0bd4a4a0b..ccf41371f 100644 --- a/components/button/safe_mode.rst +++ b/components/button/safe_mode.rst @@ -33,6 +33,8 @@ See Also - :doc:`shutdown` - :doc:`restart` +- :doc:`factory_reset` +- :doc:`/components/switch/safe_mode` - :doc:`template` - :apiref:`safe_mode/safe_mode_button.h` - :ghedit:`Edit` diff --git a/components/button/shutdown.rst b/components/button/shutdown.rst index 93c6e393c..68dadc518 100644 --- a/components/button/shutdown.rst +++ b/components/button/shutdown.rst @@ -32,6 +32,9 @@ See Also -------- - :doc:`restart` +- :doc:`safe_mode` +- :doc:`factory_reset` +- :doc:`/components/switch/shutdown` - :doc:`template` - :apiref:`shutdown/shutdown_button.h` - :ghedit:`Edit` diff --git a/components/climate/bedjet.rst b/components/climate/bedjet.rst index 1af5220eb..9fd6c9473 100644 --- a/components/climate/bedjet.rst +++ b/components/climate/bedjet.rst @@ -68,6 +68,31 @@ From :ref:`lambdas `, you can call methods to do some advanced st - lambda: |- id(bedjet_1).upgrade_firmware(); +- ``.send_local_time``: If `time_id` is set, attempt to sync the clock now. + + .. code-block:: yaml + + button: + - platform: template + name: "Sync Clock" + on_press: + then: + - lambda: |- + id(my_bedjet_fan).send_local_time(); + +- ``.set_clock``: Set the BedJet clock to a specified time; works with or without a `time_id`. + + .. code-block:: yaml + + button: + - platform: template + name: "Set Clock to 10:10pm" + on_press: + then: + - lambda: |- + id(my_bedjet_fan).set_clock(22, 10); + + ``bedjet`` Climate ------------------ @@ -97,29 +122,30 @@ Configuration variables: - All other options from :ref:`Climate `. -- ``.send_local_time``: If ``time_id`` is set, attempt to sync the clock now. +``bedjet`` Fan +-------------- - .. code-block:: yaml +The `fan` platform exposes the BedJet's fan-related functionality, including +on/off and speed control. - button: - - platform: template - name: "Sync Clock" - on_press: - then: - - lambda: |- - id(my_bedjet_fan).send_local_time(); +When the BedJet is already on, turning the Fan component off will set the BedJet unit's mode to +``OFF``. If it was not already on, it will be turned on to mode ``FAN_ONLY``. -- ``.set_clock``: Set the BedJet clock to a specified time; works with or without a ``time_id``. +.. code-block:: yaml - .. code-block:: yaml + fan: + - platform: bedjet + id: my_bedjet_fan_entity + name: "My BedJet Fan" + bedjet_id: bedjet_1 - button: - - platform: template - name: "Set Clock to 10:10pm" - on_press: - then: - - lambda: |- - id(my_bedjet_fan).set_clock(22, 10); +Configuration variables: +************************ + +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- **name** (**Required**, string): The name of the fan device. +- **bedjet_id** (**Required**, :ref:`config-id`): The ID of the Bedjet component. +- Other options from :ref:`Fan `. Known issues: ------------- diff --git a/components/climate/index.rst b/components/climate/index.rst index dd9c13aee..927e217ad 100644 --- a/components/climate/index.rst +++ b/components/climate/index.rst @@ -27,9 +27,9 @@ All climate platforms in ESPHome inherit from the climate configuration schema. climate: - platform: ... visual: - min_temperature: 18 °C - max_temperature: 25 °C - temperature_step: 0.1 °C + min_temperature: 18 + max_temperature: 25 + temperature_step: 0.1 Configuration variables: diff --git a/components/climate/thermostat.rst b/components/climate/thermostat.rst index 66e62fa8b..460304810 100644 --- a/components/climate/thermostat.rst +++ b/components/climate/thermostat.rst @@ -180,9 +180,9 @@ than ``off``. If this option is not configured, you'll need to manually change the front end (Home Assistant), an ESPHome action, automation, or from within a lambda elsewhere in your device's configuration. -- **default_target_temperature_low** (*Optional*, *Deprecated*, float): The default low target +- **default_target_temperature_low** (*Optional*, float): The default low target temperature for the control algorithm. This can be dynamically set in the frontend later. -- **default_target_temperature_high** (*Optional*, *Deprecated*, float): The default high target +- **default_target_temperature_high** (*Optional*, float): The default high target temperature for the control algorithm. This can be dynamically set in the frontend later. **At least one of** ``default_target_temperature_low`` **and** ``default_target_temperature_high`` @@ -190,9 +190,9 @@ device's configuration. .. note:: - **default_mode**, **default_target_temperature_low**, and **default_target_temperature_high** are - deprecated and will be removed in a future release. You should migrate your configuration to using - a :ref:`preset ` which allows for more flexibility and customisation + **default_mode**, **default_target_temperature_low**, and **default_target_temperature_high** are + being removed in a future release. In the future you will need to migrate your configuration to using + a :ref:`preset ` which will allow for more flexibility and customisation Note that ``min_temperature`` and ``max_temperature`` from the base climate component are used to define the range of allowed temperature values in the thermostat component. See :doc:`/components/climate/index`. diff --git a/components/cover/feedback.rst b/components/cover/feedback.rst index 4f5fd4607..2f087be28 100644 --- a/components/cover/feedback.rst +++ b/components/cover/feedback.rst @@ -68,7 +68,7 @@ Movement Sensors If movement feedback is available, the cover no longer operates in *optimistic mode* (assuming that movement starts as soon as an action is triggered) and can also react to commands issued to cover from an external control and still -keep states in sync (useful for "smartization" of and existing cover). +keep states in sync (useful for "smartization" of an existing cover). When there are no specific endstop sensors, and if the cover has builtin endstops and no external control logic, these movement sensors can optionally be use to infer the endstop state. @@ -198,7 +198,7 @@ Most options can be left untouched, but some modifications are needed: id: open_binary_sensor sensor_id: open_current_sensor threshold: 0.5 - filter: + filters: - delayed_off: 0.8s - platform: analog_threshold id: open_obstacle_binary_sensor diff --git a/components/cover/index.rst b/components/cover/index.rst index cc418a643..4e1170faa 100644 --- a/components/cover/index.rst +++ b/components/cover/index.rst @@ -200,7 +200,7 @@ Lambdas From :ref:`lambdas `, you can access the current state of the cover (note that these fields are read-only, if you want to act on the cover, use the ``make_call()`` method as shown above). -- ``position``: Retrieve the current position of the cover, as a value between ``0.0`` (open) and ``1.0`` (closed). +- ``position``: Retrieve the current position of the cover, as a value between ``0.0`` (closed) and ``1.0`` (open). .. code-block:: cpp diff --git a/components/cover/time_based.rst b/components/cover/time_based.rst index e9ca8e493..e5b321713 100644 --- a/components/cover/time_based.rst +++ b/components/cover/time_based.rst @@ -64,6 +64,13 @@ Configuration variables: The stop button on the UI is always enabled even when the cover is stopped and each press on the button will cause the ``stop_action`` to be performed. +.. note:: + + The state of the cover can be restored from flash after a node reboot, with + ``esp8266_restore_from_flash: true`` option set. + See :doc:`esp8266_restore_from_flash ` for details. + + See Also -------- diff --git a/components/display/images/tm1621-full.jpg b/components/display/images/tm1621-full.jpg new file mode 100644 index 000000000..baa710854 Binary files /dev/null and b/components/display/images/tm1621-full.jpg differ diff --git a/components/display/images/tm1638-full.jpg b/components/display/images/tm1638-full.jpg new file mode 100644 index 000000000..336b1c84d Binary files /dev/null and b/components/display/images/tm1638-full.jpg differ diff --git a/components/display/index.rst b/components/display/index.rst index 243bdd972..329ddb154 100644 --- a/components/display/index.rst +++ b/components/display/index.rst @@ -149,10 +149,11 @@ Fonts 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 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 :) +at **any** size, as well as fixed-size `PCF `_ and `BDF `_ bitmap fonts! 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 ESPHome configuration file. Just grab -a ``.ttf`` file from somewhere on the internet and place it, for example, +a ``.ttf``, ``.pcf``, or ``.bdf`` file from somewhere on the internet and place it, for example, inside a ``fonts`` folder next to your configuration file. Next, create a ``font:`` section in your configuration: @@ -169,12 +170,15 @@ Next, create a ``font:`` section in your configuration: id: roboto size: 20 + - file: "fonts/tom-thumb.bdf" + id: tomthumb + display: # ... Configuration variables: -- **file** (**Required**): The path (relative to where the .yaml file is) of the TrueType font +- **file** (**Required**): The path (relative to where the .yaml file is) of the font file. You can use the ``gfonts://`` short form to use Google Fonts, or use the below structure: - **type** (**Required**, string): Can be ``gfonts`` or ``local``. @@ -200,12 +204,13 @@ Configuration variables: **Local Fonts**: - - **path** (**Required**, string): The path (relative to where the .yaml file is) of the TrueType font file. + - **path** (**Required**, string): The path (relative to where the .yaml file is) of the TrueType or bitmap font file. - **id** (**Required**, :ref:`config-id`): The ID with which you will be able to reference the font later in your display code. - **size** (*Optional*, int): The size of the font in pt (not pixel!). - If you want to use the same font in different sizes, create two font objects. Defaults to ``20``. + If you want to use the same font in different sizes, create two font objects. Note: *size* is ignored + by bitmap fonts. Defaults to ``20``. - **glyphs** (*Optional*, list): A list of characters you plan to use. Only the characters you specify here will be compiled into the binary. Adjust this if you need some special characters or want to reduce the size of the binary if you don't plan to use some glyphs. The items in the list can also @@ -216,7 +221,7 @@ Configuration variables: .. note:: 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 Home Assistant + to translate the TrueType and bitmap font files into an internal format. If you're running this as a Home Assistant add-on or with the official ESPHome docker image, it should already be installed. Otherwise you need to install it using ``pip install pillow``. diff --git a/components/display/max7219digit.rst b/components/display/max7219digit.rst index 7c3370f65..dd4db5f13 100644 --- a/components/display/max7219digit.rst +++ b/components/display/max7219digit.rst @@ -21,7 +21,7 @@ CS to your set ``cs_pin`` and finally GND to GND. You can even daisy-chain multiple MAX7219s by connecting the DOUT of the previous chip in the chain to the next DIN. With more than ~3 chips the 3.3V will probably not be enough, so then you will have to potentially -use a logic level converted. +use a logic level converter. .. code-block:: yaml diff --git a/components/display/pvvx_mithermometer.rst b/components/display/pvvx_mithermometer.rst new file mode 100644 index 000000000..7aa69b633 --- /dev/null +++ b/components/display/pvvx_mithermometer.rst @@ -0,0 +1,234 @@ +PVVX MiThermometer Display +========================== + +.. seo:: + :description: Instructions for setting up BLE devices with PVVX MiThermometer custom firmware as displays. + :image: /components/sensor/images/xiaomi_lywsd03mmc.jpg + +The ``pvvx_mithermometer`` display platform allows you to use devices running the `ATC_MiThermometer firmware `__ by pvvx as display drivers with ESPHome. + +.. figure:: /components/sensor/images/xiaomi_lywsd03mmc.jpg + :align: center + :width: 75.0% + + Xiaomi LYWSD03MMC. + +The data to be displayed is transmitted as external data via BLE. +To do this, a ``ble_client`` component must be set up. +This component can also synchronize the time of the pvvx device by transmitting a timestamp on each connection. +After the data has been transmitted, the BLE connection is terminated in order to be able to receive the advertising data required for the ``pvvx_mithermometer`` sensor platform. + +The pvvx firmware refreshes the screen periodically (can be set as minimum LCD refresh rate in the firmware configuration). +By default, the internal sensor data and, if available and valid (``validity_period``), the external data are switched every 2.5 s. +Further firmware configuration makes it possible to activate other display modes such as time and battery status. +The firmware configuration can be changed via browser using `TelinkMiFlasher.html `__. + +.. code-block:: yaml + + # Example configuration entry + esp32_ble_tracker: + + ble_client: + - mac_address: "A4:C1:38:B1:CD:7F" + id: pvvx_ble_display + + display: + - platform: pvvx_mithermometer + ble_client_id: pvvx_ble_display + lambda: |- + it.print_bignum(23.1); + it.print_unit(pvvx_mithermometer::UNIT_DEG_C); + it.print_smallnum(33); + it.print_percent(true); + it.print_happy(true); + it.print_bracket(true); + + +Configuration variables: +------------------------ + +- **ble_client_id** (**Required**, :ref:`config-id`): ID of the associated BLE client. +- **time_id** (*Optional*, :ref:`config-id`): ID of a :doc:`/components/time` component. If set, the time will be synchronized with every connection. +- **disconnect_delay** (*Optional*, :ref:`config-time`): The amount of time the BLE connection is maintained before being disconnected again. Defaults to ``5s``. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to transmit the display data. Defaults to ``60s``. +- **validity_period** (*Optional*, :ref:`config-time`): The time periode for which the pvvx device should display the information. Defaults to ``5min``. +- **lambda** (*Optional*, :ref:`lambda `): The lambda to use to define the information to be displayed. + See :ref:`display-pvvx_mithermometer_lambda` for more information. +- **auto_clear_enabled** (*Optional*, boolean): Whether to automatically clear the display data before each lambda call, + or to keep the existing display content (must overwrite explicitly, e.g., only on data change). Defaults to ``true``. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. + +.. _display-pvvx_mithermometer_lambda: + +Rendering Lambda +---------------- + +The ``pvvx_mithermometer`` displays can only show two numbers with optional units and a smiley face. Therefore, the API is tailord to these limitations. +In the lambda you're passed a variable called ``it`` as with all other displays. In this case however, ``it`` is a ``PVVXDisplay`` instance (see API Reference). + +.. code-block:: yaml + + display: + - platform: pvvx_mithermometer + # ... + lambda: |- + // Print -2.1 as big number (first row) + it.print_bignum(-2.1); + // Print °C next to the big number + it.print_unit(pvvx_mithermometer::UNIT_DEG_C); + // Print 88 as small number (second row) + it.print_smallnum(88); + // Print % next to the small number + it.print_percent(true); + // Print the low battery symbol + it.print_battery(true); + + // Print a happy smiley. Results in " ^_^ " + it.print_happy(true); + // Print a sad smiley. Results in " -∧- " + it.print_sad(true); + // The comination of happy and sad simley results in " Δ△Δ " + + // Print round brackets around the simley + it.print_bracket(true); + // The final result is "(Δ△Δ)" + + +Valid values for the big number (``it.print_bignum()``) are from -99.5 to 1999.5. Smaller values are displayed as ``Lo``, larger ones as ``Hi``. It will be printed to the screen. If not defined, a 0 will be displayed. + +Valid values for the small number (``it.print_smallnum()``) are from -9 to 99. Smaller values are displayed as ``Lo``, larger ones as ``Hi``. If not defined, a 0 will be displayed. + +Possible values for the unit of the big number (``it.print_unit()``) are: + +- ``pvvx_mithermometer::UNIT_NONE``: do not show a unit +- ``pvvx_mithermometer::UNIT_DEG_GHE``: show ``°Г`` +- ``pvvx_mithermometer::UNIT_MINUS``: show ``-`` +- ``pvvx_mithermometer::UNIT_DEG_F``: show ``°F`` +- ``pvvx_mithermometer::UNIT_LOWDASH``: show ``_`` +- ``pvvx_mithermometer::UNIT_DEG_C``: show ``°C`` +- ``pvvx_mithermometer::UNIT_LINES``: show ``=`` +- ``pvvx_mithermometer::UNIT_DEG_E``: show ``°E`` + +The appearance of the smiley can be defined by combining the functions ``it.print_happy()``, ``it.print_sad()`` and ``it.print_bracket(true)``: + +=================== =============== ================= ========== +``print_bracket()`` ``print_sad()`` ``print_happy()`` result +=================== =============== ================= ========== +false false false +false false true ``^_^`` +false true false ``-∧-`` +false true true ``Δ△Δ`` +true false false ``( )`` +true false true ``(^_^)`` +true true false ``(-∧-)`` +true true true ``(Δ△Δ)`` +=================== =============== ================= ========== + + +Display states of other sensors +******************************* + +The following example display the sensor states of a MiFlora sensor on a pvvx display. The time is also synchronized. + +.. code-block:: yaml + + time: + - platform: homeassistant + id: homeassistant_time + + esp32_ble_tracker: + + ble_client: + - mac_address: "A4:C1:38:B1:CD:7F" + id: pvvx_ble_display + + sensor: + - platform: pvvx_mithermometer + mac_address: "A4:C1:38:B1:CD:7F" + temperature: + name: "PVVX Temperature" + humidity: + name: "PVVX Humidity" + battery_level: + name: "PVVX Battery-Level" + battery_voltage: + name: "PVVX Battery-Voltage" + - platform: xiaomi_hhccjcy01 + mac_address: '94:2B:FF:5C:91:61' + temperature: + name: "Xiaomi HHCCJCY01 Temperature" + id: miflora_temperature + moisture: + name: "Xiaomi HHCCJCY01 Moisture" + id: miflora_moisture + illuminance: + name: "Xiaomi HHCCJCY01 Illuminance" + conductivity: + name: "Xiaomi HHCCJCY01 Soil Conductivity" + + display: + - platform: pvvx_mithermometer + ble_client_id: pvvx_ble_display + update_interval: 10min + validity_period: 15min + time_id: homeassistant_time + lambda: |- + double temp = id(miflora_temperature).state; + double moisture = id(miflora_moisture).state; + it.print_bignum(temp); + it.print_unit(pvvx_mithermometer::UNIT_DEG_C); + it.print_smallnum(moisture); + it.print_percent(); + if (temp < 5 || temp > 30 || moisture < 10 || moisture > 50) { + it.print_sad(); + } else { + it.print_happy(); + } + +Only synchronize the time once a day +************************************ + +The following example will synchronized the time of the pvvx device once a day. + +.. code-block:: yaml + + time: + - platform: homeassistant + id: homeassistant_time + + esp32_ble_tracker: + + ble_client: + - mac_address: "A4:C1:38:B1:CD:7F" + id: pvvx_ble_display + + sensor: + - platform: pvvx_mithermometer + mac_address: "A4:C1:38:B1:CD:7F" + temperature: + name: "PVVX Temperature" + humidity: + name: "PVVX Humidity" + battery_level: + name: "PVVX Battery-Level" + battery_voltage: + name: "PVVX Battery-Voltage" + + display: + - platform: pvvx_mithermometer + ble_client_id: pvvx_ble_display + update_interval: 24h + validity_period: 0s + time_id: homeassistant_time + + + +See Also +-------- + +- :doc:`index` +- :doc:`/components/ble_client` +- :doc:`/components/sensor/xiaomi_ble` +- :apiref:`pvvx_mithermometer/display/pvvx_display.h` +- `ATC_MiThermometer firmware `__ by `pvvx `__ +- :ghedit:`Edit` diff --git a/components/display/tm1621.rst b/components/display/tm1621.rst new file mode 100644 index 000000000..169ff2e95 --- /dev/null +++ b/components/display/tm1621.rst @@ -0,0 +1,92 @@ +TM1621 LCD Display +======================== + +.. seo:: + :description: Instructions for setting up TM1621 LCD Display. + :image: tm1621.jpg + +The ``tm1621`` display platform allows you to use the popular TM1621 LCD display drivers with ESPHome, that can find in Sonoff device like THR316D, THR320D, POWR316D or POWR320D + +.. figure:: images/tm1621-full.jpg + :align: center + :width: 75.0% + + TM1621 LCD Display. + +The LCD have four signal, ``cs`` for chip select, ``data`` for data signal, ``read`` for reading data dir and ``write`` for writing data dir + + +.. code-block:: yaml + + # Example configuration entry + display: + platform: tm1621 + id: tm1621_display + cs_pin: GPIO17 + data_pin: GPIO5 + read_pin: GPIO23 + write_pin: GPIO18 + lambda: |- + it.printf(0, "%.1f", id(my_sensor1).state); + it.display_celsius(true); + it.printf(1, "%.1f", id(my_sensor2).state); + it.display_humidity(true); + +Configuration variables: +------------------------ + +- **cs_pin** (**Required**, :ref:`Pin Schema `): The pin you have the CS line. +- **data_pin** (**Required**, :ref:`Pin Schema `): The pin you have the DATA line. +- **read_pin** (**Required**, :ref:`Pin Schema `): The pin you have the READ line. +- **write_pin** (**Required**, :ref:`Pin Schema `): The pin you have the WRITE line. +- **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the TM1621. + See :ref:`display-tm1621_lambda` for more information. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``1s``. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. + +.. _display-tm1621_lambda: + +Rendering Lambda +---------------- + +The TM1621 has a similar API to the fully fledged :ref:`display-engine`, but it's only a subset as the TM1621 +LCD displays don't have a concept of individual pixels. In the lambda you're passed a variable called ``it`` +as with all other displays. In this case however, ``it`` is a TM1621 instance (see API Reference). + +The most basic operation with the TM1621 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 ``"0123"``), ESPHome converts it +into a representation that the TM1621 can understand. + +Each of the three methods (``print`` and ``printf``) all optionally take a the line number (0 for first line and 1 for the second). +This argument is ``0`` by default. + +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 + + display: + - platform: tm1621 + # ... + lambda: |- + it.printf(0, "%.1f", id(my_sensor1).state); + it.display_celsius(true); + it.printf(1, "%.1f", id(my_sensor2).state); + it.display_humidity(true); + + +Please see :ref:`display-printf` for a quick introduction into the ``printf`` formatting rules. + +Also we have five function to display or not some unites: + - °C on the first line : ``display_celsius(bool)`` + - °F on the first line : ``display_fahrenheit(bool)`` + - %HR on the second line : ``display_humidity(bool)`` + - V on the first line and A on the second line : ``display_voltage(bool)`` + - kW/h on the first line and W on the second line : ``display_kwh(bool)`` + +See Also +-------- + +- :doc:`index` +- :apiref:`tm1621/tm1621.h` +- :ghedit:`Edit` diff --git a/components/display/tm1638.rst b/components/display/tm1638.rst new file mode 100644 index 000000000..742f1ccbd --- /dev/null +++ b/components/display/tm1638.rst @@ -0,0 +1,188 @@ +TM1638 7 Segment Display Keypad & LED Module +============================================ + +.. seo:: + :description: Instructions for setting up TM1638 7 Segment Display Keypad & LED Module + :image: tm1638.jpg + +The ``tm1638`` display platform allows you to use the popular TM1638 7 Segment Display Keypad & LED Module with ESPHome. + +.. figure:: images/tm1638-full.jpg + :align: center + :width: 75.0% + + TM1638 8-Segment Display Keypad & LED Module. + +The module can be powered with 5v DC. To display the colon punctuation use the +``.`` in the colon place. (See clock example below) + + +.. code-block:: yaml + + # Example configuration entry + display: + platform: tm1638 + id: tm1638_display + stb_pin: 5 + clk_pin: 18 + dio_pin: 23 + intensity: 5 + update_interval: 5s + lambda: |- + it.print("0123"); + + +Configuration variables: +------------------------ + +- **stb_pin** (**Required**, :ref:`Pin Schema `): The pin you have the STB line hooked up to. +- **clk_pin** (**Required**, :ref:`Pin Schema `): The pin you have the CLK line hooked up to. +- **dio_pin** (**Required**, :ref:`Pin Schema `): The pin you have the DIO line hooked up to. +- **intensity** (*Optional*, int): The intensity with which the TM1638 should drive the outputs. Range is from + 0 (least intense) to 7 (the default). This setting will affect the 7 segment display and the 8 individual LED lights. +- **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the TM1638. + See :ref:`display-tm1638_lambda` for more information. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``1s``. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. + +.. _display-tm1638_lambda: + +Rendering Lambda +---------------- + +The TM1638 has a similar API to the fully fledged :ref:`display-engine`, but it's only a subset as the TM1638 +7-segment Display Keypad & LED Module does not have a concept of individual pixels. In the lambda you're passed a variable called ``it`` +as with all other displays. In this case however, ``it`` is a TM1638 instance (see API Reference). + +The most basic operation with the TM1638 is writing 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 ``"0123"``), ESPHome converts it +into a representation that the TM1638 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:`at the MAX7219 docs `. + +Each of the three methods (``print``, ``printf`` and ``strftime``) all optionally take a position argument at the +beginning which can be used to print the text at a specific position. This argument is ``0`` by default which +means the first character of the first TM1638. For example to start the first character of your text at +the end of the TM1638, you would write ``it.print(3, "0");``. + +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 + + display: + - platform: tm1638 + # ... + lambda: |- + // Print 0 at position 0 (left) + it.print("0"); + // Result: "0 " + + // Print 1 at position 1 (second character) + it.print(1, "1"); + // Result: "01 " + + // Let's write a sensor value (let's assume it's 42.1) + it.printf(0, "%.1f", id(my_sensor).state); + // Result: "42.1 " (the dot will appear on the "2" segment) + + // Overwrite the previous content with blank + it.print(" "); + // Print a right-padded sensor value with 0 digits after the decimal + it.printf("S%3.0f", id(my_sensor).state); + // Result: "S 42" + + // Print the current time + it.strftime("%H.%M"); + // Result for 10:06:42 -> "10:06" on a display with : and "10.06" on a display with . + +Please see :ref:`display-printf` for a quick introduction into the ``printf`` formatting rules and +:ref:`display-strftime` for an introduction into the ``strftime`` time formatting. + +Creating a digital clock +************************ + +The following example creates a typical digital clock with the ``:`` colon flashing every second. + + +.. code-block:: yaml + + + time: + - platform: homeassistant + id: homeassistant_time + + display: + platform: tm1638 + clk_pin: 18 + dio_pin: 23 + stb_pin: 5 + update_interval: 500ms + lambda: |- + static int i = 0; + i++; + if ((i % 2) == 0) + it.strftime("%H.%M", id(homeassistant_time).now()); + else + it.strftime("%H%M", id(homeassistant_time).now()); + + +LEDs +---------------- +The TM1638 7 Segment Display Keypad & LED Module has 8 LED lights across the top or middle of the display, depending on the board. These LEDs can be exposed as :doc:`switches ` or :doc:`outputs ` with the led property set between 0 and 7. The board has the LEDs labelled 1-8, but the leds use zero based addressing. The LED labelled "1" is LED 0 in the configuration. + +.. code-block:: yaml + + switch: + - platform: tm1638 + id: TM1638Led1 + led: 0 + + output: + - platform: tm1638 + id: TM1638Led2 + led: 1 + + + +Buttons +---------------- +The TM1638 7 Segment Display Keypad & LED Module has 8 buttons across the top or middle of the display, depending on the board. These buttons are exposed as binary sensor components with the key property set between 0 and 7, They can be accessed via the binary sensor component configuration. As with the LEDs the buttons are labeled 1-8 on the board, but use zero based addressing. Therefore the button labelled "1" is key 0 in the configuration. See :doc:`/components/binary_sensor/index` + +.. code-block:: yaml + + binary_sensor: + - platform: tm1638 + name: "TM1638 Button 1" + id: TM1638Button1 + key: 0 + filters: + - delayed_on: 10ms + on_press: + then: + - switch.turn_on: TM1638Led1 + on_release: + then: + - switch.turn_off: TM1638Led1 + + - platform: tm1638 + name: "TM1638 Button 2" + id: TM1638Button2 + key: 1 + filters: + - delayed_on: 10ms + on_press: + then: + - output.turn_on: TM1638Led2 + on_release: + then: + - output.turn_off: TM1638Led2 + + +See Also +-------- + +- :doc:`index` +- :doc:`/components/switch/index` +- :doc:`/components/binary_sensor/index` +- :apiref:`tm1638/tm1638.h` +- :ghedit:`Edit` diff --git a/components/esp32_ble_tracker.rst b/components/esp32_ble_tracker.rst index 2f15c0228..46725292c 100644 --- a/components/esp32_ble_tracker.rst +++ b/components/esp32_ble_tracker.rst @@ -72,7 +72,10 @@ Configuration variables: impact on the device but can be used to debug the BLE stack. Defaults to ``5min``. - **active** (*Optional*, boolean): Whether to actively send scan requests to request more data after having received an advertising packet. With some devices this is necessary to receive all data, - but also drains those devices' power a (tiny) bit more. Defaults to ``true``. + but also drains those devices' power a bit more. Some devices don't need this, in that case + you can save power and RF pollution by setting it to ``false``. Defaults to ``true``. + - **continuous** (*Optional*, boolean): Whether to scan continuously (forever) or to only scan when + asked to start a scan (with start_scan action). Defaults to ``true``. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID for this ESP32 BLE Hub. @@ -86,14 +89,17 @@ Automations: - **on_ble_service_data_advertise** (*Optional*, :ref:`Automation `): An automation to perform when a Bluetooth advertising with service data is received. See :ref:`esp32_ble_tracker-on_ble_service_data_advertise`. +- **on_scan_end** (*Optional*, :ref:`Automation `): An automation to perform when + a BLE scan has completed (the duration of the scan). This works with continuous set to true or false. + ESP32 Bluetooth Low Energy Tracker Automation --------------------------------------------- .. _esp32_ble_tracker-on_ble_advertise: -``on_ble_advertise`` -******************** +``on_ble_advertise`` Trigger +************************************************ This automation will be triggered when a Bluetooth advertising is received. A variable ``x`` of type :apiclass:`esp32_ble_tracker::ESPBTDevice` is passed to the automation for use in lambdas. @@ -128,8 +134,8 @@ Configuration variables: .. _esp32_ble_tracker-on_ble_manufacturer_data_advertise: -``on_ble_manufacturer_data_advertise`` -************************************** +``on_ble_manufacturer_data_advertise`` Trigger +************************************************ This automation will be triggered when a Bluetooth advertising with manufcaturer data is received. A variable ``x`` of type ``std::vector`` is passed to the automation for use in lambdas. @@ -159,8 +165,8 @@ Configuration variables: .. _esp32_ble_tracker-on_ble_service_data_advertise: -``on_ble_service_data_advertise`` -********************************* +``on_ble_service_data_advertise`` Trigger +************************************************ This automation will be triggered when a Bluetooth advertising with service data is received. A variable ``x`` of type ``std::vector`` is passed to the automation for use in lambdas. @@ -185,10 +191,82 @@ Configuration variables: - **service_uuid** (**Required**, string): 16 bit, 32 bit, or 128 bit BLE Service UUID. - See :ref:`Automation `. +``on_scan_end`` Trigger +************************************************ + +This automation will be triggered when a Bluetooth scanning sequence has completed. If running +with continuous set to true, this will trigger every time the scan completes (the duration of +a scan). + +.. code-block:: yaml + + esp32_ble_tracker: + on_scan_end: + - then: + - lambda: |- + ESP_LOGD("ble_auto", "The scan has ended!"); + +Configuration variables: + +- None + +- See :ref:`Automation `. + +``esp32_ble_tracker.start_scan`` Action +************************************************ + +Start a Bluetooth scan. If there is a scan already in progress, then the action is ignored. + +.. code-block:: yaml + + esp32_ble_tracker: + scan_parameters: + continuous: false + + on_...: + - esp32_ble_tracker.start_scan: + +Configuration variables: + +- **continuous** (*Optional*, boolean): Whether to start the scan in continuous mode. Defaults to ``false`` + +.. note:: + + This action can also be written in :ref:`lambdas `: +.. code-block:: yaml + + esp32_ble_tracker: + id: ble_tracker_id + +.. code-block:: cpp + + id(ble_tracker_id).start_scan() + +``esp32_ble_tracker.stop_scan`` Action +************************************************ + +Stops the bluetooth scanning. It can be started again with the above start scan action. + +.. code-block:: yaml + + esp32_ble_tracker: + + on_...: + - esp32_ble_tracker.stop_scan: + See Also -------- -- :doc:`binary_sensor/ble_presence` +- :doc:`text_sensor/ble_scanner` +- :doc:`sensor/ble_rssi` +- :doc:`sensor/b_parasite` +- :doc:`sensor/xiaomi_ble` +- :doc:`sensor/xiaomi_miscale` +- :doc:`sensor/inkbird_ibsth1_mini` +- :doc:`sensor/mopeka_pro_check` +- :doc:`sensor/ruuvitag` +- :doc:`ble_client` +- :doc:`bluetooth_proxy` - :apiref:`esp32_ble_tracker/esp32_ble_tracker.h` - `ESP32 BLE for Arduino `__ by `Neil Kolban `__. - :ghedit:`Edit` diff --git a/components/ethernet.rst b/components/ethernet.rst index 0fa897e1d..8b257a760 100644 --- a/components/ethernet.rst +++ b/components/ethernet.rst @@ -6,9 +6,11 @@ Ethernet Component :image: ethernet.svg :keywords: Ethernet, ESP32 -This core ESPHome component sets up ethernet connections for ESP32s. +This ESPHome component enables *wired* Ethernet connections for ESP32s. + Ethernet for ESP8266 is not supported. -This component can't be used in same time than Wifi one, even if your ESP32 has both wired. + +This component and the Wi-Fi component may **not** be used simultaneously, even if both are physically available. .. code-block:: yaml @@ -29,24 +31,23 @@ This component can't be used in same time than Wifi one, even if your ESP32 has Configuration variables: ------------------------ -- **type** (**Required**, string): The type of LAN chipset. Must be one of - ``LAN8720`` or ``TLK110`` (see datasheet for more details). +- **type** (**Required**, string): The type of LAN chipset/phy. Must be one of + ``LAN8720``, ``TLK110`` or ``IP101`` (see datasheet for more details). - **mdc_pin** (**Required**, :ref:`config-pin`): The MDC pin of the board. Usually this is ``GPIO23``. - **mdio_pin** (**Required**, :ref:`config-pin`): The MDIO pin of the board. Usually this is ``GPIO18``. -- **clk_mode** (*Optional*, string): The clock mode of the data lines, this must be one - of these values: (see datasheet of your board for more details) +- **clk_mode** (*Optional*, string): The clock mode of the data lines. See your board's + datasheet for more details. Must be one of the following values: - ``GPIO0_IN`` (Default) - External clock - ``GPIO0_OUT`` - Internal clock - ``GPIO16_OUT`` - Internal clock - ``GPIO17_OUT`` - Internal clock -- **phy_addr** (*Optional*, int): The PHY addr type of the ethernet controller. Defaults to 0. -- **power_pin** (*Optional*, :ref:`Pin Schema `): The pin with which - to control the power of the board. Leave unspecified for no power pin (default) - +- **phy_addr** (*Optional*, int): The PHY addr type of the Ethernet controller. Defaults to 0. +- **power_pin** (*Optional*, :ref:`Pin Schema `): The pin controlling the + power/reset status of the Ethernet controller. Leave unspecified for no power pin (default). - **manual_ip** (*Optional*): Manually configure the static IP of the node. - **static_ip** (**Required**, IPv4 address): The static IP of your node. @@ -66,9 +67,10 @@ Configuration variables: .. note:: - If your ethernet board is not designed with an ESP32 built in, chances are that you are going - to use flying leads, dupont wires, etc. to connect the ethernet to the ESP32. This is - probably to fail as the ethernet interface uses a high frequency clock signal. For more + If your Ethernet board is not designed with an ESP32 built in, it's common to attempt + to use flying leads, dupont wires, etc. to connect the Ethernet controller to the ESP32. + This approach is likely to fail, however, as the Ethernet interface uses a high frequency + clock signal that will not travel reliably over these types of connections. For more information and wiring details refer to the link in the *See also* section. Configuration for Olimex ESP32-POE @@ -151,7 +153,7 @@ Configuration for OpenHacks LAN8720 program properly. Configuration for wESP32 board (up to rev.6) -------------------------------------------------- +-------------------------------------------- .. code-block:: yaml @@ -167,6 +169,19 @@ Configuration for wESP32 board (up to rev.6) Revision 7 and upwards of the wESP32 board does not have a LAN8720 chip. Until support for the replacement RTL8201 is included in ESPHome, the wESP board rev.7 will not work with the above configuration. +Configuration for ESP32-Ethernet-Kit board +------------------------------------------ + +.. code-block:: yaml + + ethernet: + type: IP101 + mdc_pin: GPIO23 + mdio_pin: GPIO18 + clk_mode: GPIO0_IN + phy_addr: 1 + power_pin: GPIO5 + See Also -------- diff --git a/components/mqtt.rst b/components/mqtt.rst index fab2d1529..03468b841 100644 --- a/components/mqtt.rst +++ b/components/mqtt.rst @@ -290,6 +290,21 @@ You have to download the server CA certficiate in PEM format and add it to ``cer Usually these are .crt files and you can open them with any text editor. Also make sure to change the ``port`` of the mqtt broker. Most brokers use port 8883 for TLS connections. +.. warning:: + + MbedTLS, the library that handles TLS for the esp-idf, doesn't validate wildcard certificates. + + The Common Name check only works if the CN is explicitly reported in the certificate. + + - \*.example.com -> Fail + - mqtt.example.com -> Success + + If a secure connection is necessary for your device, you really want to set: + + .. code-block:: yaml + + skip_cert_cn_check: false + .. code-block:: yaml mqtt: @@ -298,6 +313,7 @@ Also make sure to change the ``port`` of the mqtt broker. Most brokers use port discovery: true discovery_prefix: ${mqtt_prefix}/homeassistant log_topic: ${mqtt_prefix}/logs + # Evaluate carefully skip_cert_cn_check skip_cert_cn_check: true idf_send_async: false certificate_authority: | diff --git a/components/ota.rst b/components/ota.rst index 0c44b90ab..1e053fa4f 100644 --- a/components/ota.rst +++ b/components/ota.rst @@ -177,6 +177,9 @@ enum. These values are: Updating the password: ---------------------- +Changing an existing password: +****************************** + 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 an ``on_boot`` trigger: @@ -191,6 +194,12 @@ through an ``on_boot`` trigger: password: "Old password" id: my_ota +Adding a password: +****************** + +If OTA is already enabled without a password, simply add a ``password:`` line to the existing +``ota:`` config block. + See Also -------- diff --git a/components/prometheus.rst b/components/prometheus.rst index 315e23b10..37b9dd0b0 100644 --- a/components/prometheus.rst +++ b/components/prometheus.rst @@ -29,6 +29,7 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **include_internal** (*Optional*, boolean): Whether ``internal`` entities should be displayed on the web interface. Defaults to ``false``. +- **relabel** (*Optional*): Override metric labels. See :ref:`prometheus-relabel` .. note:: @@ -41,6 +42,32 @@ Configuration variables: static_configs: - targets: [] +Metric Relabeling +----------------- + +ESPHome allows you to do some basic relabeling of Prometheus metrics. +This is useful if you want to have different metric names or IDs than those shown in Home Assistant or the web interface. + +You can relabel metric name or ID labels by adding a ``relabel`` block in the ``prometheus`` configuration, +and then adding a block with ``id`` and/or ``name`` fields for each sensor whose labels your want to override. + +.. _prometheus-relabel: + +``relabel`` +*********** + +Set the the ``id`` and ``name`` label values of the Prometheus metric for the sensor with the specified ID. + +.. code-block:: yaml + + # Example configuration entry + prometheus: + relabel: + my_voltage_sensor: + id: angry_pixies + name: "Angry Pixies" + + See Also -------- diff --git a/components/remote_receiver.rst b/components/remote_receiver.rst index 689bbe169..f7ca562f3 100644 --- a/components/remote_receiver.rst +++ b/components/remote_receiver.rst @@ -30,6 +30,7 @@ Configuration variables: - **dump** (*Optional*, list): Decode and dump these remote codes in the logs (at log.level=DEBUG). Set to ``all`` to dump all available codecs: + - **aeha**: Decode and dump AEHA infrared codes. - **coolix**: Decode and dump Coolix infrared codes. - **dish**: Decode and dump Dish infrared codes. - **jvc**: Decode and dump JVC infrared codes. @@ -65,6 +66,9 @@ Configuration variables: Automations: +- **on_aeha** (*Optional*, :ref:`Automation `): An automation to perform when a + AEHA remote code has been decoded. A variable ``x`` of type :apiclass:`remote_base::AEHAData` + is passed to the automation for use in lambdas. - **on_coolix** (*Optional*, :ref:`Automation `): An automation to perform when a Coolix remote code has been decoded. A variable ``x`` of type :apiclass:`remote_base::CoolixData` is passed to the automation for use in lambdas. @@ -164,6 +168,12 @@ Configuration variables: Remote code selection (exactly one of these has to be included): +- **aeha**: Trigger on a decoded AEHA remote code with the given data. + + - **address** (**Required**, int): The address to trigger on, see dumper output for more info. + - **data** (**Required**, 3-35 bytes list): The code to listen for, see :ref:`remote_transmitter-transmit_aeha` + for more info. Usually you only need to copy this directly from the dumper output. + - **coolix**: Trigger on a decoded Coolix remote code with the given data. - **data** (**Required**, int): The 24-bit Coolix code to trigger on, see dumper output for more info. diff --git a/components/remote_transmitter.rst b/components/remote_transmitter.rst index 5e5978809..366a9b19f 100644 --- a/components/remote_transmitter.rst +++ b/components/remote_transmitter.rst @@ -78,6 +78,27 @@ Configuration variables: If you're looking for the same functionality as is default in the ``rpi_rf`` integration in Home Assistant, you'll want to set the **times** to 10 and the **wait_time** to 0s. +.. _remote_transmitter-transmit_aeha: + +``remote_transmitter.transmit_aeha`` Action +********************************************* + +This :ref:`action ` sends a AEHA code to a remote transmitter. + +.. code-block:: yaml + + on_...: + - remote_transmitter.transmit_aeha: + address: 0x1FEF + data: [0x1F, 0x3E, 0x06, 0x5F] + +Configuration variables: + +- **address** (**Required**, int): The address to send the command to, see dumper output for more details. +- **data** (**Required**, list): The command to send, A length of 2-35 bytes can be specified for one packet. + +AEHA refers to the Association for Electric Home Appliances in Japan, a format used by Panasonic and many other companies. + .. _remote_transmitter-transmit_coolix: ``remote_transmitter.transmit_coolix`` Action diff --git a/components/sensor/apds9960.rst b/components/sensor/apds9960.rst index 558d38830..0838841cf 100644 --- a/components/sensor/apds9960.rst +++ b/components/sensor/apds9960.rst @@ -54,6 +54,12 @@ Base Configuration: - **address** (*Optional*, int): The I²C address of the sensor. Defaults to ``0x39``. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. +- **led_drive** (*Optional*, int): The LED drive level in mA. One of 100mA, 50mA, 25mA, 12.5mA. Defaults to ``100mA``. +- **proximity_gain** (*Optional*, int): The proximity gain level. One of 1x, 2x, 4x, 8x. Defaults to ``4x``. +- **ambient_light_gain** (*Optional*, int): The ambient light gain level. One of 1x, 4x, 16x, 64x. Defaults to ``4x``. +- **gesture_led_drive** (*Optional*, int): The gesture LED drive level in mA. One of 100mA, 50mA, 25mA, 12.5mA. Defaults to ``100mA``. +- **gesture_gain** (*Optional*, int): The proximity gain level. One of 1x, 2x, 4x, 8x. Defaults to ``4x``. +- **gesture_wait_time** (*Optional*, int): The gesture wait time in ms. One of 0ms, 2.8ms, 5.6ms, 8.4ms, 14ms, 22.4ms, 30.8ms, 39.2ms. Defaults to ``2.8ms``. Sensor ------ diff --git a/components/sensor/binary_sensor_map.rst b/components/sensor/binary_sensor_map.rst index 6a6f8e634..7c682c827 100644 --- a/components/sensor/binary_sensor_map.rst +++ b/components/sensor/binary_sensor_map.rst @@ -13,7 +13,7 @@ This sensor is **mostly used for touch** devices but could be used for any ``bin Add your binary sensors as ``channels`` to the binary sensor map. The binary sensor map then publishes a value depending on the type of the binary sensor map and the values specified with each channel. -This platform currently supports only one measurement type: ``GROUP``, but others might get added later. +This platform currently supports two measurement types: ``GROUP`` and ``SUM``, and others might get added later. You need to specify which type of mapping you want with the ``type:`` configuration value: - ``GROUP`` Each channel has its own value. The sensor publishes the average value of all active @@ -47,6 +47,45 @@ You need to specify which type of mapping you want with the ``type:`` configurat channel: 0 id: touchkey0 # ... + +- ``SUM`` Each channel has its own value. The sensor publishes the sum of all active + binary sensors values. + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: binary_sensor_map + id: group_0 + name: 'Group Map 0' + type: sum + channels: + - binary_sensor: bit0 + value: 1 + - binary_sensor: bit1 + value: 2 + - binary_sensor: bit2 + value: 4 + - binary_sensor: bit3 + value: 8 + + binary_sensor: + - platform: gpio + pin: 4 + id: bit0 + + - platform: gpio + pin: 5 + id: bit1 + + - platform: gpio + pin: 6 + id: bit2 + + - platform: gpio + pin: 7 + id: bit3 + # ... Configuration variables: ------------------------ diff --git a/components/sensor/bl0942.rst b/components/sensor/bl0942.rst new file mode 100644 index 000000000..bd5d2921e --- /dev/null +++ b/components/sensor/bl0942.rst @@ -0,0 +1,68 @@ +Belling BL0942 Energy Monitor +================================== + +.. seo:: + :description: Instructions for setting up BL0942 power monitors. + :image: bl0942.png + :keywords: BL0942, Aubess, Mini Smart Switch With Energy Monitor + +The ``bl0942`` sensor platform allows you to use BL0942 energy monitors sensors with +ESPHome. These are used in some Tuya-devices (e.g. Aubess Tuya WiFi Mini Smart Switch With Energy Monitor) + +The communication with this integration is done over a :ref:`UART bus `. +You must therefore have a ``uart:`` entry in your configuration with both the TX and RX pins set +to some pins on your board and the baud rate set to 4800 with 1 stop bit. + +.. code-block:: yaml + + # Example configuration entry + uart: + id: uart_bus + tx_pin: TX + rx_pin: RX + baud_rate: 4800 + stop_bits: 1 + + sensor: + - platform: bl0942 + uart_id: uart_bus + voltage: + name: 'BL0942 Voltage' + current: + name: 'BL0942 Current' + power: + name: 'BL0942 Power' + filters: + multiply: -1 + energy: + name: 'BL0942 Energy' + frequency: + name: "BL0942 Frequency" + accuracy_decimals: 2 + + update_interval: 60s + +Configuration variables: +------------------------ + +- **voltage** (*Optional*): The voltage value of the sensor in Volts. + All options from :ref:`Sensor `. +- **current** (*Optional*): The current value of the sensor in Amperes. All options from + :ref:`Sensor `. +- **power** (*Optional*): The (active) power value of the sensor in Watts. Note that some power meters will report this in negative values (probably wired backwards), so you may want to use a filter to multiply it by -1. All options from :ref:`Sensor `. +- **energy** (*Optional*): Use the voltage value of the sensor in kWh. + All options from :ref:`Sensor `. +- **frequency** (*Optional*): The frequency value of the sensor in Hertz. All options from + :ref:`Sensor `. + All options from :ref:`Sensor `. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. +- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component ` if you want + to use multiple UART buses. + +See Also +-------- + +- :ref:`sensor-filters` +- :apiref:`bl0942/bl0942.h` +- :ghedit:`Edit` diff --git a/components/sensor/ble_rssi.rst b/components/sensor/ble_rssi.rst index 3e880aec4..6fcee5840 100644 --- a/components/sensor/ble_rssi.rst +++ b/components/sensor/ble_rssi.rst @@ -24,6 +24,10 @@ instructions for setting up this platform. - platform: ble_rssi service_uuid: '11aa' name: "BLE Test Service 16 bit RSSI value" + # RSSI based on iBeacon UUID + - platform: ble_rssi + ibeacon_uuid: '68586f1e-89c2-11eb-8dcd-0242ac130003' + name: "BLE Test Service iBeacon RSSI value" .. note:: @@ -35,10 +39,18 @@ Configuration variables: - **name** (**Required**, string): The name of the sensor. - **mac_address** (*Optional*, MAC Address): The MAC address to track for this - sensor. Either this or ''service_uuid'' has to be present. + sensor. Note that exactly one of ``mac_address``, ``service_uuid`` or ``ibeacon_uuid`` must be present. - **service_uuid** (*Optional*, 16 bit, 32 bit, or 128 bit BLE Service UUID): The BLE - Service UUID which can be tracked if the device randomizes the MAC address. Either - this or ''mac_address'' has to be present. + Service UUID 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*, int): 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*, int): 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:`Sensor `. diff --git a/components/sensor/dps310.rst b/components/sensor/dps310.rst new file mode 100644 index 000000000..4cd5f5baa --- /dev/null +++ b/components/sensor/dps310.rst @@ -0,0 +1,61 @@ +DPS310 Atmospheric Pressure Sensor +================================== + +.. seo:: + :description: Instructions for setting up DPS310 atmospheric pressure sensors + :image: dps310.jpg + :keywords: DPS310 + +The ``dps310`` sensor platform allows you to use both the temperature and pressure sensors on +your DPS310 atmospheric pressure sensor (`Adafruit `__) +with ESPHome. The :ref:`I²C ` component is required to be set up in your configuration. + +.. figure:: images/dps310-full.jpg + :align: center + :width: 50.0% + + DPS310 Atmospheric Pressure Sensor board from `Adafruit `__ + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: dps310 + temperature: + name: "Outside Temperature" + pressure: + name: "Outside Pressure" + address: 0x77 + update_interval: 60s + +Configuration variables: +------------------------ + +- **pressure** (**Required**): The information for the pressure sensor. + + - **name** (**Required**, string): The name for the pressure sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + +- **temperature** (**Required**): The information for the temperature. + sensor + + - **name** (**Required**, string): The name for the temperature + sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + +- **address** (*Optional*, int): Manually specify the I²C address of + the sensor. Defaults to ``0x77``. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. + +See Also +-------- + +- :ref:`sensor-filters` +- :doc:`bmp280` +- :doc:`bme680` +- :doc:`bmp085` +- :apiref:`dps310/dps310.h` +- :ghedit:`Edit` diff --git a/components/sensor/hydreon_rgxx.rst b/components/sensor/hydreon_rgxx.rst index 8026baa39..7023977af 100644 --- a/components/sensor/hydreon_rgxx.rst +++ b/components/sensor/hydreon_rgxx.rst @@ -38,6 +38,8 @@ required to be set up in your configuration for this sensor to work. - platform: hydreon_rgxx too_cold: name: "too cold" + lens_bad: + name: "lens bad" .. code-block:: yaml @@ -99,6 +101,12 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - All other options from :ref:`Sensor `. +- **temperature** (*Optional*): Temperature +-5°C. Only on RG-9 Version 1.100 or later. + + - **name** (**Required**, string): The name for the sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. diff --git a/components/sensor/images/dps310-full.jpg b/components/sensor/images/dps310-full.jpg new file mode 100644 index 000000000..a089009af Binary files /dev/null and b/components/sensor/images/dps310-full.jpg differ diff --git a/components/sensor/images/mcp9600.jpg b/components/sensor/images/mcp9600.jpg new file mode 100644 index 000000000..955adb28c Binary files /dev/null and b/components/sensor/images/mcp9600.jpg differ diff --git a/components/sensor/images/mpl3115a2-full.jpg b/components/sensor/images/mpl3115a2-full.jpg new file mode 100644 index 000000000..90319e1de Binary files /dev/null and b/components/sensor/images/mpl3115a2-full.jpg differ diff --git a/components/sensor/images/ufire_ec.png b/components/sensor/images/ufire_ec.png new file mode 100644 index 000000000..c66451dad Binary files /dev/null and b/components/sensor/images/ufire_ec.png differ diff --git a/components/sensor/images/ufire_ise.png b/components/sensor/images/ufire_ise.png new file mode 100644 index 000000000..8fab46f89 Binary files /dev/null and b/components/sensor/images/ufire_ise.png differ diff --git a/components/sensor/mcp9600.rst b/components/sensor/mcp9600.rst new file mode 100644 index 000000000..6236961dd --- /dev/null +++ b/components/sensor/mcp9600.rst @@ -0,0 +1,69 @@ +MCP9600 Thermocouple Amplifier +=========================================== + +.. seo:: + :description: Instructions for setting up the MCP9600 thermocouple amplifier + :image: mcp9600.jpg + :keywords: MCP9600 + +The ``mcp9600`` sensor platform allows you to use your MCP9600 and MCP9601 +(`datasheet `__, +`Adafruit`_) to measure the temperature of a connected thermocouple while also measuring the ambient temperature around the sensor with ESPHome. :ref:`I²C ` is +required to be set up in your configuration for this sensor to work. + +.. warning:: + + The :ref:`I²C ` bus must be set to a minimum of ``100khz`` due to the limitations of the MCP9600 and MCP9601. + +.. figure:: images/mcp9600.jpg + :align: center + :width: 80.0% + + MCP9600 Thermocouple Amplifier + +.. _Adafruit: https://www.adafruit.com/product/4101 + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: mcp9600 + hot_junction: + name: "Thermocouple Temperature" + cold_junction: + name: "Ambient Temperature" + thermocouple_type: K + address: 0x67 + update_interval: 60s + +Configuration variables: +------------------------ + +- **hot_junction** (*Optional*): The information for the Hot Junction temperature sensor. + + - **name** (**Required**, string): The name for the temperature + sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + +- **cold_junction** (*Optional*): The information for the Cold Junction temperature sensor. + + - **name** (**Required**, string): The name for the temperature sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + +- **thermocouple_type** (*Optional*): Set the thermocouple type. Options are: + K, J, T, N, S, E, B and R type thermocouple. Defaults to ``K``. +- **address** (*Optional*, int): Manually specify the I²C address of + the sensor. Defaults to ``0x67``. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. + +See Also +-------- + +- :ref:`sensor-filters` +- :apiref:`mcp9600/mcp9600.h` +- `Adafruit MCP9600 Library `__ by `Adafruit `__ +- `SparkFun MCP9600 Library `__ by `SparkFun `__ +- :ghedit:`Edit` diff --git a/components/sensor/mpl3115a2.rst b/components/sensor/mpl3115a2.rst new file mode 100644 index 000000000..8bbb69c1e --- /dev/null +++ b/components/sensor/mpl3115a2.rst @@ -0,0 +1,70 @@ +MPL3115A2 Barometric Pressure/Altitude/Temperature Sensor +========================================================= + +.. seo:: + :description: Instructions for setting up MPL3115A2 atmospheric pressure sensors. + :image: mpl3115a2.jpg + :keywords: MPL3115A2 + +The ``mpl3115a2`` sensor platform allows you to use your MPL3115A2 atmospheric pressure sensors +(`datasheet `__, +`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/mpl3115a2-full.jpg + :align: center + :width: 50.0% + + MPL3115A2 Barometric Pressure/Altitude/Temperature Sensor + +.. _Adafruit: https://www.adafruit.com/product/1893 + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: mpl3115a2 + temperature: + name: "MPL3115A2 Temperature" + pressure: + name: "MPL3115A2 Pressure" + update_interval: 10s + +Configuration variables: +------------------------ +The MPL3115A2 can be configured to output either pressure or altitude depending on which +sensor is configured. + +- **pressure** (**Optional**): The information for the pressure sensor. + + - **name** (**Required**, string): The name for the pressure sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + +- **altitude** (**Optional**): The information for the altitude sensor. + + - **name** (**Required**, string): The name for the altitude sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + +- **temperature** (**Optional**): The information for the temperature sensor. + + - **name** (**Required**, string): The name for the temperature sensor. + - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. + - All other options from :ref:`Sensor `. + +- **address** (*Optional*, int): Manually specify the I²C address of + the sensor. Defaults to ``0x60``. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. + +See Also +-------- + +- :ref:`sensor-filters` +- :doc:`bmp280` +- :doc:`bme280` +- :doc:`bmp085` +- :doc:`ms5611` +- :apiref:`mpl3115a2/mpl3115a2.h` +- :ghedit:`Edit` diff --git a/components/sensor/pulse_counter.rst b/components/sensor/pulse_counter.rst index 68d6bd38b..449fa07b6 100644 --- a/components/sensor/pulse_counter.rst +++ b/components/sensor/pulse_counter.rst @@ -38,10 +38,13 @@ Configuration variables: - **falling_edge** (*Optional*): What to do when a falling edge is detected. One of ``DISABLE``, ``INCREMENT`` and ``DECREMENT``. Defaults to ``DISABLE``. + + +- **use_pcnt** (*Optional*, boolean): Use hardware ``PCNT`` pulse counter. Only supported on ESP32. Defaults to ``true``. - **internal_filter** (*Optional*, :ref:`config-time`): If a pulse shorter than this - time is detected, it’s discarded and no pulse is counted. Defaults to ``13us``. On the ESP32, - this value can not be higher than ``13us``, for the ESP8266 you can use larger intervals too. + time is detected, it’s discarded and no pulse is counted. Defaults to ``13us``. On the ESP32, when using the hardware pulse counter + this value can not be higher than ``13us``, for the ESP8266 or with ``use_pcnt: false`` you can use larger intervals too. If you enable this, set up the ``count_mode`` to increase on the falling edge, not leading edge. For S0 pulse meters that are used to meter power consumption 50-100 ms is a reasonable value. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. diff --git a/components/sensor/rotary_encoder.rst b/components/sensor/rotary_encoder.rst index f73063da3..eea9eac8a 100644 --- a/components/sensor/rotary_encoder.rst +++ b/components/sensor/rotary_encoder.rst @@ -23,7 +23,7 @@ a better understanding of these sensors. :align: center :width: 75.0% -To use rotary encoders in ESPHome, first identify the two pins encoding th step value. +To use rotary encoders in ESPHome, first identify the two pins encoding the 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. @@ -57,7 +57,7 @@ Configuration variables: The second pin for determining the step value. Must not be a pin from an external I/O expander. - **name** (**Required**, string): The name of the rotary encoder sensor. - **pin_reset** (*Optional*, :ref:`Pin Schema `): - An optional pin that resets the step value. This is useful with rotary encoders that have have a + An optional pin that resets the step value. This is useful with rotary encoders that have a third pin. Defaults to no reset pin. - **resolution** (*Optional*, string): The resolution of the sensor, this controls how many pulses are generated by one step: @@ -72,7 +72,7 @@ Configuration variables: - **max_value** (*Optional*, int): The maximum value this rotary encoder will go to, turning the knob further will not increase the number. Defaults to no maximum. - **publish_initial_value** (*Optional*, boolean): Controls whether the value is published - upon start of ESPHome. By default the value is only published when it changes, causing an + upon start of ESPHome. By default, the value is only published when it changes, causing an "unknown" value at first. If you set this option to true, the value is published once after boot and when it changes. Defaults to ``false``. - **restore_mode** (*Optional*): Control how the Rotary Encoder attempts to restore state on bootup. diff --git a/components/sensor/teleinfo.rst b/components/sensor/teleinfo.rst index 28d56e6cb..c601a44c5 100644 --- a/components/sensor/teleinfo.rst +++ b/components/sensor/teleinfo.rst @@ -107,10 +107,13 @@ In teleinfo platform: - **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`UART Component ` if you want to use multiple UART buses. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation or multiple hubs. + Sensor ****** - **tag_name** (**Required**, string): Specify the tag you want to retrieve from the Teleinformation. +- **teleinfo_id** (*Optional*, :ref:`config-id`): Specify the ID of used hub. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor `. @@ -118,6 +121,7 @@ Text Sensor *********** - **tag_name** (**Required**, string): Specify the tag you want to retrieve from the Teleinformation. +- **teleinfo_id** (*Optional*, :ref:`config-id`): Specify the ID of used hub. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Text Sensor `. diff --git a/components/sensor/template.rst b/components/sensor/template.rst index a962f86b7..01304dea7 100644 --- a/components/sensor/template.rst +++ b/components/sensor/template.rst @@ -37,7 +37,7 @@ Configuration variables: Lambda to be evaluated every update interval to get the new value of the sensor - **update_interval** (*Optional*, :ref:`config-time`): The interval to publish the value of the sensor, either the result of the lambda function or if no lambda function the last value - published using the publish action. Defaults to ``60s``. + published using the publish action. Set to ``never`` to disable updates. Defaults to ``60s``. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor `. diff --git a/components/sensor/ufire_ec.rst b/components/sensor/ufire_ec.rst new file mode 100644 index 000000000..8852e5de4 --- /dev/null +++ b/components/sensor/ufire_ec.rst @@ -0,0 +1,106 @@ +uFire Isolated EC sensor +======================== + +.. seo:: + :description: Instructions for setting up uFire Isolated EC sensor in esphome + :image: ufire_ec.png + :keywords: ufire ec sensor temperature esphome + +The ``ufire_ec`` sensor platform allows you to use your uFire Isolated EC sensor +with ESPHome. The :ref:`I²C Bus ` is +required to be set up in your configuration for this sensor to work. +It required also to have an temperature sensor in the liquit tank; this can +be on the same board or external sensor linked to the uFire EC configuration. + +.. figure:: images/ufire_ec.png + :align: center + :width: 100.0% + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: ufire_ec + id: ufire_ec_board + temperature: + id: temperature_liquit + name: Temperature + ec: + name: EC + + +Configuration variables: +------------------------ + +- **address** (**Optional**, int): Specify the I²C address of the sensor. Defaults to ``0x3C``. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. +- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. +- **temperature_sensor** (*Optional*, :ref:`config-id`): Set the ID of the temperature + sensor. Only needed if the onboard temperature sensor is not used. +- **ec** (*Optional*, :ref:`Sensor `): Set the EC sensor configuration. All options from :ref:`Sensor `. +- **temperature** (*Optional*, :ref:`Sensor `): Set the onboard temperature sensor configuration. All options from :ref:`Sensor `. +- **temperature_compensation** (*Optional*, float): Set the temperature compensation for the EC + sensor. Defaults to ``21.0``. +- **temperature_coefficient** (*Optional*, float): Set the temperature coefficient for the EC + sensor. Defaults to ``0.019``. + +.. _sensor-ufire_ec-calibrate_probe_action: + +``sensor.ufire_ec.calibrate_probe`` Action +------------------------------------------ + +The EC probe have to be calibrated. For this you need know the EC reference value and temperature +of the calibration solution. + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: ufire_ec + id: ufire_ec_board + # ... + + # in some trigger + on_...: + - sensor.ufire_ec_board.calibrate_probe: + id: ufire_ec_board + solution: 0.146 + temperature: !lambda "return id(temperature_liquit).state;" + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the ufire EC sensor. +- **solution** (**Required**, float): Solution reference EC value. +- **temperature** (**Required**, float): Solution current temperature. + +.. _sensor-ufire_ec-reset_action: + +``sensor.ufire_ec.reset`` Action +-------------------------------- + +Reset the current calibration on the sensor. + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: ufire_ec + id: ufire_ec_board + # ... + + # in some trigger + on_...: + - sensor.ufire_ec_board.reset: + id: ufire_ec_board + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the ufire EC sensor. + +See Also +-------- + +- :ref:`sensor-filters` +- :apiref:`ufire_ec/ufire_ec.h` +- :ghedit:`Edit` diff --git a/components/sensor/ufire_ise.rst b/components/sensor/ufire_ise.rst new file mode 100644 index 000000000..0f4bacae6 --- /dev/null +++ b/components/sensor/ufire_ise.rst @@ -0,0 +1,132 @@ +uFire ISE pH sensor +=================== + +.. seo:: + :description: Instructions for setting up uFire ISE pH sensor in esphome + :image: ufire_ise.png + :keywords: ufire ph sensor temperature esphome + +The ``ufire_ise`` sensor platform allows you to use your uFire ISE pH sensor with +ESPHome. The :ref:`I²C Bus ` is +required to be set up in your configuration for this sensor to work. +It required also to have an temperature sensor in the liquit tank; this can +be on the same board or external sensor linked to the uFire ISE pH configuration. + +.. figure:: images/ufire_ise.png + :align: center + :width: 100.0% + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: ufire_ise + id: ufire_ise_board + temperature: + id: temperature_liquit + name: Temperature + ph: + name: pH + + +Configuration variables: +------------------------ + +- **address** (**Optional**, int): Specify the I²C address of the sensor. Defaults to ``0x3f``. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the + sensor. Defaults to ``60s``. +- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. +- **temperature_sensor** (*Optional*, :ref:`config-id`): Set the ID of the temperature + sensor. Only needed if the onboard temperature sensor is not used. +- **ph** (*Optional*, :ref:`Sensor `): Set the pH sensor configuration. All options from :ref:`Sensor `. +- **temperature** (*Optional*, :ref:`Sensor `): Set the onboard temperature sensor configuration. All options from :ref:`Sensor `. + Can't be used together with ``temperature_sensor``. + +.. _sensor-ufire_ise-calibrate_probe_high_action: + +``sensor.ufire_ise.calibrate_probe_high`` Action +------------------------------------------------ + +The pH probe have to be calibrated. For this you need know the pH reference value and temperature +of the calibration high solution. + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: ufire_ise + id: ufire_ise_board + # ... + + # in some trigger + on_...: + - sensor.ufire_ise_board.calibrate_probe_high: + id: ufire_ise_board + solution: 7.0 + temperature: !lambda "return id(temperature_liquit).state;" + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor. +- **solution** (**Required**, float): Solution reference pH value. +- **temperature** (**Required**, float): Solution current temperature. + +.. _sensor-ufire_ise-calibrate_probe_low_action: + +``sensor.ufire_ise.calibrate_probe_low`` Action +----------------------------------------------- + +The pH probe have to be calibrated. For this you need know the pH reference value and temperature +of the calibration low solution. + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: ufire_ise + id: ufire_ise_board + # ... + + # in some trigger + on_...: + - sensor.ufire_ise_board.calibrate_probe_low: + id: ufire_ise_board + solution: 4.0 + temperature: !lambda "return id(temperature_liquit).state;" + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor. +- **solution** (**Required**, float): Solution reference pH value. +- **temperature** (**Required**, float): Solution current temperature. + +.. _sensor-ufire_ise-reset_action: + +``sensor.ufire_ise.reset`` Action +--------------------------------- + +Reset the current calibration on the sensor. + +.. code-block:: yaml + + # Example configuration entry + sensor: + - platform: ufire_ise + id: ufire_ise_board + # ... + + # in some trigger + on_...: + - sensor.ufire_ise_board.reset: + id: ufire_ise_board + +Configuration options: + +- **id** (**Required**, :ref:`config-id`): The ID of the ufire pH sensor. + +See Also +-------- + +- :ref:`sensor-filters` +- :apiref:`ufire_ise/ufire_ise.h` +- :ghedit:`Edit` diff --git a/components/sensor/xiaomi_ble.rst b/components/sensor/xiaomi_ble.rst index 4b53d16b5..22bd21d12 100644 --- a/components/sensor/xiaomi_ble.rst +++ b/components/sensor/xiaomi_ble.rst @@ -6,7 +6,7 @@ Xiaomi Mijia BLE Sensors :image: xiaomi_mijia_logo.jpg :keywords: Xiaomi, Mi Home, Mijia, BLE, Bluetooth, HHCCJCY01, GCLS002, HHCCPOT002, LYWSDCGQ, LYWSD02, CGG1, LYWSD03MMC, CGD1, JQJCY01YM, MUE4094RT, WX08ZM, MHO, C401, MHOC401 -The ``xiaomi_ble`` sensor platform lets you track the output of Xiaomi Bluetooth Low Energy devices using the :doc:`/components/esp32_ble_tracker`. This component will track, for example, the temperature, humidity, moisture, conductivity, illuminance, formaldehyde, mosquito tablet and battery level of the device every time the sensor sends out a BLE broadcast. Contrary to other implementations, ``xiaomi_ble`` listens passively to advertisement packets and does not pair with the device. Hence ESPHome has no impact on battery life. +The ``xiaomi_ble`` sensor platform lets you track the output of Xiaomi Bluetooth Low Energy devices using the :doc:`/components/esp32_ble_tracker`. This component will track, for example, the temperature, humidity, moisture, conductivity, illuminance, formaldehyde, mosquito tablet and battery level of the device every time the sensor sends out a BLE broadcast. Contrary to other implementations, ``xiaomi_ble`` listens passively to advertisement packets and does not pair with the device. Hence ESPHome has no impact on battery life. Thus, if you only use such sensors, you can safely set ``active: false`` in ``esp32_ble_tracker`` configuration, to save from spamming your RF environment with useless scan requests. Supported Devices ----------------- @@ -567,7 +567,7 @@ It can sometimes take some time for the first BLE broadcast to be received. Once Obtaining The Bindkey --------------------- -To set up an encrypted device such as the LYWSD03MMC (with Xiaomi stock firmware) and CGD1, you first need to obtain the bind key. The ``xiaomi_ble`` sensor component is not able to automatically generate a bind key so other workarounds are necessary. +To set up an encrypted device such as the LYWSD03MMC (with Xiaomi stock firmware) and CGD1, you first need to obtain the bind key. The ``xiaomi_ble`` sensor component is not able to automatically generate a bindkey so other workarounds are necessary. LYWSD03MMC/MHO-C401 ******************* @@ -635,7 +635,11 @@ Avoid placing the ESP node in racks, close to routers/switches or other network Security considerations ----------------------- -You should at least protect your sensors with a custom pairing PIN code. +You should at least protect your sensors with a custom pairing PIN code. Choose a method employing bindkey in order to use encrypted communication over the air. + +.. note:: + + Devices flashed with `PVVX MiThermometer `__ custom firmware also support the `BTHome protocol `__ which can be used in conjunction with ESPHome's :doc:`/components/bluetooth_proxy` component to forward sensor data to Home Assistant. See Also @@ -643,8 +647,10 @@ See Also - :doc:`/components/esp32_ble_tracker` - :doc:`/components/sensor/index` +- :doc:`/components/display/pvvx_mithermometer` - :apiref:`xiaomi_lywsd03mmc/xiaomi_ble.h` - :doc:`/components/ethernet` +- :doc:`/components/bluetooth_proxy` - Passive BLE monitor integration for Home Assistant (ble_monitor custom component) ``__ by `@Magalex2x14 `__ and `@Ernst79 `__ - Custom firmware (PVVX) for the Xiaomi Thermometer LYWSD03MMC ``__ diff --git a/components/sensor/xiaomi_miscale.rst b/components/sensor/xiaomi_miscale.rst index 277397ed8..c054788d9 100644 --- a/components/sensor/xiaomi_miscale.rst +++ b/components/sensor/xiaomi_miscale.rst @@ -91,7 +91,7 @@ You have to replace the numbers in the lambdas to determine your weight which is - platform: template name: Impedance Aurélien id: impedance_user1 - unit_of_measurement: 'ohm' + unit_of_measurement: 'Ω' icon: mdi:omega accuracy_decimals: 0 - platform: template @@ -103,7 +103,7 @@ You have to replace the numbers in the lambdas to determine your weight which is - platform: template name: Impedance Siham id: impedance_user2 - unit_of_measurement: 'ohm' + unit_of_measurement: 'Ω' icon: mdi:omega accuracy_decimals: 0 diff --git a/components/sim800l.rst b/components/sim800l.rst index 5cea41c1c..58b7f0a17 100644 --- a/components/sim800l.rst +++ b/components/sim800l.rst @@ -9,10 +9,11 @@ Sim800L Component Component/Hub ------------- -The ``SIM800L`` Component provides the ability to dial, send and receive SMS text messages. The device must be -connected via a :doc:`UART bus ` supporting both receiving and transmitting line. -The UART bus must be configured at the same speed of the module which is by default 9600bps. -The required connection wires are ``+VCC``, ``GND``, ``RX`` and ``TX``. +The ``SIM800L`` Component provides the ability to dial, answer calls, send/receive SMS text messages and +send/receive USSD codes. The device must be connected via a :doc:`UART bus ` +supporting both receiving and transmitting line. The UART bus must be configured at the same speed +of the module which is by default 9600bps. The required connection wires are ``+VCC``, ``GND``, +``RX`` and ``TX``. .. warning:: @@ -43,16 +44,6 @@ The required connection wires are ``+VCC``, ``GND``, ``RX`` and ``TX``. format: "Received '%s' from %s" args: [ 'message.c_str()', 'sender.c_str()' ] - sensor: - - platform: sim800l - rssi: - name: "Sim800L RSSI" - - binary_sensor: - - platform: sim800l - registered: - name: "Sim800L Registered" - logger: baud_rate: 0 # disable uart logger on esp 8266 @@ -62,10 +53,25 @@ Configuration variables: - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **on_sms_received** (*Optional*, :ref:`Automation `): An action to be performed when an SMS is received. See :ref:`sim800l-on_sms_received`. +- **on_incoming_call** (*Optional*, :ref:`Automation `): An action to be + performed when a call is received. See :ref:`sim800l-on_incoming_call`. +- **on_call_connected** (*Optional*, :ref:`Automation `): An action to be + performed when a call is connected, either because an outgoing call accepted is + accepted or an incoming call answered. +- **on_call_disconnected** (*Optional*, :ref:`Automation `): An action to be + performed when a call is disconnected. + Sensor ------ +.. code-block:: yaml + + sensor: + - platform: sim800l + rssi: + name: "Sim800L RSSI" + Configuration variables: - **rssi** (*Optional*): The informed Received signal strength indication (RSSI) in dBm. @@ -78,6 +84,13 @@ Configuration variables: Binary Sensor ------------- +.. code-block:: yaml + + binary_sensor: + - platform: sim800l + registered: + name: "Sim800L Registered" + Configuration variables: - **registered** (*Optional*): Indicates if the SIM800L has successfully registered in the cellular network. @@ -103,6 +116,42 @@ under the variables named ``message`` and ``sender`` respectively. id(sms_sender).publish_state(sender); id(sms_message).publish_state(message); +.. _sim800l-on_incoming_call: + +``on_incoming_call`` Trigger +---------------------------- + +This automation triggers every time the SIM800L sends a RING / Caller ID message, this message +is sent several times per call, presumably every time the phone "RINGs". The automation provides +a ``caller_id`` string parameter which received information. The phone call is neither accepted +or rejected. + +.. code-block:: yaml + + on_incoming_call: + - logger.log: + format: "Incoming call from '%s'" + args: ["caller_id.c_str()"] + - lambda: |- + id(caller_id_text_sensor).publish_state(caller_id); + - sim800l.disconnect + - homeassistant.event: + event: esphome.incoming_call_event + data: + payload: !lambda 'return id(caller_id_text_sensor).state;' + + +``on_ussd_received`` Trigger +---------------------------- + +With this configuration option you can write complex automations whenever the ussd code from network +has been received. + +.. code-block:: yaml + + on_ussd_received: + + .. _sim800l-send_sms_action: @@ -134,18 +183,11 @@ Configuration options: - **message** (**Required**, string, :ref:`templatable `): The message content. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID of the SIM800L if you have multiple components. -.. note:: - - This action can also be written in :ref:`lambdas `: - - .. code-block:: cpp - - id(sim800l1).send_sms("+15551234567", "The message content"); .. _sim800l-dial_action: ``sim800l.dial`` Action ---------------------------- +----------------------- Dial to a phone recipient using this action in automations. @@ -161,13 +203,41 @@ Configuration options: - **recipient** (**Required**, string, :ref:`templatable `): The number to dial. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID of the SIM800L if you have multiple components. -.. note:: - This action can also be written in :ref:`lambdas `: +``sim800l.connect`` Action +-------------------------- - .. code-block:: cpp +Answers an incoming call. - id(sim800l1).dial("+15551234567"); +.. code-block:: yaml + + on_...: + then: + - sim800l.connect + + +``sim800l.disconnect`` Action +----------------------------- + +Disconnects a call, either dialed in or received. + +.. code-block:: yaml + + on_...: + then: + - sim800l.disconnect + + +``sim800l.send_ussd`` Action +---------------------------- + +Sends a ussd code to the network. + +.. code-block:: yaml + + on_...: + then: + - sim800l.send_ussd Getting started with Home Assistant @@ -180,28 +250,46 @@ on Home Assistant and will also setup a service so you can send messages and dia api: services: - - service: send_sms - variables: - recipient: string - message: string - then: - - sim800l.send_sms: - recipient: !lambda 'return recipient;' - message: !lambda 'return message;' - - service: dial - variables: - recipient: string - then: - - sim800l.dial: - recipient: !lambda 'return recipient;' + - service: send_sms + variables: + recipient: string + message: string + then: + - sim800l.send_sms: + recipient: !lambda 'return recipient;' + message: !lambda 'return message;' + - service: dial + variables: + recipient: string + then: + - sim800l.dial: + recipient: !lambda 'return recipient;' + - service: connect + then: + - sim800l.connect + - service: disconnect + then: + - sim800l.disconnect + - service: send_ussd + variables: + ussdCode: string + then: + - sim800l.send_ussd: + ussd: !lambda 'return ussdCode;' text_sensor: - - platform: template - id: sms_sender - name: "Sms Sender" - - platform: template - id: sms_message - name: "Sms Message" + - platform: template + id: sms_sender + name: "Sms Sender" + - platform: template + id: sms_message + name: "Sms Message" + - platform: template + id: caller_id_text_sensor + name: "Caller ID" + - platform: template + id: ussd_message + name: "Ussd Code" uart: baud_rate: 9600 @@ -210,9 +298,22 @@ on Home Assistant and will also setup a service so you can send messages and dia sim800l: on_sms_received: - - lambda: |- - id(sms_sender).publish_state(sender); - id(sms_message).publish_state(message); + - lambda: |- + id(sms_sender).publish_state(sender); + id(sms_message).publish_state(message); + on_incoming_call: + - lambda: |- + id(caller_id_text_sensor).publish_state(caller_id); + on_call_connected: + - logger.log: + format: Call connected + on_call_disconnected: + - logger.log: + format: Call disconnected + on_ussd_received: + - lambda: |- + id(ussd_message).publish_state(ussd); + Now your latest received SMS and sender number will be displayed by the text sensors. @@ -238,10 +339,10 @@ Relay management commands received from an authorized sender: sim800l: on_sms_received: - - lambda: |- - if ( (id(sms_sender).state == "+79991234567") && ( (id(sms_message).state == "relay_1_on") OR (id(sms_message).state == "Relay_1_on") ) ) { - id(relay_1).turn_on(); - } + - lambda: |- + if ( (id(sms_sender).state == "+79991234567") && ( (id(sms_message).state == "relay_1_on") OR (id(sms_message).state == "Relay_1_on") ) ) { + id(relay_1).turn_on(); + } switch: - platform: gpio id: relay_1 diff --git a/components/switch/factory_reset.rst b/components/switch/factory_reset.rst new file mode 100644 index 000000000..8c9eb5b00 --- /dev/null +++ b/components/switch/factory_reset.rst @@ -0,0 +1,51 @@ +Factory Reset Switch +==================== + +.. seo:: + :description: Instructions for setting up switches that can remotely invalidate all ESPHome preferences stored in flash and reboot ESP. + :image: restart.svg + +The ``factory_reset`` switch allows you to remotely invalidate (reset) all ESPHome :ref:`preferences ` stored in flash memory and reboot your node. +After reboot all states, parameters and variables will be reinitialized with their default values. This is useful: + +- for devices preflashed with ESPHome to reset behavior back to factory state +- in case of moving a device to a new environment or starting a new use-case (e.g. reset counters or state) +- for privacy concerns when giving away a device + +.. note:: + + **USE WITH GREAT CAUTION!** All credentials, global variables, counters and saved states stored in non-volatile memory will be lost with no chance of recovering them. + Even raw reading of flash memory with ``esptool`` will not help, since data is physically erased from flash memory. + + For devices configured using :doc:`captive portal `, this will reset WiFi settings as well, thus making such devices offline. + You'll need to be in close proximity to your device to configure it again using a built-in WiFi access point and captive portal. + + +.. figure:: images/factory-rst-ui.png + :align: center + :width: 80.0% + +.. code-block:: yaml + + # Example configuration entry + switch: + - platform: factory_reset + name: Restart with Factory Default Settings + +Configuration variables: +------------------------ + +- **name** (**Required**, string): The name of the switch. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- All other options from :ref:`Switch `. + +See Also +-------- + +- :doc:`shutdown` +- :doc:`restart` +- :doc:`safe_mode` +- :doc:`/components/button/factory_reset` +- :doc:`template` +- :apiref:`factory_reset/factory_reset_switch.h` +- :ghedit:`Edit` diff --git a/components/switch/images/factory-rst-ui.png b/components/switch/images/factory-rst-ui.png new file mode 100644 index 000000000..e55bfe5ea Binary files /dev/null and b/components/switch/images/factory-rst-ui.png differ diff --git a/components/switch/restart.rst b/components/switch/restart.rst index 49aef556c..e66be7c1e 100644 --- a/components/switch/restart.rst +++ b/components/switch/restart.rst @@ -29,9 +29,10 @@ Configuration variables: See Also -------- -- :doc:`/components/button/restart` - :doc:`shutdown` - :doc:`safe_mode` +- :doc:`factory_reset` +- :doc:`/components/button/restart` - :doc:`template` - :apiref:`restart/switch/restart_switch.h` - :ghedit:`Edit` diff --git a/components/switch/safe_mode.rst b/components/switch/safe_mode.rst index 17ad39c44..73ae6384a 100644 --- a/components/switch/safe_mode.rst +++ b/components/switch/safe_mode.rst @@ -33,6 +33,8 @@ See Also - :doc:`shutdown` - :doc:`restart` +- :doc:`factory_reset` +- :doc:`/components/button/safe_mode` - :doc:`template` - :apiref:`safe_mode/safe_mode_switch.h` - :ghedit:`Edit` diff --git a/components/switch/shutdown.rst b/components/switch/shutdown.rst index 814ba446e..f2d331a86 100644 --- a/components/switch/shutdown.rst +++ b/components/switch/shutdown.rst @@ -32,6 +32,9 @@ See Also -------- - :doc:`restart` +- :doc:`safe_mode` +- :doc:`factory_reset` +- :doc:`/components/button/shutdown` - :doc:`template` - :apiref:`shutdown/shutdown_switch.h` - :ghedit:`Edit` diff --git a/components/wifi.rst b/components/wifi.rst index fe19d50be..bfc2378e5 100644 --- a/components/wifi.rst +++ b/components/wifi.rst @@ -85,6 +85,9 @@ Configuration variables: The downside is that this option connects to the first network the ESP sees, even if that network is very far away and better ones are available. +- **enable_btm** (*Optional*, bool): Only on ``esp32`` with ``esp-idf``. Enable 802.11v BSS Transition Management support. +- **enable_rrm** (*Optional*, bool): Only on ``esp32`` with ``esp-idf``. Enable 802.11k Radio Resource Management support. + - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. Access Point Mode diff --git a/conf.py b/conf.py index e1b623abe..d3879b685 100644 --- a/conf.py +++ b/conf.py @@ -66,9 +66,9 @@ author = "ESPHome" # built documents. # # The short X.Y version. -version = "2022.8" +version = "2022.9" # The full version, including alpha/beta/rc tags. -release = "2022.8.2" +release = "2022.9.3" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/guides/automations.rst b/guides/automations.rst index b1838fd8a..3e11e91f0 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -730,6 +730,12 @@ script was already running. then: - script.execute: my_script +or as lambda + +.. code-block:: yaml + + lambda: 'id(my_script).execute(); + .. _script-stop_action: ``script.stop`` Action @@ -757,6 +763,12 @@ will not be executed. then: - script.stop: my_script +or as lambda + +.. code-block:: yaml + + lambda: 'id(my_script).stop();' + .. _script-wait_action: ``script.wait`` Action @@ -783,6 +795,14 @@ of the script are running in parallel, this will block until all of them have te - script.execute: my_script - script.wait: my_script +or as lambda + +.. code-block:: yaml + + lambda: |- + id(my_script).execute(); + id(my_script).wait(); + .. _script-is_running_condition: ``script.is_running`` Condition @@ -801,6 +821,15 @@ of the given id is running, not how many. then: - logger.log: Script is running! +or as lambda + +.. code-block:: yaml + + lambda: -| + if(id(my_script).is_running() { + ESP_LOGI("main", "Script is running!"); + } + .. _for_condition: ``for`` Condition diff --git a/guides/configuration-types.rst b/guides/configuration-types.rst index 1604a1353..b71f18e23 100644 --- a/guides/configuration-types.rst +++ b/guides/configuration-types.rst @@ -272,6 +272,10 @@ config in the main yaml file. All definitions from packages will be merged with config in non-destructive way so you could always override some bits and pieces of package configuration. +Dictionaries are merged key-by-key. Lists of components are merged by component +ID if specified. Other lists are merged by concatenation. All other config +values are replaced with the later value. + Local packages ************** diff --git a/guides/getting_started_command_line.rst b/guides/getting_started_command_line.rst index 708d6b180..4f59111e3 100644 --- a/guides/getting_started_command_line.rst +++ b/guides/getting_started_command_line.rst @@ -40,6 +40,21 @@ If you want to use `docker-compose` instead, here's a sample file: privileged: true network_mode: host +The project provides multiple docker tags; please pick the one that suits you +better: + +- ``latest`` and ``stable`` point to the latest stable release available. It's + not recommended to automatically update the container based on those tags + because of the possible breaking changes between releases. +- Release-tracking tag ``YEAR.MONTH`` (e.g. ``2022.8``) points to the latest + stable patch release available within the required version. There should + never be a breaking change when upgrading the containers based on tags like + that. +- ``beta`` points to the latest released beta version, and to the latest stable + release when there is no fresh beta release. +- ``dev`` is the bleeding edge release; built daily based on the latest changes + in the ``dev`` branch. + Connecting the ESP Device ------------------------- diff --git a/guides/supporters.rst b/guides/supporters.rst index f4875b0ab..f88577d73 100644 --- a/guides/supporters.rst +++ b/guides/supporters.rst @@ -101,6 +101,7 @@ Contributors - `Paulus Schoutsen (@balloob) `__ - `Andrew Zaborowski (@balrog-kun) `__ - `BarryMar (@BarryMar) `__ +- `Bascht74 (@Bascht74) `__ - `bazuchan (@bazuchan) `__ - `Viktr (@BbIKTOP) `__ - `J. Nick Koston (@bdraco) `__ @@ -118,6 +119,7 @@ Contributors - `Bill Church (@billchurch) `__ - `Brian Kaufman (@bkaufx) `__ - `JDavid (@blackhack) `__ +- `blakadder (@blakadder) `__ - `Branimir Lambov (@blambov) `__ - `Jim Ekman (@blejdfist) `__ - `Scott Smith (@blurfl) `__ @@ -127,7 +129,6 @@ Contributors - `Mauricio Bonani (@bonanitech) `__ - `Casey Olson (@bookcasey) `__ - `BoukeHaarsma23 (@BoukeHaarsma23) `__ -- `Patrik Hermansson (@bphermansson) `__ - `brambo123 (@brambo123) `__ - `Bram Kragten (@bramkragten) `__ - `Brad Davidson (@brandond) `__ @@ -182,6 +183,7 @@ Contributors - `cwitting (@cwitting) `__ - `Alex Solomaha (@CyanoFresh) `__ - `Luar Roji (@cyberplant) `__ +- `Aleš Komárek (@cznewt) `__ - `d-two (@d-two) `__ - `dab0g (@dab0g) `__ - `Dale Higgs (@dale3h) `__ @@ -350,6 +352,7 @@ Contributors - `guillempages (@guillempages) `__ - `Guyohms (@Guyohms) `__ - `Gilles van den Hoven (@gvdhoven) `__ +- `h3ndrik (@h3ndrik) `__ - `haade (@haade-administrator) `__ - `Peter van Dijk (@Habbie) `__ - `Hagai Shatz (@hagai-shatz) `__ @@ -372,7 +375,6 @@ Contributors - `hreintke (@hreintke) `__ - `Jan Hubík (@hubikj) `__ - `Huub Eikens (@huubeikens) `__ -- `Petr Urbánek (@HyperReap) `__ - `Arjan Filius (@iafilius) `__ - `Adrián Panella (@ianchi) `__ - `Ian Leeder (@ianleeder) `__ @@ -442,6 +444,7 @@ Contributors - `Jonathan Adams (@jonathanadams) `__ - `Jonathan Treffler (@JonathanTreffler) `__ - `JonnyaiR (@jonnyair) `__ +- `Jonathan V (@jonofmac) `__ - `Joppy (@JoppyFurr) `__ - `joseph douce (@josephdouce) `__ - `Joshua Spence (@joshuaspence) `__ @@ -495,7 +498,6 @@ Contributors - `Kyle Hendricks (@kylehendricks) `__ - `Kyle Manna (@kylemanna) `__ - `Kalashnikov Ilya (@l1bbcsg) `__ -- `la7dja (@la7dja) `__ - `Limor "Ladyada" Fried (@ladyada) `__ - `Luca Adrian L (@lal12) `__ - `Fredrik Lindqvist (@Landrash) `__ @@ -510,8 +512,8 @@ Contributors - `Lubos Horacek (@lhoracek) `__ - `Juraj Liso (@LiJu09) `__ - `lingex (@lingex) `__ -- `lkomurcu (@lkomurcu) `__ - `Lazar Obradovic (@lobradov) `__ +- `Lode Vermeiren (@lodev) `__ - `Barry Loong (@loongyh) `__ - `LuBeDa (@lubeda) `__ - `Joakim Sørensen (@ludeeus) `__ @@ -545,7 +547,6 @@ Contributors - `Mario (@mario-tux) `__ - `Marek Marczykowski-Górecki (@marmarek) `__ - `Matthew Harrold (@marrold) `__ -- `marshn (@marshn) `__ - `marsjan155 (@marsjan155) `__ - `Martin (@martgras) `__ - `Martin Hjelmare (@MartinHjelmare) `__ @@ -559,10 +560,10 @@ Contributors - `Matteo Franceschini (@matteofranceschini) `__ - `Matthew Mazzanti (@matthewmazzanti) `__ - `matthias882 (@matthias882) `__ +- `Matus Ivanecky (@maty535) `__ - `Maurice Schleußinger (@maurice-schleussinger) `__ - `Maximilian Gerhardt (@maxgerhardt) `__ - `mbo18 (@mbo18) `__ -- `mckaymatthew (@mckaymatthew) `__ - `Me No Dev (@me-no-dev) `__ - `Alexandr Zarubkin (@me21) `__ - `Joseph Mearman (@Mearman) `__ @@ -576,18 +577,20 @@ Contributors - `Marco Lusini (@met67) `__ - `Martin Flasskamp (@MFlasskamp) `__ - `Michael Gorven (@mgorven) `__ -- `mhentschke (@mhentschke) `__ +- `Michael Haas (@mhaas) `__ - `Michaël Arnauts (@michaelarnauts) `__ - `Micha Nordmann (@Michanord) `__ -- `micronen (@micronen) `__ +- `Midbin (@Midbin) `__ - `Pauline Middelink (@middelink) `__ - `Mikko Tervala (@MikkoTervala) `__ - `MiKuBB (@MiKuBB) `__ - `Minideezel (@minideezel) `__ - `André Klitzing (@misery) `__ +- `Tomasz (@Misiu) `__ - `Matthew Edwards (@mje-nz) `__ - `Matthew Garrett (@mjg59) `__ - `Maarten (@mjkl-gh) `__ +- `Morton Jonuschat (@mjonuschat) `__ - `mjoshd (@mjoshd) `__ - `mknjc (@mknjc) `__ - `Maurice Makaay (@mmakaay) `__ @@ -614,6 +617,7 @@ Contributors - `H. Árkosi Róbert (@nagyrobi) `__ - `Viktor Nagy (@nagyv) `__ - `Oskar Napieraj (@napieraj) `__ +- `Patrick ZAJDA (@Nardol) `__ - `Nate Lust (@natelust) `__ - `ueno (@nayuta-ueno) `__ - `Nazar Mokrynskyi (@nazar-pc) `__ @@ -673,10 +677,8 @@ Contributors - `Paul Doidge (@pdoidge) `__ - `per1234 (@per1234) `__ - `Peter Valkov (@peter-valkov) `__ -- `Peter Foreman (@peterforeman) `__ - `Peter Galantha (@peterg79) `__ -- `Peter Remøy Paulsen (@petrepa) `__ -- `Philip Rosenberg-Watt (@PhilRW) `__ +- `Philippe FOUQUET (@Philippe12) `__ - `pieterbrink123 (@pieterbrink123) `__ - `Tommy van der Vorst (@pixelspark) `__ - `Peter Kuehne (@pkuehne) `__ @@ -688,11 +690,11 @@ Contributors - `Iván Povedano (@pove) `__ - `probonopd (@probonopd) `__ - `Mike Lynch (@Prow7) `__ -- `Peter Stuifzand (@pstuifzand) `__ - `Peter Tatrai (@ptatrai) `__ - `Patrick Toal (@ptoal) `__ - `Leandro Puerari (@puerari) `__ - `puuu (@puuu) `__ +- `Pascal Vizeli (@pvizeli) `__ - `[pʲɵs] (@pyos) `__ - `Qc (@qc24) `__ - `Karol Zlot (@qqgg231) `__ @@ -701,7 +703,6 @@ Contributors - `Johannes Rebling (@r0oland) `__ - `Richard Kuhnt (@r15ch13) `__ - `Richard Miles (@r89m) `__ -- `Pär Stålberg (@rabbadab) `__ - `Aaron Zhang (@rabbit-aaron) `__ - `RadekHvizdos (@RadekHvizdos) `__ - `Florian Ragwitz (@rafl) `__ @@ -712,7 +713,6 @@ Contributors - `Rebbe Pod (@RebbePod) `__ - `Alex (@redwngsrul) `__ - `Alex Reid (@reidprojects) `__ -- `Pavels Veretennikovs (@rfvermut) `__ - `Richard Klingler (@richardklingler) `__ - `Richard Lewis (@richrd) `__ - `rjlexx (@rjlexx) `__ @@ -761,6 +761,7 @@ Contributors - `Niklas Wagner (@Skaronator) `__ - `Rafael Treviño (@skasi7) `__ - `Brian Slesinsky (@skybrian) `__ +- `Jordan W. Cobb (@skykingjwc) `__ - `Sebastian Lövdahl (@slovdahl) `__ - `smischny (@smischny) `__ - `Luca Zimmermann (@soundstorm) `__ @@ -771,7 +772,6 @@ Contributors - `Spegs21 (@Spegs21) `__ - `Stephan Peijnik-Steinwender (@speijnik) `__ - `Eric Lind (@sperly) `__ -- `Paul Krischer (@SqyD) `__ - `Samuel Sieb (@ssieb) `__ - `Stefan Staub (@sstaub) `__ - `St4n (@St4n) `__ @@ -840,6 +840,7 @@ Contributors - `Gediminas Šaltenis (@trylika) `__ - `Tuan (@tuanpmt) `__ - `tubalainen (@tubalainen) `__ +- `tube0013 (@tube0013) `__ - `Alexey Vlasov (@turbulator) `__ - `Seppel Hardt (@tuxBurner) `__ - `TVDLoewe (@TVDLoewe) `__ @@ -891,9 +892,10 @@ Contributors - `Zebble (@Zebble) `__ - `ZJY (@zhangjingye03) `__ - `San (@zhujunsan) `__ +- `Geek_cat (@zhzhzhy) `__ - `I. Tomita (@ziceva) `__ - `Michael Labuschke (@zigman79) `__ - `Zack Barett (@zsarnett) `__ - `Christian Zufferey (@zuzu59) `__ -*This page was last updated September 6, 2022.* +*This page was last updated October 6, 2022.* diff --git a/images/bl0942.png b/images/bl0942.png new file mode 100644 index 000000000..b22c03e5b Binary files /dev/null and b/images/bl0942.png differ diff --git a/images/dps310.jpg b/images/dps310.jpg new file mode 100644 index 000000000..03060e334 Binary files /dev/null and b/images/dps310.jpg differ diff --git a/images/mcp9600.jpg b/images/mcp9600.jpg new file mode 100644 index 000000000..a3d496605 Binary files /dev/null and b/images/mcp9600.jpg differ diff --git a/images/mpl3115a2.jpg b/images/mpl3115a2.jpg new file mode 100644 index 000000000..f75c6c973 Binary files /dev/null and b/images/mpl3115a2.jpg differ diff --git a/images/tm1621.jpg b/images/tm1621.jpg new file mode 100644 index 000000000..11b7172c2 Binary files /dev/null and b/images/tm1621.jpg differ diff --git a/images/tm1638.jpg b/images/tm1638.jpg new file mode 100644 index 000000000..d72e31d11 Binary files /dev/null and b/images/tm1638.jpg differ diff --git a/images/ufire_ec.png b/images/ufire_ec.png new file mode 100644 index 000000000..9495e0678 Binary files /dev/null and b/images/ufire_ec.png differ diff --git a/images/ufire_ise.png b/images/ufire_ise.png new file mode 100644 index 000000000..fd0e77c7b Binary files /dev/null and b/images/ufire_ise.png differ diff --git a/index.rst b/index.rst index 5905b3453..e60884275 100644 --- a/index.rst +++ b/index.rst @@ -255,6 +255,7 @@ Electricity ATM90E32, components/sensor/atm90e32, atm90e32.jpg, Voltage & Current & Power BL0939, components/sensor/bl0939, bl0939.png, Voltage & Current & Power & Energy BL0940, components/sensor/bl0940, bl0940.png, Voltage & Current & Power + BL0942, components/sensor/bl0942, bl0942.png, Voltage & Current & Power CS5460A, components/sensor/cs5460a, cs5460a.png, Voltage & Current & Power CSE7761, components/sensor/cse7761, cse7761.svg, Voltage & Current & Power CSE7766, components/sensor/cse7766, cse7766.svg, Voltage & Current & Power @@ -294,6 +295,7 @@ Environmental Dallas DS18B20, components/sensor/dallas, dallas.jpg, Temperature DHT, components/sensor/dht, dht.jpg, Temperature & Humidity DHT12, components/sensor/dht12, dht12.jpg, Temperature & Humidity + DPS310, components/sensor/dps310, dps310.jpg, Temperature & Pressure ENS210, components/sensor/ens210, ens210.jpg, Temperature & Humidity HDC1080, components/sensor/hdc1080, hdc1080.jpg, Temperature & Humidity Honeywell ABP, components/sensor/honeywellabp, honeywellabp.jpg, Pressure & Temperature @@ -302,6 +304,7 @@ Environmental Inkbird IBS-TH1 Mini, components/sensor/inkbird_ibsth1_mini, inkbird_isbth1_mini.jpg, Temperature & Humidity MCP9808, components/sensor/mcp9808, mcp9808.jpg, Temperature MH-Z19, components/sensor/mhz19, mhz19.jpg, CO2 & Temperature + MPL3115A2, components/sensor/mpl3115a2, mpl3115a2.jpg, Temperature & Pressure MS5611, components/sensor/ms5611, ms5611.jpg, Pressure NTC Thermistor, components/sensor/ntc, ntc.jpg, Temperature QMP6988, components/sensor/qmp6988, qmp6988_env3.png, Temperature & Pressure @@ -360,6 +363,8 @@ Miscellaneous SMT100, components/sensor/smt100, smt100.jpg, Moisture & Temperature Tuya Sensor, components/sensor/tuya, tuya.png TX20, components/sensor/tx20, tx20.jpg, Wind speed & Wind direction + uFire EC sensor, components/sensor/ufire_ec, ufire_ec.png, EC & Temperature + uFire ISE sensor, components/sensor/ufire_ise, ufire_ise.png, pH & Temperature Motion @@ -379,7 +384,8 @@ Thermocouple MAX31855, components/sensor/max31855, max31855.jpg, K-Type MAX31856, components/sensor/max31856, max31856.jpg, All types MAX31865, components/sensor/max31865, max31865.jpg, Platinum RTD - MAX6675, components/sensor/max6675, max6675.jpg, K-Type + MAX6675, components/sensor/max6675, max6675.jpg, K-Type, + MCP9600, components/sensor/mcp9600, mcp9600.jpg, All types Weight @@ -490,6 +496,7 @@ Switch Components Restart Switch, components/switch/restart, restart.svg Safe Mode Switch, components/switch/safe_mode, restart-alert.svg Shutdown Switch, components/switch/shutdown, power_settings.svg + Factory Reset Switch, components/switch/factory_reset, restart-alert.svg Generic Output Switch, components/switch/output, upload.svg Template Switch, components/switch/template, description.svg UART Switch, components/switch/uart, uart.svg @@ -510,6 +517,7 @@ Button Components Restart Button, components/button/restart, restart.svg Safe Mode Button, components/button/safe_mode, restart-alert.svg Shutdown Button, components/button/shutdown, power_settings.svg + Factory Reset Button, components/button/factory_reset, restart-alert.svg Wake-on-LAN, components/button/wake_on_lan, power_settings.svg Fan Components @@ -533,8 +541,11 @@ Display Components LCD Display, components/display/lcd_display, lcd.jpg MAX7219, components/display/max7219, max7219.jpg MAX7219 Dot Matrix, components/display/max7219digit, max7219digit.jpg + TM1621, components/display/tm1621, tm1621.jpg TM1637, components/display/tm1637, tm1637.jpg + TM1638, components/display/tm1638, tm1638.jpg Nextion, components/display/nextion, nextion.jpg + PVVX MiThermometer, components/display/pvvx_mithermometer, ../components/sensor/images/xiaomi_lywsd03mmc.jpg SSD1306, components/display/ssd1306, ssd1306.jpg SSD1322, components/display/ssd1322, ssd1322.jpg SSD1325, components/display/ssd1325, ssd1325.jpg diff --git a/markdown.py b/markdown.py index 7f681e9fa..d38d8bc5d 100644 --- a/markdown.py +++ b/markdown.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # reStructuredText (RST) to GitHub-flavored Markdown converter -import re import sys from docutils import core, nodes, writers from urllib import parse @@ -32,8 +31,7 @@ class Translator(nodes.NodeVisitor): raise nodes.StopTraversal def visit_title(self, node): - self.version = re.match(r"(\d+\.\d+\.\d+).*", node.children[0]).group(1) - raise nodes.SkipChildren + pass def visit_title_reference(self, node): raise Exception( diff --git a/schema_doc.py b/schema_doc.py index 6520ed012..7bd78c886 100644 --- a/schema_doc.py +++ b/schema_doc.py @@ -834,7 +834,14 @@ class SchemaGeneratorVisitor(nodes.NodeVisitor): self.app.config.html_baseurl, self.docname + ".html#" + title.parent["ids"][0], ) - markdown += f"\n\n*See also: [{self.props_section_title}]({url})*" + if ( + self.props_section_title is not None + and self.props_section_title.endswith(title.astext()) + ): + markdown += f"\n\n*See also: [{self.props_section_title}]({url})*" + else: + markdown += f"\n\n*See also: [{self.getMarkdown(title)}]({url})*" + return markdown def update_prop(self, node, props):