Phillips Hue Dimmer Switch Integration?

I wrote Dimmer Button Controller to make this easy. Choose the bulb(s) you want to control. Then for button 2 held, choose, for example, "Brighten" and tick the "Dim/brighten while held" option (button 2 can be left at plain "brighten" so it can be used to step up the brightness--and also this device doesn't send a "released" event for pushes, so it's all you can do without a hold). Button 3 would be similar except for dimming down.

All this does behind the scenes is call startLevelChange(up) (or startLevelChange(down)) on a hold and stopLevelChange on a release (for a push, unless configured otherwise, you'd just use the regular setLevel, which steps the brightness up or down once based on a calculated value relative to the current value). In Rule Machine or Button Controller, access to start/stop-level-change device commands is labeled something like "stop raising/lowering dimmers" and "stop raising/lowering dimmers," so that's what you can use there if you'd rather use stock apps and do this yourself.

The other part of the trick is knowing what button events your device sends when. In the case of the Hue Dimmer, all buttons will send "pushed" upon the release of a short-ish press. Buttons 2 and 4 will send "held" instead if you press (and hold) them for just a bit longer (doesn't take as long on these as some others I've seen, which I like). After a "held" (but not a "pushed"), a "released" event is sent when the button is released. The latter two facts can be used to create the desired effect with dimming while held (start on hold, stop on release). Different button devices may work differently, but both this and the Eria Dimmer work like this.