From f47c2f98ecf2204aaf10914a1879d48f16350667 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Sun, 7 Apr 2019 04:53:11 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9C=20Merges/Redirects=20Arduino=20com?= =?UTF-8?q?ponent=20pages=20(#9164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🚜 Merges/Redirects Arduino component pages * :pencil2: Tweak --- source/_components/arduino.markdown | 96 +++++++++++++++++++++- source/_components/sensor.arduino.markdown | 49 ----------- source/_components/switch.arduino.markdown | 60 -------------- 3 files changed, 95 insertions(+), 110 deletions(-) delete mode 100644 source/_components/sensor.arduino.markdown delete mode 100644 source/_components/switch.arduino.markdown diff --git a/source/_components/arduino.markdown b/source/_components/arduino.markdown index d14cff62b29..99730e999c1 100644 --- a/source/_components/arduino.markdown +++ b/source/_components/arduino.markdown @@ -8,10 +8,16 @@ comments: false sharing: true footer: true logo: arduino.png -ha_category: DIY +ha_category: + - DIY + - Sensor + - Switch featured: true ha_release: pre 0.7 ha_iot_class: Local Polling +redirect_from: + - /components/sensor.arduino/ + - /components/switch.arduino/ --- The [Arduino](https://www.arduino.cc/) device family are microcontroller boards that are often based on the ATmega328 chip. They come with digital input/output pins (some can be used as PWM outputs), analog inputs, and a USB connection. @@ -21,6 +27,11 @@ There are a lot of extensions (so-called [shields](https://www.arduino.cc/en/Mai The `arduino` component is designed to let you use a directly attached board to your Home Assistant host over USB. +There is currently support for the following device types within Home Assistant: + +- [Sensor](#sensor) +- [Switch](#switch) + ## {% linkable_title Configuration %} You need to have the [Firmata firmware](https://github.com/firmata/) on your board. Please upload the `StandardFirmata` sketch to your board; please refer to the [Arduino documentation](https://www.arduino.cc/en/Main/Howto) for further information. @@ -57,3 +68,86 @@ Add the user who is used to run Home Assistant to the groups to allow access to ```bash $ sudo usermod -a -G dialout,lock $USER ``` + +## {% linkable_title Sensor %} + +The `arduino` sensor platform allows you to get numerical values from an analog input pin of an [Arduino](https://www.arduino.cc/) board. Usually the value is between 0 and 1024. + +To enable an Arduino sensor with Home Assistant, add the following section to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +sensor: + platform: arduino + pins: + 1: + name: Door switch + 0: + name: Brightness +``` + +{% configuration %} +pins: + description: List of pins to use. + required: true + type: map + keys: + pin_number: + description: The pin number that corresponds with the pin numbering schema of your board. + required: true + type: map + keys: + name: + default: Name that will be used in the frontend for the pin. + type: string +{% endconfiguration %} + +The 6 analog pins of an Arduino UNO are numbered from A0 to A5. + +## {% linkable_title Switch %} + +The `arduino` switch platform allows you to control the digital pins of your [Arduino](https://www.arduino.cc/) board. Support for switching pins is limited to high/on and low/off of the digital pins. PWM (pin 3, 5, 6, 9, 10, and 11 on an Arduino Uno) is not supported yet. + +To enable the Arduino pins with Home Assistant, add the following section to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +switch: + platform: arduino + pins: + 11: + name: Fan Office + 12: + name: Light Desk + initial: true + negate: true +``` + +{% configuration %} +pins: + description: List of of pins to use. + required: true + type: map + keys: + pin_number: + description: The pin number that corresponds with the pin numbering schema of your board. + required: true + type: map + keys: + name: + default: Name that will be used in the frontend for the pin. + type: string + required: false + initial: + default: The initial value for this port. + type: boolean + required: false + default: false + negate: + default: If this pin should be inverted. + type: boolean + required: false + default: false +{% endconfiguration %} + +The digital pins are numbered from 0 to 13 on a Arduino UNO. The available pins are 2 till 13. For testing purposes you can use pin 13 because with that pin you can control the internal LED. diff --git a/source/_components/sensor.arduino.markdown b/source/_components/sensor.arduino.markdown deleted file mode 100644 index 93978e4a3b9..00000000000 --- a/source/_components/sensor.arduino.markdown +++ /dev/null @@ -1,49 +0,0 @@ ---- -layout: page -title: "Arduino Sensor" -description: "Instructions on how to integrate Arduino boards pins as sensors within Home Assistant." -date: 2015-09-14 18:28 -sidebar: true -comments: false -sharing: true -footer: true -logo: arduino.png -ha_category: DIY -ha_release: pre 0.7 -ha_iot_class: Local Polling ---- - - -The `arduino` sensor platform allows you to get numerical values from an analog input pin of an [Arduino](https://www.arduino.cc/) board. Usually the value is between 0 and 1024. - -To enable an Arduino sensor with Home Assistant, add the following section to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -sensor: - platform: arduino - pins: - 1: - name: Door switch - 0: - name: Brightness -``` - -{% configuration %} -pins: - description: List of pins to use. - required: true - type: map - keys: - pin_number: - description: The pin number that corresponds with the pin numbering schema of your board. - required: true - type: map - keys: - name: - default: Name that will be used in the frontend for the pin. - type: string -{% endconfiguration %} - -The 6 analog pins of an Arduino UNO are numbered from A0 to A5. - diff --git a/source/_components/switch.arduino.markdown b/source/_components/switch.arduino.markdown deleted file mode 100644 index d78b535d4d8..00000000000 --- a/source/_components/switch.arduino.markdown +++ /dev/null @@ -1,60 +0,0 @@ ---- -layout: page -title: "Arduino Switch" -description: "Instructions on how to integrate Arduino boards pins as switches within Home Assistant." -date: 2015-09-14 18:28 -sidebar: true -comments: false -sharing: true -footer: true -logo: arduino.png -ha_category: DIY -ha_release: pre 0.7 -ha_iot_class: Local Polling ---- - -The `arduino` switch platform allows you to control the digital pins of your [Arduino](https://www.arduino.cc/) board. Support for switching pins is limited to high/on and low/off of the digital pins. PWM (pin 3, 5, 6, 9, 10, and 11 on an Arduino Uno) is not supported yet. - -To enable the Arduino pins with Home Assistant, add the following section to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -switch: - platform: arduino - pins: - 11: - name: Fan Office - 12: - name: Light Desk - initial: true - negate: true -``` - -{% configuration %} -pins: - description: List of of pins to use. - required: true - type: map - keys: - pin_number: - description: The pin number that corresponds with the pin numbering schema of your board. - required: true - type: map - keys: - name: - default: Name that will be used in the frontend for the pin. - type: string - required: false - initial: - default: The initial value for this port. - type: boolean - required: false - default: false - negate: - default: If this pin should be inverted. - type: boolean - required: false - default: false -{% endconfiguration %} - -The digital pins are numbered from 0 to 13 on a Arduino UNO. The available pins are 2 till 13. For testing purposes you can use pin 13 because with that pin you can control the internal LED.