diyhue / Lights

DIY lights with support for diyHue
https://diyhue.org/
172 stars 99 forks source link

Added Fade Functionality for use with Dimmer Controls #78

Closed ryancasler closed 4 years ago

ryancasler commented 4 years ago

Added an appropriate response to the bri_inc command. It will now respond the same way that a Hue Bulb does. This will allow you to use a hue dimmer switch or Tradfri dimmer to adjust the level of the lights. If your light is at 100% and you press and hold the down button, the light will fade down until the button is released and then stop.

For the bri_inc value: Any negative value will cause the light to start dimming. Any positive value will cause the light to start brightening. A value of 0 will cause the light to stop changing.

The transitiontime passed along with the bri_inc command can be used to adjust the fade time. The higher the value passed, the longer it will take to change the light.

mariusmotea commented 4 years ago

Hi,

Why you need this future at light level when the bridge emulator is taking care of this and is sending incremental requests every half of second for this king of requests. Also i try to have the code of the lights similar, your future is applied only to ws2812 lights.

ryancasler commented 4 years ago

Why you need this future at light level when the bridge emulator is taking care of this and is sending incremental requests every half of second for this king of requests.

When issuing a bri_inc from an outside controller, that is not handled by the bridge emulator. This would only cover those controllers connected directly to DIYHue. It also doesn't work with natively connected Tradfri dimmers connected to deconz. So, i'm not sure what you mean when you say the bridge emulator will take care of this because In my experience, it doesn't. If there is some other way that you have to set up the dimmer in DIYHue or a different command that should be issue to the API, please let me know.

your future is applied only to ws2812 lights.

It could be incorporated to the other sketches as well...but I din't want to take the time to do all of that if you weren't going to use the first one. 😄

mariusmotea commented 4 years ago

I use Tradfri Dimmer switches, i have 11 in my home and are working fine with incremental commands. How you configure them?

ryancasler commented 4 years ago

With your ESP based LED lights? I am configuring it via the Hue Essentials app. I configure it as follow: Up: Press: Toggle On Hold: Increase Brightness by 100% over 6 seconds Release: Stop brightness change Down: Press: Toggle Off Hold: Decrease Brightness by 100% over 6 seconds Release Stop bright change

What I would expect is that when the lights are 100% and I hold down the bottom button for 3 seconds that they would stop at approximately 50%. However, as soon as I release the button they brightness gets set to 1% instantly. They drop from 50% to 1% instantly. How do you have the buttons configured?

When setting the button up through the deconz app to control other deconz lights the button works exactly the way that I described. So, are you using the button differently or are you configuring it differently?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 2 days if no further activity occurs. Thank you for your contributions.

ryancasler commented 4 years ago

Did you have more details about how you have your dimmers set up in DIYHue?

mariusmotea commented 4 years ago

Yes, just access /deconz page of the hue emulator. Once you set the dimmers from there the rules are in place also for log press button events. Normally it must work from all apps, the buttonevent code remain the same

ryancasler commented 4 years ago

But you can't access the ESP8266 lights from Deconz. They aren't Zigbee so they are connected directly to the DIYHue.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 2 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed as it has not had any recent activity. Thank you for your contributions.