Strip RGB controlled by raspberry

Hello everyone, i’m new on this forum. I would like to know if there is a way to control a strip led RGB directly with raspberry gpio. In my configuration.yaml I put this code:

    light:
  - platform: rpi_gpio_pwm
    leds:
      - name: Lightstrip Desk
        driver: pca9685
        pins: [3, 4, 5, 6] # [R, G, B, W]
        type: rgbw

And in home assistant page I get a switch and a bar to adjust brightness, I would like to get also a color picker and some effects like fade. How can i do?

2 Likes

did u fix this problem ?

No, i used esp8266 for light controll and mqtt protocol ti interface home assistant with esp8266

Has anyone got the “driver: pca9685” working in the last couple of years? I wondering if it should be removed from the documentation. I bought a pca9685 because it looked like it was supported because of this page (https://www.home-assistant.io/integrations/rpi_gpio_pwm/) but that seems to be out-dated documentation.

I actually got this to work!

  1. switched over with the manual install on Raspbian. (was trying hassio before)
  2. added the following to configuration.yaml
    Note: I am not 100% sure if the api: is required.
api:

light:
  - platform: rpi_gpio_pwm
    leds:
      - name: Some Test Device
        driver: pca9685
        pins: [1]
        type: simple
  1. Install pwmled
    pip install pwmled

  2. Ran sudo raspi-config --> Interface Options --> Enabled I2C
    note: I did this because I was getting the error: FileNotFoundError: [Errno 2] No such file or directory: '/dev/i2c-1'

  3. followed the instructions from here
    note: The first two lines are cleanup and may not be needed.

rm pigpio.zip
sudo rm -rf PIGPIO
wget abyz.me.uk/rpi/pigpio/pigpio.zip
unzip pigpio.zip
cd PIGPIO
make
sudo make install
  1. Then from some instructions here I also ran.
    sudo pigpiod

  2. (optional) run sudo i2cdetect -y 1 and made sure you see a “40”. Then run lsmod | grep i2c and sudo i2cdetect -l and make sure they look something like the below…
    It should look something like this…

  3. Wire-up the PCA9685. I followed this by Kevin Townsend in 2019.

  4. Reboot the entire pi (not just HA)
    sudo shutdown -r now

  5. Now I see “Some Test Device” on my Home screen. When I switch it on and off I see the LED connected between GND and PWM turn on and off.

Notes

  • I’m don’t know this stuff very well. I have only been playing with my Rasp Pi for about a month.
  • Hardware: Raspberry Pi 4 Model B 4GB.
  • Device: PCA9685 12-bit PWM (same as drawing above)
  • OS: Raspbian Buster with desktop and software; Release date:2019-09-26; Kernel ver:4.19
  • Home-Assistant: Home Assistant 0.103.0
  • This was not easy to get working at all!