ripnet / streamdeck-hubitat

Hubitat integration for the Elgato Stream Deck
MIT License
22 stars 8 forks source link

Dimmer Support #1

Open ripnet opened 3 years ago

ripnet commented 3 years ago

Add support for dimmers. Customizable for the direction (up/down) and by how much (maybe in 10% increments)?

mujeebbasit commented 2 years ago

Great solution and easy to setup. Could you add support to set a specific dimmer level as well. Thank you

ripnet commented 2 years ago

@mujeebbasit I just pushed version 1.6. You should see a setLevel option when you use the Set Switch button. Let me know if this works (or doesn't).

mujeebbasit commented 2 years ago

Thank you, in works great! I had to uninstall the custom action and reinstall it because I kept getting a custom action already installed error. The UI for this is particularly confusing because you have to right click on the action and not the title to get the uninstall to show up. I setup the dimmer levels using a Multi-Action Switch which now allows me to toggle between two intensities of the light thanks to this update. It would be nice to have a multi-action toggle switch that does not have the two-set limit

mujeebbasit commented 2 years ago

Wanted to come back to update you on this. It has worked great and is very stable. I did not realize the button updates status without action which is extremely nice. Great build. A luxury enhancement would be to allow custom switch icons to make each light type easier to identify but extremely happy with the build.

mujeebbasit commented 2 years ago

Wanted to come back provide additional feedback after using it for a couple of weeks. This build is extremely stable, and I keep going back to it because of the icon turning green independent of where it is turned on. The function that I have tried to do via the multi-toggle feature is to set the level and turn it on at the same time. It would be nice to have advanced of level aware toggle. I have created some icons to help highlight the idea and attached them here. Each green bar would turn on at a set level band and pressing the button once to increase the level one level, double clicking would reduce it one level, and holding the button would toggle off. I looked at your code and am not familiar with the steam deck libraries to be able to effectively do this. First version could have fixed levels and future version could have customizable levels if it is broadly adopted.

light_gray@2x 3 green light_gray@2x 4 green light_gray@2x 5 green light_gray@2x 6 green full light_gray@2x 1 green light_gray@2x 2 green

ripnet commented 2 years ago

I kept getting a custom action already installed error.

This should be fixed. I forgot to increment the version in the manifest.json file.

I setup the dimmer levels using a Multi-Action Switch

For the current Set Switch button, I added another sub-option to turn the light on or off at the same time as setting the level. This should prevent having to do streamdeck MultiAction

...double clicking would reduce it one level...

There's a new button now, called Multi-Action Dimmer which does the following:

There are a few things to note:

  1. StreamDeck doesn't send events for holding or double-clicking buttons. It only sends keyUp and keyDown. I had to play around and get those to work with custom code. It's likely still a bit buggy and I'm sure the timers will need to be adjusted.
  2. I might have broken other things or not set this up exactly the way you intended. Feedback welcome.

https://github.com/ripnet/streamdeck-hubitat/releases/

mujeebbasit commented 2 years ago

It works well and the double-click and button hold is very clever. I noticed only two issues. First, when switching panels in Stream Deck the icon reverts back to the single green bar icon instead of the icon representative to the level. Second, the steps in the light level scale is greater than the available icons therefore the jump from 85% to 100% does not correspond to an icon change. Reducing the light levels would be the easiest solution so there are only 7 levels (greyed out at off or 0% and the 6 green bars). Thank you again for this development; it is amazing work.