From 75a111c1acb97458dc7b3847ee94fd621848f46d Mon Sep 17 00:00:00 2001 From: FrengerH Date: Tue, 26 Feb 2019 18:46:04 +0100 Subject: [PATCH] Merge dallas component (#179) * Merge dellas component with platform * Fixed headers --- components/dallas.rst | 48 -------------------------------- components/sensor/dallas.rst | 54 +++++++++++++++++++++++++++++++----- index.rst | 1 - 3 files changed, 47 insertions(+), 56 deletions(-) delete mode 100644 components/dallas.rst diff --git a/components/dallas.rst b/components/dallas.rst deleted file mode 100644 index 77ab14878..000000000 --- a/components/dallas.rst +++ /dev/null @@ -1,48 +0,0 @@ -Dallas Temperature Component -============================ - -.. seo:: - :description: Instructions for setting up dallas temperature sensor hubs that can expose many temperature sensors on a single pin using the one wire protocol. - :image: dallas.jpg - :keywords: Dallas, ds18b20, onewire - -The ``dallas`` component allows you to use your -`DS18b20 `__ -(`datasheet `__) -and similar One-Wire temperature sensors. - -To use your dallas sensor, first define a dallas “hub” with a pin and -id, which you will later use to create the sensors. The 1-Wire bus the -sensors are connected to should have an external pullup resistor of -about 4.7KΩ. For this, connect a resistor of *about* 4.7KΩ (values around that like 1Ω will, if you don't have -massively long wires, work fine in most cases) between ``3.3V`` and the data pin. - -.. code-block:: yaml - - # Example configuration entry - dallas: - - pin: 23 - - # Individual sensors - sensor: - - platform: dallas - address: 0x1c0000031edd2a28 - name: "Livingroom Temperature" - -Configuration variables: ------------------------- - -- **pin** (**Required**, number): The pin the sensor bus is connected to. -- **update_interval** (*Optional*, :ref:`config-time`): The interval that the sensors should be checked. - Defaults to 60 seconds. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - -See Also --------- - -- :doc:`sensor/dallas` -- `Arduino DallasTemperature library `__ by `Miles Burton `__ -- :apiref:`sensor/dallas_component.h` -- :ghedit:`Edit` - -.. disqus:: diff --git a/components/sensor/dallas.rst b/components/sensor/dallas.rst index 7873d5fe0..263e36384 100644 --- a/components/sensor/dallas.rst +++ b/components/sensor/dallas.rst @@ -2,12 +2,53 @@ Dallas Temperature Sensor ========================= .. seo:: - :description: Instructions for setting up DS18b20 and similar temperature sensors + :description: Instructions for setting up dallas temperature sensor hubs that can expose many temperature sensors on a single pin using the one wire protocol. :image: dallas.jpg - :keywords: dallas, ds18b20 + :keywords: Dallas, ds18b20, onewire + +.. _dallas-component: + +Component/Hub +------------- + +The ``dallas`` component allows you to use your +`DS18b20 `__ +(`datasheet `__) +and similar One-Wire temperature sensors. + +To use your :ref:`dallas sensor `, first define a dallas “hub” with a pin and +id, which you will later use to create the sensors. The 1-Wire bus the +sensors are connected to should have an external pullup resistor of +about 4.7KΩ. For this, connect a resistor of *about* 4.7KΩ (values around that like 1Ω will, if you don't have +massively long wires, work fine in most cases) between ``3.3V`` and the data pin. + +.. code-block:: yaml + + # Example configuration entry + dallas: + - pin: 23 + + # Individual sensors + sensor: + - platform: dallas + address: 0x1c0000031edd2a28 + name: "Livingroom Temperature" + +Configuration variables: +************************ + +- **pin** (**Required**, number): The pin the sensor bus is connected to. +- **update_interval** (*Optional*, :ref:`config-time`): The interval that the sensors should be checked. + Defaults to 60 seconds. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. + +.. _dallas-sensor: + +Sensors +------- The ``dallas`` sensor allows you to use ds18b20 and similar sensors. -First, you need to define a :doc:`dallas sensor component `. +First, you need to define a :ref:`dallas sensor component `. The dallas sensor component (or "hub") is an internal model that defines which pins the ds18b20 sensors are connected to. This is because with these sensors you can actually connect multiple sensors to a single pin and use them all at once. @@ -39,7 +80,7 @@ To initialize a sensor, first supply either ``address`` **or** ``index`` to iden name: "Living Room Temperature" Configuration variables: ------------------------- +************************ - **address** (**Required**, int): The address of the sensor. Use either this option or index. @@ -48,7 +89,7 @@ Configuration variables: to use address instead `. - **resolution** (*Optional*, int): An optional resolution from 8 to 12. Higher means more accurate. Defaults to the maximum for most dallas temperature sensors: 12. -- **dallas_id** (*Optional*, :ref:`config-id`): The ID of the :doc:`dallas hub `. +- **dallas_id** (*Optional*, :ref:`config-id`): The ID of the :ref:`dallas hub `. Use this if you have multiple dallas hubs. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Sensor `. @@ -56,7 +97,7 @@ Configuration variables: .. _dallas-getting-ids: Getting Sensor IDs ------------------- +****************** It is highly recommended to use the ``address`` attribute for creating dallas sensors, because if you have multiple sensors on a bus and the @@ -106,7 +147,6 @@ See Also -------- - :ref:`sensor-filters` -- :doc:`/components/dallas` - :doc:`max6675` - `Arduino DallasTemperature library `__ by `Miles Burton `__ - :apiref:`sensor/dallas_component.h` diff --git a/index.rst b/index.rst index 0ea317f50..8459f5e5c 100644 --- a/index.rst +++ b/index.rst @@ -252,7 +252,6 @@ Misc Components .. imgtable:: - Dallas Hub, components/dallas, dallas.jpg Remote Transmitter Hub, components/remote_transmitter, remote.svg Remote Receiver Hub, components/remote_receiver, remote.svg PCA9685 Hub, components/pca9685, pca9685.jpg