banta
March 29, 2019, 3:28am
1
I have defined
capability "PushableButton"
But I don't get a button on the device page to enter button number and test. I also send the event on install and configure
sendEvent(name: "numberOfButtons", value: 12, displayed: true)
I also added the corresponding attributes. It shows number of buttons 12 but the button to test is not showing up.
TIA
Pluckyhd
Have you added all the components as advised in:
Hubitat's button implementation differs from ST's, in fact we do not have a capability button implemented in our apps.
We didn't like it, so we abandoned it altogether...
We have replaced "button", with one mandatory capability "PushableButton", and two optional add ons, HoldableButton and DoubleTapableButton
PushableButton:
/*
PushableButton (replaces button)
driver def:
capability "PushableButton"
commands:
push(<button number that was pushed>)
attributes:
NUMBER numberOfButtons //s…
commands:
attributes:
I assume so but maybe it's simple
banta
March 29, 2019, 8:12pm
4
I am not sure what it wants here a command I suppose? Or is this a def?
You need to define the capabilities and the commands. They are not added by default.
capability "PushableButton"
command "push", ["number"]
Also set the number of buttons as you have and then the method
def push(btn) {
if (btn==1) {
// do some stuff
}
}
Hopefully this helps. Its similar for the other button capabilities as well.
You only need to do that if the commands are not part of the default. For example if you use the switch capability, you don't have to list command "on" and command "off" in the driver setup. They will be available by default.
Correct. The button capability does it differently. There's a post about it on the forums. For those you need to add the command so you can see them in the device details page.
Because that capability has no default commands.
banta
March 30, 2019, 1:46am
9
Thanks all you helped me allot. Slowly learning these oddities.