Skip to content

Commit 9ab2526

Browse files
committed
Split configuration sample
1 parent 598447a commit 9ab2526

File tree

1 file changed

+49
-25
lines changed

1 file changed

+49
-25
lines changed
Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
33
title: "PWM LED"
4-
description: "Instructions on how to setup pwm leds within Home Assistant."
4+
description: "Instructions on how to setup PWM LEDs within Home Assistant."
55
date: 2017-04-04 13:00
66
sidebar: true
77
layout: page
@@ -11,40 +11,64 @@ footer: true
1111
ha_category: Light
1212
ha_iot_class: "Local Push"
1313
ha_release: 0.43
14+
logo: raspberry-pi.png
1415
---
1516

16-
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.
17+
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.
1718

18-
### {% linkable_title Configuration %}
19+
To enable this platform, add the following lines to your `configuration.yaml`:
1920

2021
```yaml
2122
# Example configuration.yaml entry
2223
light:
23-
platform: rpi_gpio_pwm
24-
leds:
25-
# One-color led directly connected to GPIO
26-
- name: Lightstrip Cupboard
27-
driver: gpio
28-
pins: [17]
29-
type: simple
30-
# RGB led connected to PCA9685 controller
31-
- name: TV Backlight
32-
driver: pca9685
33-
pins: [0, 1, 2] # [R, G, B]
34-
type: rgb
35-
# RGBW led connected to PCA9685 controller
36-
- name: Lightstrip Desk
37-
driver: pca9685
38-
pins: [3, 4, 5, 6] # [R, G, B, W]
39-
type: rgbw
24+
- platform: rpi_gpio_pwm
25+
leds:
26+
- name: Lightstrip Cupboard
27+
driver: gpio
28+
pins: [17]
29+
type: simple
4030
```
4131
4232
Configuration variables:
4333
44-
- **leds** array (*Required*):
45-
- **name** (*Required*): The name of the led.
46-
- **driver** (*Required*): The driver, which controls the led. Choose either `gpio` or `pca9685`.
47-
- **pins** (*Required*): The pins connected to the led. The order of pins is determined by the specified type.
48-
- **type** (*Required*): The type of led. Choose either `rgb`, `rgbw` or `simple`.
34+
- **leds** array (*Required*): Can contain multiple LEDs.
35+
- **name** (*Required*): The name of the LED.
36+
- **driver** (*Required*): The driver which controls the LED. Choose either `gpio` or `pca9685`.
37+
- **pins** (*Required*): The pins connected to the LED as a list.. The order of pins is determined by the specified type.
38+
- **type** (*Required*): The type of LED. Choose either `rgb`, `rgbw` or `simple`.
4939
- **freq** (*Optional*): The PWM frequency. (Default: `200`)
5040
- **address** (*Optional*): The address of the PCA9685 driver. (Default: `0x40`)
41+
42+
## {% linkable_title Examples %}
43+
44+
In this section you find some real life examples of how to use this sensor.
45+
46+
### {% linkable_title RGB LED connected to PCA9685 controller %}
47+
48+
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.
49+
50+
```yaml
51+
# Example configuration.yaml entry
52+
light:
53+
- platform: rpi_gpio_pwm
54+
leds:
55+
- name: TV Backlight
56+
driver: pca9685
57+
pins: [0, 1, 2] # [R, G, B]
58+
type: rgb
59+
```
60+
61+
### {% linkable_title RGBW LED connected to PCA9685 controller %}
62+
63+
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.
64+
65+
```yaml
66+
# Example configuration.yaml entry
67+
light:
68+
- platform: rpi_gpio_pwm
69+
leds:
70+
- name: Lightstrip Desk
71+
driver: pca9685
72+
pins: [3, 4, 5, 6] # [R, G, B, W]
73+
type: rgbw
74+
```

0 commit comments

Comments
 (0)