mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-24 17:08:15 +01:00
Convert pin mode examples to new format (#1591)
This commit is contained in:
parent
400bdeb615
commit
1f8ecd46a6
@ -44,7 +44,9 @@ you can do so with the :ref:`Pin Schema <config-pin_schema>`.
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: D2
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
name: ...
|
||||
|
||||
Inverting Values
|
||||
|
@ -126,7 +126,9 @@ IR receiver.
|
||||
pin:
|
||||
number: GPIO14
|
||||
inverted: true
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
# high 55% tolerance is recommended for some remote control units
|
||||
tolerance: 55%
|
||||
|
||||
|
@ -201,7 +201,9 @@ appropriate lines of C code in the lambda to hide or show the image or text as y
|
||||
pin:
|
||||
number: GPIO0
|
||||
inverted: true
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
name: "T-Display Button Input 0"
|
||||
id: tdisplay_button_input_0
|
||||
- platform: gpio
|
||||
|
@ -36,7 +36,8 @@ The MCP23008 component (`datasheet <http://ww1.microchip.com/downloads/en/device
|
||||
mcp23xxx: mcp23008_hub
|
||||
# Use pin number 0
|
||||
number: 0
|
||||
mode: OUTPUT
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
|
||||
# Individual inputs
|
||||
@ -48,7 +49,8 @@ The MCP23008 component (`datasheet <http://ww1.microchip.com/downloads/en/device
|
||||
# Use pin number 1
|
||||
number: 1
|
||||
# One of INPUT or INPUT_PULLUP
|
||||
mode: INPUT
|
||||
mode:
|
||||
input: true
|
||||
inverted: false
|
||||
|
||||
Configuration variables:
|
||||
@ -98,7 +100,8 @@ has 16 GPIOs and can be configured the same way than the other variants.
|
||||
mcp23016: mcp23016_hub
|
||||
# Use pin number 0
|
||||
number: 0
|
||||
mode: OUTPUT
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
|
||||
# Individual inputs
|
||||
@ -109,7 +112,8 @@ has 16 GPIOs and can be configured the same way than the other variants.
|
||||
mcp23016: mcp23016_hub
|
||||
# Use pin number 1
|
||||
number: 1
|
||||
mode: INPUT
|
||||
mode:
|
||||
input: true
|
||||
inverted: false
|
||||
|
||||
|
||||
@ -157,7 +161,8 @@ binary sensor or GPIO switch.
|
||||
mcp23xxx: mcp23017_hub
|
||||
# Use pin number 0
|
||||
number: 0
|
||||
mode: OUTPUT
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
|
||||
# Individual inputs
|
||||
@ -169,7 +174,9 @@ binary sensor or GPIO switch.
|
||||
# Use pin number 1
|
||||
number: 1
|
||||
# One of INPUT or INPUT_PULLUP
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: false
|
||||
|
||||
Configuration variables:
|
||||
|
@ -38,7 +38,8 @@ The MCP23S08 component (`datasheet <http://ww1.microchip.com/downloads/en/Device
|
||||
# Use pin number 0
|
||||
number: 0
|
||||
# One of INPUT, INPUT_PULLUP or OUTPUT
|
||||
mode: OUTPUT
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
|
||||
# Individual inputs
|
||||
@ -50,7 +51,8 @@ The MCP23S08 component (`datasheet <http://ww1.microchip.com/downloads/en/Device
|
||||
# Use pin number 1
|
||||
number: 1
|
||||
# One of INPUT or INPUT_PULLUP
|
||||
mode: INPUT
|
||||
mode:
|
||||
input: true
|
||||
inverted: false
|
||||
|
||||
Configuration variables:
|
||||
@ -103,7 +105,8 @@ binary sensor or GPIO switch.
|
||||
mcp23xxx: mcp23s17_hub
|
||||
# Use pin number 0
|
||||
number: 0
|
||||
mode: OUTPUT
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
|
||||
# Individual inputs
|
||||
@ -115,7 +118,9 @@ binary sensor or GPIO switch.
|
||||
# Use pin number 1
|
||||
number: 1
|
||||
# One of INPUT or INPUT_PULLUP
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: false
|
||||
|
||||
Configuration variables:
|
||||
|
@ -37,7 +37,8 @@ for example the `RobotDyn dimmer
|
||||
gate_pin: D7
|
||||
zero_cross_pin:
|
||||
number: D6
|
||||
mode: INPUT
|
||||
mode:
|
||||
input: true
|
||||
inverted: yes
|
||||
|
||||
light:
|
||||
|
@ -43,7 +43,8 @@ not work.
|
||||
# Use pin number 0
|
||||
number: 0
|
||||
# One of INPUT or OUTPUT
|
||||
mode: OUTPUT
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
|
||||
Configuration variables:
|
||||
|
@ -260,7 +260,9 @@ Remote code selection (exactly one of these has to be included):
|
||||
pin:
|
||||
number: D4
|
||||
inverted: true
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
dump: all
|
||||
|
||||
|
||||
|
@ -151,7 +151,9 @@ The outputs can in turn be used to add PWM-enabled lights like the monochromatic
|
||||
sx1509: sx1509_hub1
|
||||
# Use pin number 0 on the SX1509
|
||||
number: 0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
|
||||
# Individual binary outputs
|
||||
@ -163,7 +165,8 @@ The outputs can in turn be used to add PWM-enabled lights like the monochromatic
|
||||
# Use pin number 1 on the SX1509
|
||||
number: 1
|
||||
# use as output for switch
|
||||
mode: OUTPUT
|
||||
mode:
|
||||
output: true
|
||||
inverted: false
|
||||
|
||||
# Individual outputs
|
||||
|
@ -147,7 +147,9 @@ which these adaptions created by `@cryptelli <https://community.home-assistant.i
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: 14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Power Button"
|
||||
on_press:
|
||||
@ -202,7 +204,9 @@ which these adaptions created by `@cryptelli <https://community.home-assistant.i
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO13
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Power Button"
|
||||
on_press:
|
||||
@ -321,7 +325,9 @@ Check the following page for calibrating the measurements: :ref:`sensor-filter-c
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: 14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Power Button"
|
||||
on_press:
|
||||
@ -474,7 +480,9 @@ Check the following page for calibrating the measurements: :ref:`sensor-filter-c
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: 14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "${item_name}_button"
|
||||
on_press:
|
||||
|
@ -83,7 +83,9 @@ and calculating the current with `Ohm's law <https://en.wikipedia.org/wiki/Ohm%2
|
||||
id: button1
|
||||
pin:
|
||||
number: GPIO14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
on_press:
|
||||
- switch.toggle: switch1
|
||||
|
@ -39,7 +39,9 @@ managed to build a fully working esphome configuration. This assumes you have a
|
||||
id: button
|
||||
pin:
|
||||
number: GPIO4
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: True
|
||||
name: 'Switch feeder'
|
||||
on_press:
|
||||
|
@ -117,7 +117,9 @@ Now you have a pair of wires from the GPIO and 0V to your retractive switch lets
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_1
|
||||
on_press:
|
||||
|
@ -97,7 +97,9 @@ The R1 version of the Dual controls the relays via the UART, so the code gets a
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO4
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_1
|
||||
on_press:
|
||||
@ -107,7 +109,9 @@ The R1 version of the Dual controls the relays via the UART, so the code gets a
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_2
|
||||
on_press:
|
||||
@ -196,7 +200,9 @@ It's basically the same as the :doc:`T2 </cookbook/sonoff-t1-3>`
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button
|
||||
on_press:
|
||||
@ -206,7 +212,9 @@ It's basically the same as the :doc:`T2 </cookbook/sonoff-t1-3>`
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button
|
||||
on_press:
|
||||
|
@ -115,7 +115,9 @@ Here is the configuration with the basic operations outlined above.
|
||||
name: "esp_fishpond_gpio14"
|
||||
pin:
|
||||
number: 14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
on_press:
|
||||
- switch.turn_off: esp_fishpond_pump
|
||||
|
||||
|
@ -36,7 +36,9 @@ T1
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_1
|
||||
on_press:
|
||||
@ -99,7 +101,9 @@ T2
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_1
|
||||
on_press:
|
||||
@ -109,7 +113,9 @@ T2
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_2
|
||||
on_press:
|
||||
@ -170,7 +176,9 @@ T3
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_1
|
||||
on_press:
|
||||
@ -180,7 +188,9 @@ T3
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_2
|
||||
on_press:
|
||||
@ -190,7 +200,9 @@ T3
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO10
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
id: button_3
|
||||
on_press:
|
||||
@ -241,4 +253,3 @@ See Also
|
||||
- :doc:`/cookbook/sonoff-light-switch`
|
||||
- :doc:`/guides/automations`
|
||||
- :doc:`/devices/sonoff_t1_uk_3gang_v1.1`
|
||||
|
||||
|
@ -243,25 +243,33 @@ of the basic functions.
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 1"
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 2"
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO10
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 3"
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 4"
|
||||
- platform: status
|
||||
|
@ -17,7 +17,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 1"
|
||||
on_press:
|
||||
@ -25,7 +27,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 2"
|
||||
on_press:
|
||||
@ -33,7 +37,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO10
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 3"
|
||||
on_press:
|
||||
@ -41,7 +47,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO14
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff 4CH Button 4"
|
||||
on_press:
|
||||
|
@ -70,7 +70,9 @@ exposes all of the basic functions.
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff Basic Button"
|
||||
on_press:
|
||||
|
@ -225,7 +225,9 @@ of the basic functions.
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff S20 Button"
|
||||
- platform: status
|
||||
|
@ -18,7 +18,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff S20 Button"
|
||||
on_press:
|
||||
|
@ -246,19 +246,25 @@ of the basic functions.
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T1 UK 3 Gang Touchpad 1"
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T1 UK 3 Gang Touchpad 2"
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO10
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T1 UK 3 Gang Touchpad 3"
|
||||
- platform: status
|
||||
|
@ -24,7 +24,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T1 UK 3 Gang Touchpad 1"
|
||||
on_press:
|
||||
@ -32,7 +34,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T1 UK 3 Gang Touchpad 2"
|
||||
on_press:
|
||||
@ -40,7 +44,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO10
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T1 UK 3 Gang Touchpad 3"
|
||||
on_press:
|
||||
|
@ -250,19 +250,25 @@ of the basic functions.
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T3 EU 3 Gang Touchpad 1"
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T3 EU 3 Gang Touchpad 2"
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO10
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T3 EU 3 Gang Touchpad 3"
|
||||
- platform: status
|
||||
|
@ -24,7 +24,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T3 EU 3 Gang Touchpad 1"
|
||||
on_press:
|
||||
@ -32,7 +34,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO9
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T3 EU 3 Gang Touchpad 2"
|
||||
on_press:
|
||||
@ -40,7 +44,9 @@ binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO10
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
name: "Sonoff T3 EU 3 Gang Touchpad 3"
|
||||
on_press:
|
||||
|
@ -21,7 +21,9 @@ binary_sensor:
|
||||
name: "Teckin Button"
|
||||
pin:
|
||||
number: GPIO1
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
inverted: true
|
||||
on_press:
|
||||
- switch.toggle: relay
|
||||
|
@ -127,7 +127,9 @@ Sensor </components/binary_sensor/gpio>`.
|
||||
pin:
|
||||
number: 16
|
||||
inverted: true
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
|
||||
This is an advanced feature of ESPHome. Almost all pins can
|
||||
optionally have a more complicated configuration schema with options for
|
||||
|
@ -133,7 +133,9 @@ Sensor </components/binary_sensor/gpio>`.
|
||||
pin:
|
||||
number: 16
|
||||
inverted: true
|
||||
mode: INPUT_PULLUP
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
|
||||
This time when installing, you don’t need to have the device plugged in
|
||||
through USB again. The upload will happen wirelessly (:doc:`"over the air" </components/ota>`).
|
||||
|
Loading…
Reference in New Issue
Block a user