From 9ab25268854f8694c390c74f918eab1fb139428b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 22 Apr 2017 10:52:21 +0200 Subject: [PATCH] Split configuration sample --- .../_components/light.rpi_gpio_pwm.markdown | 74 ++++++++++++------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/source/_components/light.rpi_gpio_pwm.markdown b/source/_components/light.rpi_gpio_pwm.markdown index 157e201c7db..ae78023b51a 100644 --- a/source/_components/light.rpi_gpio_pwm.markdown +++ b/source/_components/light.rpi_gpio_pwm.markdown @@ -1,7 +1,7 @@ --- layout: page title: "PWM LED" -description: "Instructions on how to setup pwm leds within Home Assistant." +description: "Instructions on how to setup PWM LEDs within Home Assistant." date: 2017-04-04 13:00 sidebar: true layout: page @@ -11,40 +11,64 @@ footer: true ha_category: Light ha_iot_class: "Local Push" ha_release: 0.43 +logo: raspberry-pi.png --- -The `rpi_gpio_pwm` platform allows to control multiple lights using pulse-width modulation, for example led strips. It supports one-color, RGB and RGBW leds driven by GPIOs of an Raspberry Pi or a PCA9685 controller. +The `rpi_gpio_pwm` platform allows to control multiple lights using pulse-width modulation, for example led strips. It supports one-color, RGB and RGBW LEDs driven by GPIOs of a Raspberry Pi or a PCA9685 controller. -### {% linkable_title Configuration %} +To enable this platform, add the following lines to your `configuration.yaml`: ```yaml # Example configuration.yaml entry light: - platform: rpi_gpio_pwm - leds: - # One-color led directly connected to GPIO - - name: Lightstrip Cupboard - driver: gpio - pins: [17] - type: simple - # RGB led connected to PCA9685 controller - - name: TV Backlight - driver: pca9685 - pins: [0, 1, 2] # [R, G, B] - type: rgb - # RGBW led connected to PCA9685 controller - - name: Lightstrip Desk - driver: pca9685 - pins: [3, 4, 5, 6] # [R, G, B, W] - type: rgbw + - platform: rpi_gpio_pwm + leds: + - name: Lightstrip Cupboard + driver: gpio + pins: [17] + type: simple ``` Configuration variables: -- **leds** array (*Required*): - - **name** (*Required*): The name of the led. - - **driver** (*Required*): The driver, which controls the led. Choose either `gpio` or `pca9685`. - - **pins** (*Required*): The pins connected to the led. The order of pins is determined by the specified type. - - **type** (*Required*): The type of led. Choose either `rgb`, `rgbw` or `simple`. +- **leds** array (*Required*): Can contain multiple LEDs. + - **name** (*Required*): The name of the LED. + - **driver** (*Required*): The driver which controls the LED. Choose either `gpio` or `pca9685`. + - **pins** (*Required*): The pins connected to the LED as a list.. The order of pins is determined by the specified type. + - **type** (*Required*): The type of LED. Choose either `rgb`, `rgbw` or `simple`. - **freq** (*Optional*): The PWM frequency. (Default: `200`) - **address** (*Optional*): The address of the PCA9685 driver. (Default: `0x40`) + +## {% linkable_title Examples %} + +In this section you find some real life examples of how to use this sensor. + +### {% linkable_title RGB LED connected to PCA9685 controller %} + +This example uses a [PCA9685 controller](http://www.nxp.com/products/interfaces/ic-bus-portfolio/ic-led-display-control/16-channel-12-bit-pwm-fm-plus-ic-bus-led-controller:PCA9685) to control a RGB LED. + +```yaml +# Example configuration.yaml entry +light: + - platform: rpi_gpio_pwm + leds: + - name: TV Backlight + driver: pca9685 + pins: [0, 1, 2] # [R, G, B] + type: rgb +``` + +### {% linkable_title RGBW LED connected to PCA9685 controller %} + +This example uses a [PCA9685 controller](http://www.nxp.com/products/interfaces/ic-bus-portfolio/ic-led-display-control/16-channel-12-bit-pwm-fm-plus-ic-bus-led-controller:PCA9685) to interact with a RGBW LED. + +```yaml +# Example configuration.yaml entry +light: + - platform: rpi_gpio_pwm + leds: + - name: Lightstrip Desk + driver: pca9685 + pins: [3, 4, 5, 6] # [R, G, B, W] + type: rgbw +```