I have a pushable button. I did a device.sendEvent(name: "pushed", value: "1") and that worked. But it seems like the device gets stuck in a pushed state. How do I un-push a button?
You don't. You can push a button as many times in a row as you want. However, you need to send the event each time the button is pressed. What type of device are you working with? I assume you're talking about in a driver?
You need to add stateChange: true to the sendevent
I thought that was the default and didn't need to be included. Is that only for switch events? Or in this case because you are forcing the event to be true because it is the same button twice in a row?
There is no unpushed
Yes the last bit
Just like if you were turning a switch "on" again. Darn it....i should have caught that one. Hey, took me a second but I got there.
So, to expand on what Mike said, the code you want is:
device.sendEvent(name: "pushed", value: "1", isStateChange: true)
Value should be an integer, not a string...
Ah....didn't catch that one.
device.sendEvent(name: "pushed", value: 1, isStateChange: true)
Thanks guys, worked like a charm!