nikshriv / cync_lights

Home Assistant Integration for controlling Cync switches, plugs, and bulbs
149 stars 50 forks source link

Issues with Scenes #58

Open technogizmo007 opened 1 year ago

technogizmo007 commented 1 year ago

Hi there! I am having an issue when these lights are in a scene. Using 4 ST19 Edison Style bulbs (RGBW) https://a.co/d/jaIucV4 -When they are programmed into a scene using color temperature, they don't respond to on/off so when the scene is activated, they don't even turn on. -When they are programmed into a scene using color/RGB, they turn on but only to the last state they were in. -"Off" seems to work appropriately when in a scene (like a scene that turns all my lights off in the house, they respond properly). -Controlling them live works fine as well. Only caveat is if they are Off and I go straight into sending a color temperature (not "on" first), they don't turn on; they will turn on and go color if I send them a color command and they were off.

I think what I'm finding is "Off" to "Color Temp On" does not work. "Off" to "Color On" works. Thank you for your work on this integration!

dencur commented 1 year ago

Seeing the same issue, described well by technogizmo007.

Unrealism2k commented 1 year ago

The integration works great for me, other than this "scene" issue. I have multiple devices throughout (BR30/A19/Plugs/Fans/Etc). When creating a scene in HA, it reverts back to "default" and will not save colors, or other things. Thank you for your efforts on this integration.

Unrealism2k commented 1 year ago

So I kinda got it working... here is where the problem is...

The line in the YAML is "Brightness" or anything to do with brightness for that matter. The "brightness_pct" appears to cause the same issue. If you remove it from the YAML, you can successfully change the bulb colors without it reverting back.

The only "True" work around I can find atm (which I think is a PITA) is you can run the script in place of scenes. Basically change the bulb colors however you see fit, but do not apply any other options (ie. brightness)

at the end of your script add a line item for just "Brightness" which allows it to change the brightness independently. Seems to work, but is a lot of headwork when scene would be a tad bit easier. I am not a coder at all.. so this was all done with troubleshooting and using the script generator to see what causes this.

Good luck!

technogizmo007 commented 1 year ago

Thank you, @Unrealism2k.. excellent troubleshooting work. I appreciate you sharing. Hopefully this will help out @nikshriv in making his awesome integration even awesomer. I will take a look at this and try it on my setup. If I find other work arounds, I'll report back.

network-guy commented 1 year ago

I am having this issue too. I saw it first in automations where there was no way to set it directly, then found this issue in scenes. I was examining the code and comparing it with some of the HA static imports. It looks like if ColorMode.BRIGHTNESS is set, it has to be the only mode set. The way the integration is setup it checks for supported modes, then appends the Color mode attributes, adding brightness last. I think that effectively overwrites the RGB settings.

I think re-working the mode configuration slightly into an if/else block may resolve it. I'm going to fork this repo and do some testing to see if I can get it working.

Unrealism2k commented 1 year ago

That would be amazing if you were able to do so, unfortunately that is outside my abilities. But does sound logical On Jul 4, 2023 at 5:45 PM -0400, network-guy @.***>, wrote:

I am having this issue too. I saw it first in automations where there was no way to set it directly, then found this issue in scenes. I was examining the code and comparing it with some of the HA static imports. It looks like if ColorMode.BRIGHTNESS is set, it has to be the only mode set. The way the integration is setup it checks for supported modes, then appends the Color mode attributes, adding brightness last. I think that effectively overwrites the RGB settings. I think re-working the mode configuration slightly into an if/else block may resolve it. I'm going to fork this repo and do some testing to see if I can get it working. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>