home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.17k stars 30.2k forks source link

limitlessled doesn't work as expected with 1.1.2 (homeassistant 0.75.1) #15844

Closed andrei-radulescu closed 5 years ago

andrei-radulescu commented 6 years ago

Last working Home Assistant release (if known): 0.75.0

Operating environment (Hass.io/Docker/Windows/etc.):

Component/platform: limitlessled with the version limitlessled version 1.1.2

Description of problem: In case of scenes the pipe is not working as expected and doesn't fulfill all the repeats (by default 3 as described in init.py). Thus not all lights change or receive all the commands (in the pipeline). With 1.1.0 everything worked as expected. Check the simple yaml below which used to work before. My bridge is v6.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

- name: living room relax ambient
  entities:
    light.tv_back_light:
      state: on
      rgb_color: [255, 73, 105]
      brightness: 255
      transition: 1
    light.couch_light:
      state: on
      brightness: 255
      rgb_color: [250, 0, 0]
      transition: 1
    light.living_room_table_light:
      state: on
      brightness: 140
      color_temp: 350
    light.living_room_light_1:
      state: on
      brightness: 200
      rgb_color: [178, 102, 255]
      transition: 1
    light.living_room_light_2:
      state: on
      brightness: 170
      rgb_color: [122, 204, 255]
      transition: 1
    light.living_room_bar_light:
      state: on
      brightness: 150
      color_temp: 290
    light.living_room_ambient_1:
      state: on
      brightness: 180
      rgb_color: [255, 170, 117]
      transition: 1
    light.living_room_ambient_2:
      state: on
      brightness: 220
      #rgb_color: [255, 255, 255]
      color_temp: 250
      transition: 1
    light.balcony_light:
      state: on
      brightness: 255
#      color_name: white
    light.hallway_light:
      state: on
      brightness: 140
      transition: 1
      rgb_color: [178, 102, 255]
    script.start_media_center_with_delay:
      state: on
    input_boolean.lights_always_on:
      state: on
# other dep components/scripts
    group.living_fluxer:
      state: off
    script.welcome_home_evening_script_turn_off_other_lights:
      state: off

-> the transitions don't work anymore. Some bulb don't change (even from the same group) For example in this particular case light.living_room_light_1 & 2, light.living_room_bar_light groups. Traceback (if applicable):

Additional information: I reverted to 1.1.0 by installing it with pip -I and changed it in components/light/limitlessled.py and now everything works as expected

ash-vd commented 6 years ago

Hm, this could be the problem why some Limitless-bulbs I have don't switch on anymore. When I retrigger the automation (or just switch the bulb manually) it does work.

amelchio commented 6 years ago

Please add your light: configuration.

andrei-radulescu commented 6 years ago
 platform: limitlessled
  bridges:
  - host: 192.168.2.15 #tv bridge
    groups:
    - number: 1
      name: TV back light
      type: bridge-led
      fade: on
    - number: 1
      name: Living room ambient 1
      type: rgbww
      fade: on
    - number: 2
      name: Living room ambient 2
      type: rgbww
      fade: on  

  - host: 192.168.2.16 # couch bridge
    groups:
    - number: 1
      name: hallway light
      type: bridge-led
      fade: on
    - number: 1
      name: Dorm light
      type: rgbww
      fade: on
    - number: 2
      name: Living room bar light 
      type: rgbww
    - number: 3
      name: Living room table light
      type: rgbww
      fade: on

  - host: 192.168.2.17 # hallway bridge
    groups:
    - number: 1
      name: couch light
      type: bridge-led
      fade: on
    - number: 1
      name: Living room light 1
      type: rgbww
    - number: 2
      name: Living room light 2
      type: rgbww
    - number: 3
      name: Balcony light
      type: rgbww
      fade: on
amelchio commented 6 years ago

Okay, so you have three bridges? I only have one so I cannot imitate your setup :-/

The sending has been optimized in limitlessled 1.1.2, I wonder if it is now so tight that the bridges create radio pollution for each other. I can make a fix addressing this theory if you are willing to test it.

@ashwinvandijk If you are not sure that your problem is the same, please create a separate issue with your configuration included and tag me.

andrei-radulescu commented 6 years ago

@amelchio -> it could be the problem. I can try the fix out.

idfxken commented 6 years ago

Have the same issue, with only one v6 bridge. Some lights in even the same group dont respond every time anymore Have to run a loop timer in node-red to activate the same scenes twice, so that all lights respond.

amelchio commented 6 years ago

@icewind325 That turned out to be harder than expected so I have no fix to test yet.

@idfxken Please add an example scene: configuration with the issue.

To be clear, this issue only happens with scenes and never for single actions?

idfxken commented 6 years ago

@amelchio, its not just with scenes but also with e.g. 'group.lights_living' to off/color/full/... from within node-red/script/... (this used to work fine before 0.75 i think, haven't rly had time the last weeks )

scenes.yaml:
- name: Movie Lighting
  entities:
    light.tvmeubel: 
      state: on
      rgb_color: [10,0,250] 
      brightness: 200
    light.living:
      state: on
      rgb_color: [255,200,182]
      brightness: 20
    light.salon:
      state: on
      rgb_color: [255,200,182]
      brightness: 20

- name: Normal Lighting
  entities:
    light.living:
      state: on
      brightness: 150
      kelvin: 2700
    light.salon:
      state: on
      brightness: 150
      kelvin: 2700
    light.tvmeubel:
      state: off
amelchio commented 6 years ago

I have managed to reproduce the issue now.

To test a possible fix, copy this file to \<config>/custom_components/light/limitlessled.py and restart Home Assistant. Remember to remove the file again after the test.

andrei-radulescu commented 6 years ago

Thanks but your limitlessled dependency cannot be resolved -> 502 bad gateway

amelchio commented 6 years ago

It works for me so I think you might have a local network issue.

idfxken commented 6 years ago

Works for me, looks like you increased the delays between broadcasts quite a bit :) This seems to have fixed issues for me, tried it around 20 mins switching between scenes, groups, nodered triggers etc. All is working as expected here, you could possibly decrease the delay a little if you want to try it.

amelchio commented 6 years ago

Thanks for testing!

Right, I slowed it down so the bulbs will not overload and miss random messages. Do you notice any ill effects from the slowdown? (it should still be faster than 0.74)

idfxken commented 6 years ago

Nope, even transitions/fade were working back as normal

andrei-radulescu commented 6 years ago

ok, everything works. Must have been indeed a networking issue. Maybe to decrease the delay a little like @idfxken suggest would do the trick.

amelchio commented 6 years ago

Which trick? Do you see some problems with the delay?

Did the change fix your issue or does "everything works" just mean that you got it installed?

andrei-radulescu commented 6 years ago

By everything works, i meant that i installed it and tested it successfully. The scenes and transitions work. The delay isn't having adverse effects on my combos. I thought, by speeding it up a little to get to the best possible compromise. Thanks for the effort 👍

amelchio commented 6 years ago

I did try several values and the current one is already a compromise :-)

Thanks for verifying the fix, I hope to get it into 0.76.

andrei-radulescu commented 6 years ago

Hi @amelchio . I noticed a problem which I think is caused by the introduced delay and affects the pipeline of commands. When the colorloop effect is started for one or more light groups (different bridges) and runs for some time, the commands stack as they are executed with a delay. This is not noticeable during this mode as the color changes and fades but as time passes more and more commands stack. When you want to turn off those lights the command won't get executed until the stacked commands run. In fact if the colorloop did run for a prolonged period of time, the only mode to clear the pipeline so the effect stops is to restart hass, or you won't get the control back. Maybe the effects have to be slowed down as well. Some other idea for the core -> a process which can be stopped anytime by an event should wait if a queue limit (to be introduced) is reached.

amelchio commented 6 years ago

@icewind325 did that ever work?

andrei-radulescu commented 6 years ago

@amelchio well it works even now. Problem is the stacking of commands so you can't stop it anymore :) @idfxken - colormode is indeed integrated. But are not using the integration, we are simulating it.

amelchio commented 6 years ago

@icewind325 this issue is about a regression in Home Assistant 0.75. My question is whether your situation with the stacked commands worked any better before 0.75?

Not trying to belittle your report, just suggesting that maybe it deserves a separate ticket.

andrei-radulescu commented 6 years ago

@amelchio - no worries. I can create another ticket for this issue. Thing is, last time i used it (as a party ambient) was a couple of months ago and it worked. Maybe this effect doesn't need a simulation but the actual integrated option @idfxken was referring to.

I see that you closed the pull request, are you still testing on the issue? Thank you again for your time :)

amelchio commented 6 years ago

Yes, I am still working on the issue. Sorry that it is taking so long, it has turned out to be tricky.

To be clear, are you using the stock Home Assistant driver or did you install my custom_component mentioned above?

andrei-radulescu commented 6 years ago

right now I'm using your custom component, as hass is not usable with the stock version.

amelchio commented 6 years ago

Roger that. Since you say that it worked before 0.75, do not create a new issue after all.

dharrison8815 commented 6 years ago

@amelchio - I think I have your custom component installed correctly as I now have a pycache in the light folder, however I'm still experiencing the same issue. I also have 3 v6 bridges in very near proximity like @icewind325. It seems various bulbs are still only receiving a portion of the command but not the entire message. Any ideas?

TIA!

Here's my config and some scenes below:

Milight Patch.txt

Whole House Scenes.txt

amelchio commented 6 years ago

@dharrison8815

In the custom component, try changing the REQUIREMENTS so it just reads:

REQUIREMENTS = ['limitlessled==1.1.0']

This rolls back to the exact version used before Home Assistant 0.75 so we can check whether your problem is related to the recent changes.

dharrison8815 commented 6 years ago

Thanks @amelchio! Before I was able to test your solution, I poked around to much and broke my instance. I started with a fresh install and restore from a backup. Now back on 0.72.1 everything is happy. I've got guests visiting and many projects at work that will delay me being able to update and test for another 10 days or so. Thanks for your help!

amelchio commented 6 years ago

Glad you got it worked out.

Is the custom component still working for others? I updated it some days ago so you should restart Home Assistant to get the most recent version.

andrei-radulescu commented 6 years ago

@amelchio. Hmm dunno if it was with the update, but I experienced another "freeze" of some lights in a group when activating a scene (scene similar to description). By repeating the scene every bulb of the group changed accordingly. I need to see if this repeats.

amelchio commented 6 years ago

If it only happened once it could be some other fluke.

BTW, my update should have fixed the colorloop problem.

andrei-radulescu commented 6 years ago

regarding colerloop, that's awesome, thanks again. I'll give it a try

andrei-radulescu commented 6 years ago

@amelchio Hi. Regarding my previous report it's not a fluke. I had more time to test and it happens repeatedly under the same conditions. Not all bulbs (even in the same group) respond if multiple groups are triggered during a scene. It's less frequent in comparison to the beginning but still in 1 out of 3 tries the issue occurs.

amelchio commented 6 years ago

This does not happen at all with limitlessled 1.1.0?

andrei-radulescu commented 6 years ago

i just reverted it to 1.1.0 and it looks good. But i also reverted it back to 'https://github.com/amelchio/python-limitlessled/archive/v6-ack-throttle.zip#limitlessled==99' and this also works. Did you change something on the way? I will test some more with both libs.

amelchio commented 5 years ago

Yes, I made further changes because the initial fix did not solve the colorloop problem.

amelchio commented 5 years ago

An updated library is now available. If Home Assistant 0.81 does not fix all the problems, please create a new issue.