I’m writing a device type for the Osram Lightity Dimming Swtich which treats the device as a switch, rather than buttons.
(Thanks to @Motley for the existing device! I would have never had the time to do the parsing!!!)
I basically plugged the parsing from the existing device into the virtual dimmer switch and did a little tweaking.
While the existing device is excellent and opens a ton of possibility for the switch, I wanted the switch to appear as a switch, so it could be controlled by the App and also used with other SmartApps like Dim With Me and SmartLights.
I’ve got the basic functions working. The upper button press turns it on. The lower button press turns it off.
The upper button hold brightens the light by 10, the lower button hold dims the light by 10.
The annoying part is that a hold only registers once. It appears that while holding the button, the switch isn’t sending out any messages (like I’m still holding). The next parse happens when you let the button go.
I would like to have the device gradually dim or brighten while you hold the button, but have no idea how to do this.
I tried setting a state variable to capture the button release and having the level adjustment routine check the variable and if the button is still pressed do a runIn to the same routine, however, no matter what duration I put in, it runs the routine without any delay.
Any suggestions would be greatly appreciated.