Code Monkey home page Code Monkey logo

sp108e_ws2815's People

Contributors

andrewostroumov avatar blind-coder avatar offbyone avatar samhstein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sp108e_ws2815's Issues

Speed settings

Hello,
could you please add support for animation speed?
Thank you!

How to Change RGB Order

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!

Stopped working after HA (hassIO) update...

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.

Not working

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.

How to use the effects

Hi!

I want to change the effects trough home assistant but i need wat help. Does anyone knows how to do this trough YAML?

Fails when I have a custom scene loaded

image

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!!

Device Changes Fail

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?

HA 2020.12.1 not sending changes

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.

  • When using the "Light" Lovelace component, when changing the effect, colour, or brightness they change in the UI, but not on the LEDs. When I close / re-open the extended info, it reverts back to the state the controller is physically set to. I.e. change to rainbow, but close and re-open and it reverts back to solid / green which is set on the controller.
  • Power toggling is instantaneous and always up to date
  • When using Developer states - I can set brightness or colour, however it does not take effect until you toggle power off/on again.

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.

Error In WifiLedShopLight update

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):

Adding this custom integration to my home assistant

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

led light

- 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?

Including device in a scene via UI doesn't change the state of the device when scene is activated

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

Flashing led strip

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.

Add while value to use controller with SK6812 RGBW

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

Bad file descriptor

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.

Support for multiple sp108e

Hello,
I am going to buy another sp108es, is there possibility to add multiple devices?
Thank you for answer!

Color not updating

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!!

Version issue in HA

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"

Config flow lagged

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.

Leds unavailable after upgrade to 2021.9.4

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? :)

Unable to prepare setup for platform sp108e_ws2815.light

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)).

Changing effect in HA Automation not working

I am trying to change color effect in automation and it is not working, only brightness changes. Any idea?

  • id: '1615791873421'
    alias: Automatizace kuchyn podsviceni zapnout
    description: ''
    trigger:
    • platform: sun
      event: sunset
      condition: []
      action:
    • type: turn_on
      device_id: 5609b13d8195cc33830ae068eeb10ec3
      entity_id: switch.kuchyn_podsviceni_led_e8db84c66253
      domain: switch
    • service: light.turn_on
      data:
      brightness_pct: 80
      effect: Rainbow
      target:
      entity_id: light.kuchyne_podsviceni_sp108e
      mode: single**
      obrazek

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.