How to use the PWM LED component in hassio

Count me in.

I’m still having the same issue in HA 0.87.0 and now HassOS 2.8. There’s still currently no way that I know to check if pigpio is running, or how to start the daemon in Hass at startup. I have a single RGB led connected to the gpio of the same Pi running HA. Can’t control it as a light. Really hoping a solution surfaces soon.

Got the same error on 0.88.2.

I trying to use the rpi_gpio_pwm platform but it doesn’t working. Can I use with Hass.io?
Thanks

Having the same issue… Any fix for using it on Hassio?

The same issue. Nobody knows answer? Thank you.

Error doing job: Task exception was never retrieved

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 363, in _async_add_entity
await entity.async_added_to_hass()
File “/usr/src/homeassistant/homeassistant/components/rpi_gpio_pwm/light.py”, line 179, in async_added_to_hass
await super().async_added_to_hass()
File “/usr/src/homeassistant/homeassistant/components/rpi_gpio_pwm/light.py”, line 111, in async_added_to_hass
brightness=_from_hass_brightness(self._brightness))
File “/usr/local/lib/python3.7/site-packages/pwmled/led/rgb.py”, line 55, in set
super().set(is_on, brightness, cancel_transition=False)
File “/usr/local/lib/python3.7/site-packages/pwmled/led/init.py”, line 76, in set
self._update_pwm()
File “/usr/local/lib/python3.7/site-packages/pwmled/led/init.py”, line 85, in _update_pwm
self._driver.set_pwm(values)
File “/usr/local/lib/python3.7/site-packages/pwmled/driver/init.py”, line 52, in set_pwm
self._set_pwm(self._to_raw_pwm(values))
File “/usr/local/lib/python3.7/site-packages/pwmled/driver/gpio.py”, line 30, in _set_pwm
self._pi.set_PWM_dutycycle(self._pins[i], raw_values[i])
File “/usr/local/lib/python3.7/site-packages/pigpio.py”, line 1396, in set_PWM_dutycycle
self.sl, _PI_CMD_PWM, user_gpio, int(dutycycle)))
File “/usr/local/lib/python3.7/site-packages/pigpio.py”, line 977, in _pigpio_command
sl.s.send(struct.pack(‘IIII’, cmd, p1, p2, 0))
AttributeError: ‘NoneType’ object has no attribute ‘send’

I don’t know what error I got, because I haven’t looked at logs. However RPI GPIO PWM was not working with me too, but it the pigpiod daemon not running.

Check if it running with “pigs t” command.

installed it to run at startup with:

sudo systemctl enable pigpiod

Then reboot and you will see the pwm lights. Hope this helps.

I also had this problem and implemented a hass.io addon, which contains the pwm access with pigpid running inside.

Code + Plugin: https://github.com/Poeschl/Hassio-Addons/tree/master/pigpio
Install the repository as Addon-Source, install pigpid Addon and use the default Homeassistant component.

4 Likes

HI There,

I’m new to HA. And I do not get How things work. Can somebody help me?
I was enable to get SSH working and log in to HASSOS. But i can not for example give the pigs t command. it results in a “command not found” same for sudo and even apt commands fail.

What am I missing here?

Are you ssh’ing over the hassio addon? If so, you are not on the real host. Your are inside the docker container of the addon.

To access the host os you have to setup the debug ssh access. See following thread for help: How to get access at damn host system?

OMG!! Now I understand! I’m very sorry for this stupid question. Thanks for clearing that up!

For all who are not getting to install pigpio, this is what I did to get the addon working
In Supervisor>addon store select repositories
Add this url https://github.com/Poeschl/Hassos-Addons
And press add. After the spinner is completed get to the addon store and search for pigpio. This will bring up this addon for instal and then you start this.
Now reboot and you will not get any log of error of pwmled.

1 Like

MY LIGHTS ARE WORKING!!!

For anyone else struggling to get PWMled component working on HASSOS here’s how I got mine working. Karansoi was correct in instructing us to install Markus Pöschl’s repository but gave the wrong URL. The correct URL is https://github.com/Poeschl/Hassio-Addons. Go to the supervisor section of your homeassistant UI and click on the addon store tab. There is a three dot icon on the top right of the screen, click that. Select repositories from the drop down menu. Paste the Poeschi URL into the pop up box where it says add repository then click add. Wait a minute or two. Once the new repository appears close the pop up. Scroll down to the bottom of the addon store page and you’ll see all of Poeschl’s Home Assistant Add-ons. Click on pigpio. Click on install. wait for the install to finish before restarting HASS. All my PWM lights magically appeared! Thank you so much for pointing me in the right direction Karansoi.

1 Like

Good that you got your pwmled working.
Thanks for letting me know my typo error in the url.
BTW my system is giving a log that pwmeld is deprecated and that to modify the light simplepwmled. Are you getting such log.

thanks @brode and @Whiskey, for correcting my post in respect of the url.
Cheers…

I have noticed the same error. Light is depreciated and pwnled should be using lightentity instead. I read a little into it and I discovered that users where experiencing lag and malfunctions with Philips hue hubs due to too many “on” commands being sent by service calls. “On” commands take longer for hue hubs to process than other commands so when not strictly necessary should be dropped from the service call. This isn’t possible with the current Light call. The fix was to introduce Lightentity. As this didn’t seem to affect my setup I’m happy to ignore this error for now. I have no plans to use Philips hue.

Edit: If someone knows how to update PWMled component with Lightentity that would be great. I have no idea how to do that :disappointed_relieved:

This error log has gone off perhaps over updates in the hassos etc…
I happened to ask if you got a similar log too?

I did notice the error after installing the add on. Just checked now after updating HASSOS and supervisor and I can’t see the error in the system logs. Just noticed there is an update for pigpio add on so I’m installing that update now. Will reboot the pi and check logs again. I’ll let you know if I spot anything in the logs once it’s back online.

Looks like the error is fixed in the latest release :+1:

Officials say esphone management is recommended