Inspired by this thread and this post in particular, I have created an app that (I think) easily allows button devices to be configured to control bulbs, switches, and dimmers. This app allows you to:
- choose a button device (I wrote this with 5-button Picos with the "fast Pico" driver in mind and expanded it to work with the "held" events from the Osram/Lightify dimmer and later the "double tapped" events from other devices, but any button device should work)
- choose one or more bulbs/dimmers or groups to control
- choose an action for each button press: turn on (any or all selected bulbs), dim up or down, turn on scene, activate Hue Bridge scene (CoCoHue required), turn off last used scene, turn off (specific) scene, or turn off (all bulbs)
- dim can either "step up"/"step down" or (if button device supports "released" events and bulbs support the
start
- andstopLevelChange
commands) continuously dim while pressing or holding the button - for dimming, only bulbs that are currently on will be changed (emulating Hue Dimmer)
- dim can either "step up"/"step down" or (if button device supports "released" events and bulbs support the
- for "on"-type actions, multiple pushes (default of 5) of the button are (optionally) tracked to allow you to cycle through different manual settings (with "Turn on" selected) or scenes (with "Turn on scene" or "Activate Hue Bridge scene" selected); the count resets to press 1 after 15 seconds or after an "off"-type button is pressed. This, again, emulates Hue Dimmer behavior.
Turning on and off is nothing you can't do with existing apps (e.g., Button Controller or Advanced Button Controller), but since they do much more than lights, it takes more time to set them up (and the default "transition time" was too high for me--mine defaults to 100ms but can be changed from 0-3s). I also found it annoying to need to select the same lights for each action when I want all actions to affect the same ones. The "multi-press" feature and "don't dim/brighten bulbs that aren't already on" features are also not easily possible with existing solutions.
Link to GitHub repo is below. This is a parent/child app, so add the code for both (parent first), then install an instance of the parent, which you can use to create child apps.
Or for manual installation with raw code, use these links:
- Parent app: https://raw.githubusercontent.com/RMoRobert/Hubitat/master/apps/DimmerButtonController/DimmerButtonControllerParent.groovy
- Child app: https://raw.githubusercontent.com/RMoRobert/Hubitat/master/apps/DimmerButtonController/DimmerButtonController2.groovy
NOTE: If upgrading from 1.x to 2.x (and you care to keep 1.x child apps), see the notes in the readme on GitHub or post 86 below (but basically, add the 2.x child as a new app, update the parent, and keep your 1.x installation--the 2.x child is an entirely new app)
Alternative installation method: Dimmer Button Controller 2 can also be installed from Hubitat Package Manager. Choose Install > From a Repository > Utility or look by author "Robert Morris" (bertabcd1234) or namespace "RMoRobert".
I've tested this mostly with the "manual" input settings (e.g., "Turn on" and then manually specified brightness, color temperature, etc. settings), but I've added support for turning on (and off) scenes due to anticipated requests for that. I've also used the new Hue Bridge scene feature (via my CoCoHue integration) a lot. Hopefully it's as useful to others as I'm finding it for myself!
Here's a screenshot of how I have one set up using a CoCoHue group and scenes with a 5-button Pico, though you could do something similar with "regular" bulbs and scenes (or manual settings) too: