From 75107305c96050031947fbd653ca9b95f6998be4 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 11 Feb 2022 11:10:43 +1300 Subject: [PATCH] Some docs tidy up (#1895) --- components/api.rst | 2 +- components/captive_portal.rst | 2 +- components/cover/current_based.rst | 5 +- components/cover/tuya.rst | 31 +---- components/dfplayer.rst | 12 -- components/display/inkplate6.rst | 11 +- components/display/st7789v.rst | 29 +--- components/esphome.rst | 7 +- components/fingerprint_grow.rst | 66 +-------- components/light/tuya.rst | 31 +---- components/modbus_controller.rst | 34 +---- components/mqtt.rst | 2 +- components/nspanel.rst | 31 +++++ components/ota.rst | 2 +- components/output/my9231.rst | 24 ++-- components/output/sm16716.rst | 11 +- components/rtttl.rst | 5 +- components/tuya.rst | 20 +-- components/wifi.rst | 7 + cookbook/arduino_port_extender.rst | 11 +- .../brilliant-mirabella-genio-smart-plugs.rst | 131 +++++++++--------- cookbook/bruh.rst | 7 +- cookbook/dual-r2-cover.rst | 7 +- cookbook/esw01-eu.rst | 3 +- cookbook/h801.rst | 23 ++- cookbook/ifan02.rst | 9 +- cookbook/ilonda-wifi-smart-fish-feeder.rst | 3 +- cookbook/infostrip.rst | 23 +-- cookbook/iwoole_rgbw_table_lamp.rst | 29 +--- cookbook/leak-detector-m5stickC.rst | 31 +---- cookbook/mirabella-genio-bulb.rst | 34 +++-- cookbook/sonoff-basic-light-switch.rst | 3 +- cookbook/sonoff-dual-light-switch.rst | 6 +- cookbook/sonoff-fishpond-pump.rst | 7 +- cookbook/sonoff-t1-3.rst | 12 +- cookbook/teckin_sb50.rst | 7 +- cookbook/tracer-an.rst | 15 +- cookbook/zemismart-rgbw-downlights.rst | 7 +- devices/esp32.rst | 6 +- devices/esp8266.rst | 6 +- devices/nodemcu_esp32.rst | 10 +- devices/nodemcu_esp8266.rst | 6 +- devices/sonoff.rst | 3 +- devices/sonoff_4ch.rst | 18 +-- devices/sonoff_4ch.yaml | 7 +- devices/sonoff_basic.rst | 7 +- devices/sonoff_s20.rst | 17 +-- devices/sonoff_s20.yaml | 8 +- devices/sonoff_t1_uk_3gang_v1.1.rst | 16 ++- devices/sonoff_t1_uk_3gang_v1.1.yaml | 10 +- devices/sonoff_t3_eu_3gang_v1.0.rst | 16 ++- devices/sonoff_t3_eu_3gang_v1.0.yaml | 10 +- devices/teckin.yaml | 7 +- devices/teckin_sp20_us.yaml | 13 +- guides/configuration-types.rst | 7 +- guides/creators.rst | 4 +- index.rst | 2 +- 57 files changed, 355 insertions(+), 518 deletions(-) create mode 100644 components/nspanel.rst diff --git a/components/api.rst b/components/api.rst index aa4628e21..fbd63dd3b 100644 --- a/components/api.rst +++ b/components/api.rst @@ -23,7 +23,7 @@ A Python library that implements this protocol is `aioesphomeapi ` to be configured. Put the ``tuya`` component in -the config and it will list the possible devices for you in the config log. - -.. code-block:: yaml - - # Example configuration entry - # Make sure your WiFi will connect - wifi: - ssid: "ssid" - password: "password" - - # Make sure logging is not using the serial port - logger: - baud_rate: 0 - - # Enable Home Assistant API - api: - - # Make sure you can upload new firmware OTA - ota: - - # My cover used the hardware serial port on the alternate pins - uart: - rx_pin: GPIO13 - tx_pin: GPIO15 - baud_rate: 9600 - - # Register the Tuya MCU connection - tuya: +This requires the :doc:`/components/tuya` component to be set up before you can use this platform. Here is an example output for a Tuya M515EGWT (motor for chain roller blinds): diff --git a/components/dfplayer.rst b/components/dfplayer.rst index c574965b2..9bc19771e 100644 --- a/components/dfplayer.rst +++ b/components/dfplayer.rst @@ -311,18 +311,6 @@ Sample code .. code-block:: yaml - esphome: - name: test_node - platform: ESP8266 - board: nodemcu - - wifi: - ssid: !secret wifi_ssid - password: !secret wifi_pass - - logger: - level: VERBOSE - uart: tx_pin: GPIO2 rx_pin: GPIO5 diff --git a/components/display/inkplate6.rst b/components/display/inkplate6.rst index 803a5d268..37279cf26 100644 --- a/components/display/inkplate6.rst +++ b/components/display/inkplate6.rst @@ -124,17 +124,16 @@ Wi-Fi, API, and OTA configuration. # Example configuration entry esphome: name: inkplate - platform: ESP32 + + esp32: board: esp-wrover-kit logger: wifi: - ssid: - password: - ap: - ssid: Inkplate-AP - password: '12345678' + ssid: !secret wifi_ssid + password: !secret wifi_password + ap: {} captive_portal: diff --git a/components/display/st7789v.rst b/components/display/st7789v.rst index 7bdeb8fa8..b9c796b92 100644 --- a/components/display/st7789v.rst +++ b/components/display/st7789v.rst @@ -108,8 +108,7 @@ To bring in color images: Complete example **************** -The following is a complete example YAML configuration that does a few things beyond the usual -Wi-Fi, API, and OTA configuration. It defines: +The following is an example YAML configuration that you can add to your base device configuration. It defines: - three fonts (well, one font in three sizes) - a ``binary_sensor`` that indicates the state of connectivity to the API @@ -134,32 +133,6 @@ appropriate lines of C code in the lambda to hide or show the image or text as y .. code-block:: yaml - esphome: - name: esp_tdisplay - platform: ESP32 - board: featheresp32 - - wifi: - ssid: "ssid" - password: "password" - - # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "esp_tdisplay" - password: "some_password" - - captive_portal: - - # Enable logging - logger: - - # Enable Home Assistant API - api: - password: "some_api_password" - - ota: - password: "some_ota_password" - color: - id: my_red red: 100% diff --git a/components/esphome.rst b/components/esphome.rst index 6e4f622e2..2ad9c9d89 100644 --- a/components/esphome.rst +++ b/components/esphome.rst @@ -15,7 +15,8 @@ where you specify the **name** of the node. esphome: name: livingroom comment: Living room ESP32 controller - platform: ESP32 + + esp32: board: nodemcu-32s .. _esphome-configuration_variables: @@ -50,8 +51,8 @@ Advanced options: - **name** (**Required**, string): Name of the project - **version** (**Required**, string): Version of the project -Old-style platform options, which have been moved to the platform-specific :doc:`esp32 ` and -:doc:`esp8266 ` sections but are still accepted here for compatibility reasons (usage not +Old-style platform options, which have been moved to the platform-specific :doc:`esp32 ` and +:doc:`esp8266 ` sections but are still accepted here for compatibility reasons (usage not recommended for new projects): - **platform** (**Required**, string): The platform used, either ``esp8266`` or ``esp32``. diff --git a/components/fingerprint_grow.rst b/components/fingerprint_grow.rst index 6edddd3ff..b7cbfadf6 100644 --- a/components/fingerprint_grow.rst +++ b/components/fingerprint_grow.rst @@ -39,61 +39,16 @@ If available on your reader model, it's recommended to connect 3.3VT (touch indu fingerprint_grow: sensing_pin: GPIO12 on_finger_scan_matched: - - text_sensor.template.publish: - id: fingerprint_state - state: "Authorized finger" - - switch.turn_on: gate - - delay: 500ms - - switch.turn_off: gate + ... on_finger_scan_unmatched: - - text_sensor.template.publish: - id: fingerprint_state - state: "Unauthorized finger" + ... on_enrollment_scan: - - text_sensor.template.publish: - id: fingerprint_state - state: "Finger scanned" + ... on_enrollment_done: - - text_sensor.template.publish: - id: fingerprint_state - state: "Enrolled fingerprint" + ... on_enrollment_failed: - - text_sensor.template.publish: - id: fingerprint_state - state: "Failed to enroll fingerprint" + ... - # Optional template text sensor for visual feedback - text_sensor: - - platform: template - id: fingerprint_state - name: "Fingerprint State" - - # Optional component (GPIO switch, lock etc.) to control in on_finger_scan_matched trigger - switch: - - platform: gpio - pin: GPIO14 - id: gate - - # Optional sensors - binary_sensor: - - platform: fingerprint_grow - id: fingerprint_enrolling - name: "Fingerprint Enrolling" - - sensor: - - platform: fingerprint_grow - fingerprint_count: - name: "Fingerprint Count" - last_finger_id: - name: "Fingerprint Last Finger ID" - last_confidence: - name: "Fingerprint Last Confidence" - status: - name: "Fingerprint Status" - capacity: - name: "Fingerprint Capacity" - security_level: - name: "Fingerprint Security Level" Configuration variables: @@ -458,17 +413,6 @@ Sample code .. code-block:: yaml - esphome: - name: test_node - platform: ESP8266 - board: nodemcu - - wifi: - ssid: !secret wifi_ssid - password: !secret wifi_pass - - logger: - uart: rx_pin: GPIO13 tx_pin: GPIO15 diff --git a/components/light/tuya.rst b/components/light/tuya.rst index 4838e7456..2c2ee3df5 100644 --- a/components/light/tuya.rst +++ b/components/light/tuya.rst @@ -16,36 +16,7 @@ tuya serial component. The dimmer switch I got would hang if the logger was configured to use the serial port which meant it was bricked until I cut it open. -There are two components, the Tuya bus and the dimmer that uses it. The :doc:`/components/tuya` -component requires a :ref:`UART bus ` to be configured. Put the ``tuya`` component in -the config and it will list the possible devices for you in the config log. - -.. code-block:: yaml - - # Example configuration entry - # Make sure your WiFi will connect - wifi: - ssid: "ssid" - password: "password" - - # Make sure logging is not using the serial port - logger: - baud_rate: 0 - - # Enable Home Assistant API - api: - - # Make sure you can upload new firmware OTA - ota: - - # My dimmer used the hardware serial port on the alternate pins - uart: - rx_pin: GPIO13 - tx_pin: GPIO15 - baud_rate: 9600 - - # Register the Tuya MCU connection - tuya: +This requires the :doc:`/components/tuya` component to be set up before you can use this platform. Here is an example output for a Tuya dimmer: diff --git a/components/modbus_controller.rst b/components/modbus_controller.rst index a8c658ae9..701c55439 100644 --- a/components/modbus_controller.rst +++ b/components/modbus_controller.rst @@ -28,13 +28,13 @@ The controller connects to the UART of the MCU. For ESP32 GPIO PIN 16 to TXD PI .. note:: If you are using an ESP8266, serial logging may cause problems reading from UART. For best results, hardware serial is recommended. Software serial may not be able to read all received data if other components spend a lot of time in the ``loop()``. - + For hardware serial only a limited set of pins can be used. Either ``tx_pin: GPIO1`` and ``rx_pin: GPIO3`` or ``tx_pin: GPIO15`` and ``rx_pin: GPIO13``. - + The disadvantage of using the hardware uart is that you can't use serial logging because the serial logs would be sent to the modbus device and cause errors. - + Serial logging can be disabled by setting ``baud_rate: 0``. - + See :doc:`logger` for more details .. code-block:: yaml @@ -67,26 +67,6 @@ Technically there is no difference between the "inline" and the standard definit .. code-block:: yaml - esphome: - name: solarstation - platform: ESP32 - board: esp32dev - - substitutions: - updates: 30s - - wifi: - ssid: !secret wifi_sid - password: !secret wifi_password - reboot_timeout: 2min - - logger: - level: INFO - baud_rate: 0 - - api: - password: !secret api_password - uart: id: mod_bus tx_pin: 17 @@ -324,12 +304,6 @@ Then battery charge settings are sent. .. code-block:: yaml esphome: - name: solarstation-test - platform: ESP32 - board: esp32dev - - ## send config values at startup - ## configure rtc clock and battery charge settings on_boot: ## configure controller settings at setup ## make sure priority is lower than setup_priority of modbus_controller diff --git a/components/mqtt.rst b/components/mqtt.rst index 6a729a647..2160bd1d6 100644 --- a/components/mqtt.rst +++ b/components/mqtt.rst @@ -22,7 +22,7 @@ in which case this is not needed. mqtt: broker: 10.0.0.2 username: livingroom - password: MyMQTTPassword + password: !secret mqtt_password Configuration variables: ------------------------ diff --git a/components/nspanel.rst b/components/nspanel.rst new file mode 100644 index 000000000..843909f92 --- /dev/null +++ b/components/nspanel.rst @@ -0,0 +1,31 @@ +Sonoff NSPanel +============== + +.. seo:: + :description: Instructions for using ESPHome of the Sonoff NSPanel + +The Sonoff NSPanel integration allows ESPHome to control features and functionality of the NSPanel's +built in display. + +.. code-block:: yaml + + nspanel: + time_id: REPLACEME + temperature: temperature_id + screen_power_switch: screen_power_switch_id + relays: + - relay_1_id + - relay_2_id + + widgets: + - type: scene + name: Test + on_click: + - logger.log: Test Scene tapped + + - type: empty + ... + + +Configuration Variables: +------------------------ diff --git a/components/ota.rst b/components/ota.rst index c11fa7aa4..eb67f5e1c 100644 --- a/components/ota.rst +++ b/components/ota.rst @@ -23,7 +23,7 @@ Logging+WiFi+OTA are initialized, so that you can upload a new binary. # Example configuration entry ota: safe_mode: true - password: VERYSECURE + password: !secret ota_password Configuration variables: ------------------------ diff --git a/components/output/my9231.rst b/components/output/my9231.rst index c3889ed75..f20b7c904 100644 --- a/components/output/my9231.rst +++ b/components/output/my9231.rst @@ -106,20 +106,20 @@ complete configuration for a Sonoff B1 looks like: .. code-block:: yaml esphome: - name: - platform: ESP8266 + name: REPLACEME + + esp8266: board: esp01_1m wifi: - ssid: - password: + ssid: !secret wifi_ssid + password: !secret wifi_password api: logger: ota: - password: my9231: data_pin: GPIO12 # GPIO13 for AiLight @@ -147,7 +147,7 @@ complete configuration for a Sonoff B1 looks like: light: - platform: rgbww - name: + name: REPLACEME red: output_red green: output_green blue: output_blue @@ -161,20 +161,20 @@ And here is a complete configuration for the AiThinker AiLight: .. code-block:: yaml esphome: - name: - platform: ESP8266 + name: REPLACEME + + esp8266: board: esp01_1m wifi: - ssid: - password: + ssid: !secret wifi_ssid + password: !secret wifi_password api: logger: ota: - password: my9231: data_pin: GPIO13 @@ -199,7 +199,7 @@ And here is a complete configuration for the AiThinker AiLight: light: - platform: rgbw - name: + name: REPLACEME red: output_red green: output_green blue: output_blue diff --git a/components/output/sm16716.rst b/components/output/sm16716.rst index bab404c31..e61270806 100644 --- a/components/output/sm16716.rst +++ b/components/output/sm16716.rst @@ -111,20 +111,21 @@ A complete configuration for a Feit Electric A19 looks like: .. code-block:: yaml esphome: - name: - platform: ESP8266 + name: REPLACEME + friendly_name: REPLACEME + + esp8266: board: esp01_1m wifi: - ssid: - password: + ssid: !secret wifi_ssid + password: !secret wifi_password api: logger: ota: - password: sm16716: data_pin: GPIO14 diff --git a/components/rtttl.rst b/components/rtttl.rst index 1b71b8b76..077edceb8 100644 --- a/components/rtttl.rst +++ b/components/rtttl.rst @@ -129,12 +129,13 @@ Sample code esphome: name: test_esp8266 - platform: ESP8266 + + esp8266: board: nodemcuv2 wifi: ssid: !secret wifi_ssid - password: !secret wifi_pass + password: !secret wifi_password output: - platform: esp8266_pwm diff --git a/components/tuya.rst b/components/tuya.rst index b14446926..6067dc5c4 100644 --- a/components/tuya.rst +++ b/components/tuya.rst @@ -16,22 +16,10 @@ Put the ``tuya`` component in the config and it will list the possible devices f .. code-block:: yaml - # Example configuration entry - # Make sure your wifi will connect - wifi: - ssid: "ssid" - password: "password" - # Make sure logging is not using the serial port logger: baud_rate: 0 - # Enable Home Assistant API - api: - - # Make sure you can upload new firmware OTA - ota: - uart: rx_pin: GPIO3 tx_pin: GPIO1 @@ -55,7 +43,7 @@ Here is an example output for a Tuya fan controller: Configuration variables: ------------------------ -- **time_id** (*Optional*, :ref:`config-id`): Some Tuya devices support obtaining local time from ESPHome. +- **time_id** (*Optional*, :ref:`config-id`): Some Tuya devices support obtaining local time from ESPHome. Specify the ID of the :ref:`Time Component