samhstein / sp108e_ws2815 Goto Github PK
View Code? Open in Web Editor NEWhome assistant sp108e with ws2815 integration
home assistant sp108e with ws2815 integration
Hello!
Im on the config-flow branch, and ive added the config to the custom_components directory. But i dont see anything new in the integrations pannel in the gui, any ideas on what to try next? Thanks so much!
Hello,
could you please add support for animation speed?
Thank you!
I have SK2812 RGB WW but I don't know where I can change the RGB order. Currently Green is Blue, but on the LED Shop it's working fine with GRB.
Do I need to change anything in the package to get this working?
Everything is working, just the colours are off.
Thanks!
Hi, I've been using your "flow" version of this for some time now.
But since a couple of HA updates back it's not working anymore.
I'm running:
Core Version core-2022.2.8
Supervisor Version supervisor-2022.01.1
Does anyone else have an issue?
Both my "led-controllers" are unavailable in HA.
I'm sorry. I have SP108E V2. It is working with LED shop application. I've been tried to add all 10 files into folder to HA and add into config these lines
# led strip
light:
- platform: sp108e_ws2815
host: 192.168.15.162
name: 'sp108e_01'
- platform: sp108e_ws2815
host: 192.168.15.252
name: 'sp108e_02'
But it doesn't work. I couldn't find any light.sp10e_01/2.
Hi!
I want to change the effects trough home assistant but i need wat help. Does anyone knows how to do this trough YAML?
Whenever I have one of the 12 custom recorded scenes from the 3rd tab in the app loaded up then the integration fails to load. If I change it to a standard scene like rainbow and reload the integration then it works but then I change it to a custom scene and it gives me this error when turning the light on (yet it does actually turn it on). Custom scene 1 in my screenshot gives me "Failed to call service light/turn_on. 219 is not in list." Is there anyway to fix this because those custom recorded scenes are really the ultimate best part about the sp108e. Thanks for the great work already!!
I am getting a large number of failures with devices setup in Scenes and even when trying to simply change colors or on/off state via the HA UI.
Here is the info from the log.
Logger: homeassistant.helpers.entity
Source: custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py:193
Integration: sp108e_ws2815
First occurred: April 2, 2023 at 12:45:12 AM (13 occurrences)
Last logged: 11:01:19 AM
Update for light.pool_room_lights_1 fails
Update for light.stair_lights_2 fails
Update for light.tv_room_main_lights fails
Update for light.office_north_lights fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 541, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 739, in async_device_update
raise exc
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 211, in update
response = self.send_command(Command.SYNC, [])
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 193, in send_command
self._sock.connect((self._ip, self._port))
TimeoutError: timed out
Any Suggestions on how to resolve these failures?
Hey Sam!
I'm having an issue where HA 2012.12.1 is not sending any updates / changes to the SP108e, however can see incoming state changes when being togged via the "LED shop" app. What version did you have this working on?
I've tried turning up debug logging but not seeing anything for the component.
I've plenty of other lights which work just fine - seems to be just this custom component I'm having issues with. Appreciate any thoughts or things to check!
As a side, I did also try an older revision before the 'white support' was added but did not seem to make a difference.
I receive this error occasionally in the HA logs:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 658, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 214, in update
state = bytearray(response)
TypeError: cannot convert 'NoneType' object to bytearray
This is due to the retry logic in WifiLedShopLight::send_command. The code will return None if the first time it tries to send the command if it fails. Checking the result variable (only if there should be a result - SYNC or GET_ID) before returning it will get the behavior expected (because the code throws an exception above if the number of attempts exceeds max). Also, need to move the socket creation inside the try block because the exception block closes the socket. Here is the diff:
diff --git a/pyledshop/WifiLedShopLight.py b/pyledshop/WifiLedShopLight.py
index cc396fa..5171477 100644
--- a/pyledshop/WifiLedShopLight.py
+++ b/pyledshop/WifiLedShopLight.py
@@ -184,10 +184,10 @@ class WifiLedShopLight(LightEntity):
padded_data = data + [0] * (min_data_len - len(data))
raw_data = [CommandFlag.START, *padded_data, command, CommandFlag.END]
attempts = 0
- self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self._sock.settimeout(self._timeout)
while True:
try:
+ self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self._sock.settimeout(self._timeout)
self._sock.connect((self._ip, self._port))
self._sock.sendall(bytes(raw_data))
if command == command.GET_ID or command == command.SYNC:
@@ -206,7 +206,8 @@ class WifiLedShopLight(LightEntity):
print('break', command)
raise
- return result
+ if not (command == command.GET_ID or command == command.SYNC) or result:
+ return result
def update(self):
Hello,
I'm a complete newbie to Home Assistant and Linux in general. I'm trying to set a connection to the LED strip controller with this custom integration.
I have downloaded all the files from config-flow and put them in config/custom_components/sp108e_ws2815.
I added
- platform: sp_108e_ws2815
host: 10.0.0.6
name: 'LED Shop'
in configuration.YAML, checked it and restarted.
But I cannot figure out how to add this custom integration now. It doesn't show up anywhere. What am I missing?
I'm using the config-flow branch
In the scene UI, if you create a scene and add the sp108e device and set it to be "on" (for example), the when the scene is turned on, the device will not turn on.
Following troubleshooting tips from the community forums, if I edit the scene.yaml manually and delete everything under the device except for "state: on", it will then work. It seems the UI will capture all of the state of the device and put it in scene.yaml.
I've seen this for other devices as well, and they seem to handle this okay, so I wonder if the library is getting confused when scene.turn_on sends all of the state
No 'version' key in the manifest file for custom integration 'sp108e_ws2815'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'sp108e_ws2815'
As soon as I enable this component in HA, the led strip starts flashing by briefly turning off and then on again within half a second or so. This happens around once per minut until I disable the plugin. Most noticeable in static mode.
Have the same Problem
Originally posted by @S7EN in #21 (comment)
Hi, after upgrade from core 6.5 it's not working. Thank you so much.
Hello there, I've found your perfect component here and It really works for me but unfortunately it doesn't have while value support. So could you please add this? If only I can python I make a PR but my scope is golang / ruby
I am encountering this flaky behavior about 80% of the time I try to trigger some change of color or effect on my sp108 controlling a ws2812:
Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py:193
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 1:56:36 PM (7 occurrences)
Last logged: 2:02:56 PM
[546660337600] [Errno 9] Bad file descriptor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 580, in async_handle_light_on_service
await light.async_turn_on(**filter_turn_on_params(light, params))
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1255, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 142, in turn_on
self.toggle()
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 120, in toggle
self.toggle()
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 120, in toggle
self.toggle()
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 120, in toggle
self.toggle()
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 116, in toggle
self.send_command(Command.TOGGLE, [])
File "/config/custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py", line 193, in send_command
self._sock.connect((self._ip, self._port))
OSError: [Errno 9] Bad file descriptor
This also causes the controller to freeze out and lose connectivity apparently.
Hello,
I am going to buy another sp108es, is there possibility to add multiple devices?
Thank you for answer!
hi,
I have a WS2811 + sp108e
I just configured the integration (via branch config-flow
) into home assistant and everything connected great.
However when I try to set a color it doesn't do anything, sometimes the picker just returns to original color.
Working from the LED Shop
app it sets the color correctly + it updates in home assistant.
Adjusting the brightness and effects works.
Am I doing something wrong? or am I missing something?
All help greatly appreciated!!
Latest HA gives this message: "No 'version' key in the manifest file for custom integration 'sp108e_ws2815'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'sp108e_ws2815"
With Master branch I can do multiple color changes during 10 seconds. With config-flow version I can do barerly 1-2 changes per 10 seconds. Seems Config flow reacts very slow. When I choose Rainbow in option list and I go back to solid, I have to repeat it multiple times to make it work finaly.
Thanks for fixing it.
Hi! After upgrading to Home Assistant 2021.9.x the led-strips (both of them) just shows "unavailable"...
It has been working until now. I have not changed anything else as far as I know. The "integration" is still there and the "entities" they are just "unavailable"...
Any ideas? :)
Hi @samhstein
since the last updates of HASS I have problems connecting to my SP108.
Thanks for your support
Vic
Home Assistant 2022.9.1
Supervisor 2022.08.6
Operating System 8.5
Frontend 20220907.0 - latest
Logger: homeassistant.setup
Source: setup.py:320
First occurred: 21:45:47 (1 occurrences)
Last logged: 21:45:47
Unable to prepare setup for platform sp108e_ws2815.light: Platform not found (cannot import name 'ATTR_WHITE_VALUE' from 'homeassistant.components.light' (/usr/src/homeassistant/homeassistant/components/light/init.py)).
Entity None (<class 'custom_components.sp108e_ws2815.pyledshop.WifiLedShopLight.WifiLedShopLight'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature.EFFECT|17: 21> and color modes, please report it to the author of the 'sp108e_ws2815' custom integration and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
I am trying to change color effect in automation and it is not working, only brightness changes. Any idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.