From d738a58a60a961b4e98f07be87098b4e15e82b8f Mon Sep 17 00:00:00 2001 From: igg Date: Wed, 10 Jun 2020 13:02:51 -0700 Subject: [PATCH] Docs for CS Optional (#644) * Docs for CS Optional * rst fix Co-authored-by: Ilya Goldberg Co-authored-by: Guillermo Ruffino --- components/binary_sensor/pn532.rst | 4 +-- components/display/max7219.rst | 5 +-- components/display/ssd1306.rst | 9 +++--- components/display/ssd1325.rst | 3 +- components/display/waveshare_epaper.rst | 3 +- components/sensor/atm90e32.rst | 42 +++++++++++++------------ components/sensor/max31855.rst | 3 +- components/sensor/max6675.rst | 3 +- components/spi.rst | 3 +- 9 files changed, 42 insertions(+), 33 deletions(-) diff --git a/components/binary_sensor/pn532.rst b/components/binary_sensor/pn532.rst index 495c258df..f5e82f750 100644 --- a/components/binary_sensor/pn532.rst +++ b/components/binary_sensor/pn532.rst @@ -47,8 +47,8 @@ to have an :ref:`spi bus ` in your configuration with both the **miso_pin** Configuration variables: ************************ -- **cs_pin** (**Required**, :ref:`Pin Schema `): The pin on the ESP that the chip select line - is connected to. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The pin on the ESP that that the CS line is connected to. + The CS line can be connected to GND if this is the only device on the SPI bus. - **update_interval** (*Optional*, :ref:`config-time`): The duration of each scan on the PN532. This affects the duration that the individual binary sensors stay active when they're found. If a device is not found within this time window, it will be marked as not present. Defaults to 1s. diff --git a/components/display/max7219.rst b/components/display/max7219.rst index 1010ac1ee..71414d25f 100644 --- a/components/display/max7219.rst +++ b/components/display/max7219.rst @@ -19,7 +19,7 @@ with ESPHome. Please note that this integration is *only* for 7-segment display, As the communication with the MAX7219 is done using SPI for this integration, you need to have an :ref:`SPI bus ` in your configuration with both the **mosi_pin** set (miso_pin is not required). Connect VCC to 3.3V (the manufacturer recommends 4+ V, but 3.3V seems to work fine), DIN to your ``mosi_pin`` and -CS to your set ``cs_pin`` and finally GND to GND. +CS to your set ``cs_pin`` (or to GND if this is the only device on the SPI bus) 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 @@ -42,7 +42,8 @@ use a logic level converted. Configuration variables: ------------------------ -- **cs_pin** (**Required**, :ref:`Pin Schema `): The pin you have the CS line hooked up to. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The pin on the ESP that that the CS line is connected to. + The CS line can be connected to GND if this is the only device on the SPI bus. - **num_chips** (*Optional*, integer): The number of chips you wish to use for daisy chaining. Defaults to ``1``. - **intensity** (*Optional*, integer): The intensity with which the MAX7219 should drive the outputs. Range is from diff --git a/components/display/ssd1306.rst b/components/display/ssd1306.rst index d859a1d6c..167fe2c69 100644 --- a/components/display/ssd1306.rst +++ b/components/display/ssd1306.rst @@ -92,9 +92,9 @@ If your SSD1306 or SH1106 is connected via the :ref:`I²C Bus `, see :ref:` SSD1306 OLED Display Connect D0 to the CLK pin you chose for the :ref:`SPI bus `, connect D1 to the MOSI pin and ``DC`` and ``CS`` -to some GPIO pins on the ESP. For power, connect -VCC to 3.3V and GND to GND. Optionally you can also connect the ``RESET`` pin to a pin on the ESP which may -improve reliability. +to some GPIO pins on the ESP. If this is the only device on the SPI bus, the ``CS`` pin can be connected to GND. +For power, connect VCC to 3.3V and GND to GND. +Optionally you can also connect the ``RESET`` pin to a pin on the ESP which may improve reliability. .. code-block:: yaml @@ -126,7 +126,8 @@ Configuration variables: - ``SH1106 96x16`` - ``SH1106 64x48`` -- **cs_pin** (**Required**, :ref:`Pin Schema `): The Chip Select (CS) pin. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The pin on the ESP that that the CS line is connected to. + The CS line can be connected to GND if this is the only device on the SPI bus. - **dc_pin** (**Required**, :ref:`Pin Schema `): The DC pin. - **reset_pin** (*Optional*, :ref:`Pin Schema `): The RESET pin. Defaults to not connected. - **rotation** (*Optional*): Set the rotation of the display. Everything you draw in ``lambda:`` will be rotated diff --git a/components/display/ssd1325.rst b/components/display/ssd1325.rst index 3efbc4572..b3a363eac 100644 --- a/components/display/ssd1325.rst +++ b/components/display/ssd1325.rst @@ -51,7 +51,8 @@ Configuration variables: - ``SSD1325 64x48`` - **reset_pin** (:ref:`Pin Schema `): The RESET pin. -- **cs_pin** (:ref:`Pin Schema `): The CS pin. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The pin on the ESP that that the CS line is connected to. + The CS line can be connected to GND if this is the only device on the SPI bus. - **dc_pin** (:ref:`Pin Schema `): The DC pin. - **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display. See :ref:`display-engine` for more information. diff --git a/components/display/waveshare_epaper.rst b/components/display/waveshare_epaper.rst index f4ee28ed9..1768a3f44 100644 --- a/components/display/waveshare_epaper.rst +++ b/components/display/waveshare_epaper.rst @@ -66,7 +66,8 @@ configuration. Configuration variables: ------------------------ -- **cs_pin** (**Required**, :ref:`Pin Schema `): The CS pin. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The pin on the ESP that that the CS line is connected to. + The CS line can be connected to GND if this is the only device on the SPI bus. - **dc_pin** (**Required**, :ref:`Pin Schema `): The DC pin. - **model** (**Required**): The model of the E-Paper display. Options are: diff --git a/components/sensor/atm90e32.rst b/components/sensor/atm90e32.rst index d622c68ef..7360cca4b 100644 --- a/components/sensor/atm90e32.rst +++ b/components/sensor/atm90e32.rst @@ -36,7 +36,9 @@ The `CircuitSetup Expandable 6 Channel Energy Meter `): The pin CS is connected to. For the 6 channel meter main board, this will always be 5 and 4. For the add-on boards a jumper can be selected for each CS pin, but default to 0 and 16. +- **cs_pin** (**Required**, :ref:`Pin Schema `): The pin CS is connected to. For the 6 channel + meter main board, this will always be 5 and 4. For the add-on boards a jumper can be selected for each CS pin, + but default to 0 and 16. - **line_frequency** (**Required**, string): The AC line frequency of the supply voltage. One of ``50Hz``, ``60Hz``. - **phase_a** (*Optional*): The configuration options for the 1st phase. @@ -46,9 +48,9 @@ Configuration variables: :ref:`Sensor `. - **power** (*Optional*): Use the power value on this phase in watts. All options from :ref:`Sensor `. - - **reactive_power** (*Optional*): Use the reactive power value on this phase. All options from + - **reactive_power** (*Optional*): Use the reactive power value on this phase. All options from :ref:`Sensor `. - - **power_factor** (*Optional*): Use the power factor value on this phase. All options from + - **power_factor** (*Optional*): Use the power factor value on this phase. All options from :ref:`Sensor `. - **gain_voltage** (*Optional*, int): Voltage gain to scale the low voltage AC power pack to household mains feed. Defaults to ``7305``. @@ -57,9 +59,9 @@ Configuration variables: - **phase_b** (*Optional*): The configuration options for the 2nd phase. Same options as 1st phase. - **phase_c** (*Optional*): The configuration options for the 3rd phase. Same options as 1st phase. -- **frequency** (*Optional*): Use the frequenycy value calculated by the meter. All options from +- **frequency** (*Optional*): Use the frequenycy value calculated by the meter. All options from :ref:`Sensor `. -- **chip_temperature** (*Optional*): Use the chip temperature value. All options from +- **chip_temperature** (*Optional*): Use the chip temperature value. All options from :ref:`Sensor `. - **gain_pga** (*Optional*, string): The gain for the CT clamp, ``2X`` for 100A, ``4X`` for 100A - 200A. One of ``1X``, ``2X``, ``4X``. Defaults to ``2X`` which is suitable for the popular SCT-013-000 clamp. @@ -77,7 +79,7 @@ This sensor needs calibration to show correct values. The default gain configura Voltage ^^^^^^^ -Use the expected mains voltage for your region 110V/230V or plug in the Kill-A-Watt and select voltage. See what +Use the expected mains voltage for your region 110V/230V or plug in the Kill-A-Watt and select voltage. See what value the ATM90E32 sensor reports for voltage. To adjust the sensor use the calculation: ``New gain_voltage = (your voltage reading / ESPHome voltage reading) * existing gain_voltage value`` @@ -153,7 +155,7 @@ Additional Examples name: "EMON CT1 Current" power: name: "EMON Active Power CT1" - reactive_power: + reactive_power: name: "EMON Reactive Power CT1" power_factor: name: "EMON Power Factor CT1" @@ -164,7 +166,7 @@ Additional Examples name: "EMON CT2 Current" power: name: "EMON Active Power CT2" - reactive_power: + reactive_power: name: "EMON Reactive Power CT2" power_factor: name: "EMON Power Factor CT2" @@ -245,18 +247,18 @@ Additional Examples current_phases: 3 gain_pga: 1X update_interval: 60s - + .. code-block:: yaml # Example CircuitSetup 6-channel without jumpers jp9-jp11 joined or < meter v1.4 # power is calculated in a template - + substitutions: disp_name: 6C update_time: 10s current_cal: '27961' - + spi: clk_pin: 18 miso_pin: 19 @@ -318,7 +320,7 @@ Additional Examples current_phases: 3 gain_pga: 1X update_interval: ${update_time} - + #Watts per channel - platform: template name: ${disp_name} CT1 Watts @@ -327,7 +329,7 @@ Additional Examples accuracy_decimals: 0 unit_of_measurement: W icon: "mdi:flash-circle" - update_interval: ${update_time} + update_interval: ${update_time} - platform: template name: ${disp_name} CT2 Watts id: ct2Watts @@ -335,7 +337,7 @@ Additional Examples accuracy_decimals: 0 unit_of_measurement: W icon: "mdi:flash-circle" - update_interval: ${update_time} + update_interval: ${update_time} - platform: template name: ${disp_name} CT3 Watts id: ct3Watts @@ -343,7 +345,7 @@ Additional Examples accuracy_decimals: 0 unit_of_measurement: W icon: "mdi:flash-circle" - update_interval: ${update_time} + update_interval: ${update_time} - platform: template name: ${disp_name} CT4 Watts id: ct4Watts @@ -351,7 +353,7 @@ Additional Examples accuracy_decimals: 0 unit_of_measurement: W icon: "mdi:flash-circle" - update_interval: ${update_time} + update_interval: ${update_time} - platform: template name: ${disp_name} CT5 Watts id: ct5Watts @@ -359,7 +361,7 @@ Additional Examples accuracy_decimals: 0 unit_of_measurement: W icon: "mdi:flash-circle" - update_interval: ${update_time} + update_interval: ${update_time} - platform: template name: ${disp_name} CT6 Watts id: ct6Watts @@ -367,8 +369,8 @@ Additional Examples accuracy_decimals: 0 unit_of_measurement: W icon: "mdi:flash-circle" - update_interval: ${update_time} - #Total Amps + update_interval: ${update_time} + #Total Amps - platform: template name: ${disp_name} Total Amps id: totalAmps @@ -376,7 +378,7 @@ Additional Examples accuracy_decimals: 2 unit_of_measurement: A icon: "mdi:flash" - update_interval: ${update_time} + update_interval: ${update_time} #Total Watts - platform: template name: ${disp_name} Total Watts diff --git a/components/sensor/max31855.rst b/components/sensor/max31855.rst index 7beb5181c..33217a582 100644 --- a/components/sensor/max31855.rst +++ b/components/sensor/max31855.rst @@ -35,7 +35,8 @@ Configuration variables: ------------------------ - **name** (**Required**, string): The name for the temperature sensor. -- **cs_pin** (**Required**, :ref:`Pin Schema `): The Chip Select pin of the SPI interface. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The pin on the ESP that that the CS line is connected to. + The CS line can be connected to GND if this is the only device on the SPI bus. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. - **reference_temperature** (*Optional*, :ref:`Sensor `): Access the internal temperature sensor of the MAX31855. Requires a **name** and/or **id**. - **spi_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`SPI Component ` if you want to use multiple SPI buses. diff --git a/components/sensor/max6675.rst b/components/sensor/max6675.rst index 06a6cb90a..9407bb04e 100644 --- a/components/sensor/max6675.rst +++ b/components/sensor/max6675.rst @@ -43,7 +43,8 @@ Configuration variables: ------------------------ - **name** (**Required**, string): The name for the temperature sensor. -- **cs_pin** (**Required**, :ref:`Pin Schema `): The Chip Select pin of the SPI interface. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The pin on the ESP that that the CS line is connected to. + The CS line can be connected to GND if this is the only device on the SPI bus. - **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``. - **spi_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :ref:`SPI Component ` if you want diff --git a/components/spi.rst b/components/spi.rst index 71c311a76..1b935cd35 100644 --- a/components/spi.rst +++ b/components/spi.rst @@ -13,7 +13,8 @@ SPI is a very common high-speed protocol for a lot of devices. The SPI bus usual - **CLK**: Is used to tell the receiving device when to read data. All devices on the bus can share this line. Sometimes also called ``SCK``. - **CS** (chip select): Is used to tell the receiving device when it should listen for data. Each device has - an individual CS line. Sometimes also called ``SS``. + an individual CS line. Sometimes also called ``SS``. If the SPI bus has a single device, it's CS pin + can usually be connected to ground to tell it that it is allways selected. - **MOSI** (also DIN): Is used to send data from the master (the ESP) to the receiving device. All devices on the bus can share this line. - **MISO** (also DOUT): Is used to receive data. All devices on the bus can