nfarina / homebridge-dummy

Dummy switches for Homebridge: https://github.com/nfarina/homebridge
261 stars 82 forks source link

Feature request: timed fader #77

Open jlg89 opened 1 year ago

jlg89 commented 1 year ago

There's no native way in HomeKit to "slow-fade" a light. I propose a dummy fader that can be stateful (i.e. remembers its last intensity setting), and has a fadeTime parameter that tells it how long to take to fade from current level to new level.

Then again, how does one tie a HomeKit fader to the dummy fader? Hmm...

mkz212 commented 1 year ago

The slider itself is easy to make in this plugin. But for this monent can't bind it to homekit.

In homekit automation you can imitate slow fade. Convert to shortcut and then: Set value 1% wait 1 sec Set value 2% wait 1 sec etc.

jlg89 commented 1 year ago

This works for doing a "full" fade, but what I'm after is the ability to start at the current setting and fade from there to the new setting.

mkz212 commented 1 year ago

Lots of work but it can be done. If the step was to be every 1%, then 100 such blocks, like:

If device value = 43 Set to 44 Wait 1 sec

If device value = 44 Set to 45 Wait 1 sec

If device value = 45 Set to 46 Wait 1 sec

Etc.

But I think 5% is enough. So it be like:

If device value between 40 and 44 Set to 45 Wait 1 sec

If device value between 45 and 49 Set to 50 Wait 1 sec

If device value between 50 and 54 Set to 55 Wait 1 sec

It's only one way - increasing, but decrease similarly.

mkz212 commented 1 year ago

What device You have? System? What plugin?

jlg89 commented 1 year ago

I'm using https://github.com/PennazSoftware/homebridge-dmxlight-plugin to control some DMX lights, and it uses a "transitionDuration" value to control how fast a given DMX value gets changed. I thought it would be pretty nice to be able to smooth-fade normal faders in HomeKit...but there doesn't seem to be a way to tie a fader to another fader in HomeKit, the only way seems to be something like what you've proposed.

mkz212 commented 1 year ago

I asked because I wanted to write that some control panels (e.g. Fibraro) have such a function built-in, and probably some plugins directly supporting these devices too. If your plugin does it why should Dummy do it?

Unfortunately homekit has 2 problems here. After 1 there is no option to connect the real slider with the virtual one. After 2, even if there was such an option, it would rather not work because homekit does not read the values ​​often enough and without delays. Maybe Apple will announce some changes in June. You can also make a suggestion to them.

Please explain to me, since your plugin supports this, why would it be useful in Dummy? What could this apply to? Maybe together we will find a way and a practical application.

And if you are looking for more possibilities of this plugin, I invite you to check #84

jlg89 commented 1 year ago

Given problem 1, I don't see any good reason to implement a fader in Dummy, at least not for the functionality for which I was hoping. If I come up with a practical application that would actually work in HomeKit, I'll update here. Thank you for the time & effort you put into this plugin...for something called "Dummy" it's eminently useful!