Ron
(Ron)
March 8, 2017, 8:26pm
1
Why doesn’t the “Held” option work for the Fibaro Button ?
Smart Lighting has the “Button Pressed or Held” option but when you select it you are only presented with “Which button” 1-5 ?
I know I can switch to CoRE since HELD work with CoRE but for now I am trying to address the simple fact that held should work in Smart Lighting but doesn’t. Is the DH missing something or is this a bug in Smart Lighting ?
I contacted support and got the typical. This device is not supported by Smart Things because it is a custom device handler. Convenient answer!
Ron
(Ron)
March 8, 2017, 9:41pm
3
Tyler:
Which DTH are you using?
From this thread.
current version: 0.9.1 - 22/01/2017
This is a device handler for the fibaro button device. The device is a simple button that can be used to control many things based on being clicked once, twice, three times, four times, five times or held down.
Install the device handler as normal in the IDE.
Registering Clicks
The device handler uses ST’s numberOfButtons attribute so should be recognised as a 5 button device in most ST made apps, if not it will default to 4… which isnt so bad. Just use each button number in place of the number of clicks that you want to use. For e.g. button 3 pressed = Fibaro button clicked 3 times
Special integration with CoRE
I have made a special integration with CoRE, so that you can use this device to it’s full potential. See below, it should be self explanat…
I just started fixing the issue. It seems capability “Holdable Button” was never added.
There are also errors in the “Held” code. I have it working but is there a better version I should be using @Tyler ?
Tyler
March 8, 2017, 9:49pm
4
No, I’m not aware of a DTH for that device yet. The closest I can think of is:
import groovy.json.JsonOutput
/**
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*
*/
metadata {
definition (name: "Aeon Key Fob", namespace: "smartthings", author: "SmartThings") {
capability "Actuator"
capability "Button"
capability "Holdable Button"
capability "Configuration"
This file has been truncated. show original
Ron
(Ron)
March 8, 2017, 9:56pm
5
HeHe…that’s exactly the one I used to fix my Fibaro DH code. Thanks.
My working version is here. I should probably clean it up some more. It was throwing groovy errors on held anyway. This version seems clean so far.
/**
* Copyright 2016 AdamV
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*
*
* Version 0.9.0
* Author: AdamV
* Date: 2016-09-10
* 2017-03-08 by gouldner
* - Added Holdable Button capability and fixed held event.
* - Some but not all indentation cleanup. mixed space/tabs messing it up
*
This file has been truncated. show original