Skip to content

Commit 980d027

Browse files
authored
Break apart 1-Wire doc (#5082)
1 parent a7fd624 commit 980d027

File tree

9 files changed

+130
-80
lines changed

9 files changed

+130
-80
lines changed

changelog/2024.6.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ESPHome 2024.6.0 - 19th June 2024
1414
HTTP Request OTA Updates, components/ota_http_request, system-update.svg, dark-invert
1515
Managed Updates, components/update/http_request, system-update.svg, dark-invert
1616

17-
1-Wire, components/one_wire, one-wire.svg
17+
1-Wire, components/one_wire/index, one-wire.svg
1818
GDK101, components/sensor/gdk101, gdk101.jpg
1919
Beken SPI, components/light/beken_spi_led_strip, color_lens.svg, dark-invert
2020

@@ -138,7 +138,7 @@ need to do unless you were overriding some of the safe mode specific configurati
138138

139139
Up until now, the ``dallas`` sensor platform contained the only 1-wire implementation in ESPHome.
140140
There had been requests to add support for other 1-wire based components, so :ghuser:`ssieb` has
141-
made a new top level :doc:`1-wire </components/one_wire>` component that will allow for this.
141+
made a new top level :doc:`1-wire </components/one_wire/index>` component that will allow for this.
142142
In doing so, the ``dallas`` sensor platform has been removed, and replaced with ``dallas_temp``
143143
to allow for other Dallas sensors to be implemented that are not temperature sensors.
144144

components/index.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Hardware Peripheral Interfaces/Busses
160160

161161
.. imgtable::
162162

163-
1-Wire, components/one_wire, one-wire.svg
163+
1-Wire, components/one_wire/index, one-wire.svg
164164
CAN Bus, components/canbus/index, canbus.svg
165165
I²C Bus, components/i2c, i2c.svg
166166
I²S Audio, components/i2s_audio, i2s_audio.svg
@@ -191,12 +191,25 @@ I/O Expanders/Multiplexers
191191
WeiKai SPI/I²C UART/IO Expander, components/weikai, wk2168.jpg
192192
XL9535, components/xl9535, xl9535.svg
193193

194+
1-Wire Bus
195+
----------
196+
197+
Platforms which specifically support or extend the :doc:`/components/one_wire/index`, allowing communication with
198+
1-Wire-based devices.
199+
200+
.. imgtable::
201+
202+
DS2484, components/one_wire/ds2484, ds2484.svg
203+
GPIO, components/one_wire/gpio, gpio.svg
204+
194205
CAN Bus
195206
-------
196207

208+
Platforms which specifically support or extend the :doc:`/components/canbus/index`, allowing communication with
209+
CAN-based devices.
210+
197211
.. imgtable::
198212

199-
CAN Bus, components/canbus/index, canbus.svg
200213
ESP32 CAN, components/canbus/esp32_can, esp32.svg
201214
MCP2515, components/canbus/mcp2515, mcp2515.svg
202215

@@ -1125,6 +1138,7 @@ ESPHome depends on and welcomes contributions from our community. If you'd like
11251138
binary_sensor/index
11261139
camera/index
11271140
canbus/index
1141+
one_wire/index
11281142
climate/index
11291143
cover/index
11301144
fan/index

components/one_wire.rst

Lines changed: 0 additions & 74 deletions
This file was deleted.

components/one_wire/ds2484.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
1-Wire Bus via DS2484
2+
=====================
3+
4+
.. seo::
5+
:description: Instructions for setting up a Dallas (Analog Devices) 1-Wire bus via a DS2484 IC to communicate with 1-wire devices in ESPHome
6+
:image: one-wire.svg
7+
:keywords: Dallas, onewire, 1-wire
8+
9+
The ``ds2484`` platform provides access to 1-Wire busses via DS2484 device using the :ref:`I²C Bus <i2c>` for
10+
communication.
11+
12+
.. code-block:: yaml
13+
14+
# Example configuration entry
15+
one_wire:
16+
- platform: ds2484
17+
active_pullup: true
18+
19+
Configuration variables:
20+
************************
21+
22+
- **active_pullup** (*Optional*, defaults to ``false``): enables DS2484 `active_pullup`.
23+
- **strong_pullup** (*Optional*, defaults to ``false``): enables DS2484 `strong_pullup`.
24+
- **address** (*Optional*, int): The I²C address of the device. Defaults to ``0x18``.
25+
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. Required if you have
26+
multiple 1-Wire busses.
27+
- **i2c_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the :doc:`/components/i2c`. Required if you
28+
have configured multiple I2C busses.
29+
30+
See Also
31+
--------
32+
33+
- :doc:`index`
34+
- :apiref:`one_wire/one_wire_bus.h`
35+
- :ghedit:`Edit`
36+
- `Guidelines for Reliable Long Line 1-Wire Networks <https://www.analog.com/en/technical-articles/guidelines-for-reliable-long-line-1wire-networks.html>`__

components/one_wire/gpio.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
1-Wire Bus via GPIO
2+
===================
3+
4+
.. seo::
5+
:description: Instructions for setting up a Dallas (Analog Devices) 1-Wire bus via a GPIO pin to communicate with 1-wire devices in ESPHome
6+
:image: one-wire.svg
7+
:keywords: Dallas, onewire, 1-wire
8+
9+
The ``gpio`` platform uses the CPU to generate the bus signals on an on-board GPIO pin.
10+
11+
.. code-block:: yaml
12+
13+
# Example configuration entry
14+
one_wire:
15+
- platform: gpio
16+
pin: GPIOXX
17+
18+
Configuration variables:
19+
************************
20+
21+
- **pin** (**Required**, number): The pin which will be use for bus communication. Note that 1-wire is a bi-directional
22+
bus so the selected GPIO pin must support both input and output. This must be a GPIO pin internal to the
23+
microcontroller and cannot be a pin located on an I/O expander or similar device.
24+
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. Required if you have
25+
multiple busses.
26+
27+
See Also
28+
--------
29+
30+
- :doc:`index`
31+
- :apiref:`one_wire/one_wire_bus.h`
32+
- :ghedit:`Edit`
33+
- `Guidelines for Reliable Long Line 1-Wire Networks <https://www.analog.com/en/technical-articles/guidelines-for-reliable-long-line-1wire-networks.html>`__

components/one_wire/index.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
1-Wire Bus
2+
==========
3+
4+
.. seo::
5+
:description: Instructions for setting up a Dallas (Analog Devices) 1-Wire bus to communicate with 1-wire devices in ESPHome
6+
:image: one-wire.svg
7+
:keywords: Dallas, onewire, 1-wire
8+
9+
The ``one_wire`` component allows you to use supported 1-Wire devices in ESPHome.
10+
11+
The 1-Wire bus the devices are connected to should have an external pull-up resistor of about 4.7KΩ. A resistor of
12+
*about* 4.7KΩ connected between ``3.3V`` and the 1-Wire bus's GPIO/data pin should suffice. Values ± 1KΩ will generally
13+
work fine as well, provided you don't have unusually long wires.
14+
15+
Platforms
16+
---------
17+
18+
.. toctree::
19+
:maxdepth: 1
20+
:glob:
21+
22+
*
23+
24+
Obtaining Sensor IDs
25+
--------------------
26+
27+
To find device addresses, simply start the firmware on your device with a ``one_wire`` hub configured and observe the
28+
log output. Note that you don't need to define the individual sensors just yet, as scanning will occur even with no
29+
sensors configured.
30+
31+
Here's an example log:
32+
33+
.. figure:: images/dallas-log.png
34+
35+
See Also
36+
--------
37+
38+
- :apiref:`one_wire/one_wire_bus.h`
39+
- :ghedit:`Edit`
40+
- `Guidelines for Reliable Long Line 1-Wire Networks <https://www.analog.com/en/technical-articles/guidelines-for-reliable-long-line-1wire-networks.html>`__

components/sensor/dallas_temp.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Dallas Temperature Sensor
99
The ``dallas_temp`` component allows you to use
1010
`DS18B20 <https://www.adafruit.com/product/374>`__
1111
(`datasheet <https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf>`__)
12-
and similar 1-Wire temperature sensors. A :ref:`1-Wire bus <one_wire>` is
12+
and similar 1-Wire temperature sensors. A :doc:`1-Wire bus </components/one_wire/index>` is
1313
required to be set up in your configuration for this sensor to work.
1414

1515
.. code-block:: yaml
@@ -29,7 +29,7 @@ Configuration variables:
2929
Defaults to the maximum for most Dallas temperature sensors: 12.
3030
- **update_interval** (*Optional*, :ref:`config-time`): The interval that the sensors should be checked.
3131
Defaults to 60 seconds.
32-
- **one_wire_id** (*Optional*, :ref:`one_wire`): The ID of the 1-Wire bus to use.
32+
- **one_wire_id** (*Optional*, :doc:`/components/one_wire/index`): The ID of the 1-Wire bus to use.
3333
Required if there is more than one bus.
3434
- All other options from :ref:`Sensor <config-sensor>`.
3535

images/ds2484.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)