Hi all,
I took a punt on this, hoping this may be usable.
Anyone managed to get this working please?
TiA!
Hi all,
I took a punt on this, hoping this may be usable.
Anyone managed to get this working please?
TiA!
Ah yes, I got rid of the button but I still have the driver code. I never did get it to github but I can try to share another way. What's best for copying raw code from the Hubitat driver editor?
You can copy and paste the code here.
Then select the code only in your post and use the cog wheel tool to hide it into a section. Like this :
/**
http://www.apache.org/licenses/LICENSE-2.0
- TODO: calculate battery % from Voltage event for Konke button!
- TODO: add Advanced options; TODO: debounce timer configuration; add 'auto revert to scene mode' option
*/
def version() { "2.6.2" }
def timeStamp() {"2023/02/06 12:02 PM"}
@Field static final Boolean debug = false
@Field static final Integer healthStatusCountTreshold = 4
import groovy.transform.Field
import hubitat.helper.HexUtils
import hubitat.device.HubMultiAction
import groovy.json.JsonOutput
metadata {
definition (name: "Tuya Scene Switch TS004F", namespace: "kkossev", author: "Krassimir Kossev", importUrl: "https://raw.githubusercontent.com/kkossev/Hubitat/development/Drivers/Tuya%20TS004F/TS004F.groovy", singleThreaded: true ) {
capability "Refresh"
capability "PushableButton"
capability "DoubleTapableButton"
capability "HoldableButton"
capability "ReleasableButton"
capability "Battery"
capability "PowerSource"
capability "Configuration"
capability "Health Check"
,......
/**
http://www.apache.org/licenses/LICENSE-2.0
*/
import hubitat.zigbee.zcl.DataType
metadata {
definition (name: "Inges Zemismart Zigbee 6-Button Remote", namespace: "Inge Jones", author: "Inge Jones") {
capability "Actuator"
capability "Battery"
capability "PushableButton"
capability "HoldableButton"
capability "DoubleTapableButton"
capability "Configuration"
capability "Refresh"
capability "Sensor"
capability "Health Check"
fingerprint inClusters: "0000,0004,0005,EF00", outClusters: "0019,000A", manufacturer: "_TZE200_zqtiam4u", model: "TS0601"
}
preferences {
input name: "debugEnable", type: "bool", title: "Enable debug logging", defaultValue: false
}
}
private sendButtonNumber() {
def remoteModel = device.getDataValue("model")
switch(remoteModel){
case "TS0601":
sendEvent(name: "numberOfButtons", value: 6, isStateChange: true)
break
}
}
def installed() {
sendButtonNumber()
state.start = now()
}
def updated() {
sendButtonNumber()
}
def refresh() {
return zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, getAttrid_Battery())
}
def configure() {
sendButtonNumber()
//log.debug "Configuring Reporting, IAS CIE, and Bindings."
def cmds = []
return
zigbee.enrollResponse() +
readDeviceBindingTable() // Need to read the binding table to see what group it's using
cmds
}
def parse(String description) {
//log.debug "description is $description"
if ((description?.startsWith("catchall:")) || (description?.startsWith("read attr -"))) {
def parsedMap = zigbee.parseDescriptionAsMap(description)
if (debugEnable){
log.debug("Message Map: '$parsedMap'")
}
//switch(parsedMap.sourceEndpoint) {
switch(parsedMap.data[2]) {
case "01":
button = "1"
break
case "02":
button = "2"
break
case "03":
button = "3"
break
case "04":
button = "4"
break
case "05":
button = "5"
break
case "06":
button = "6"
break
case "0A":
button = "10"
break
}
if (button == "10")
{
def batCap = zigbee.convertHexToInt(parsedMap.data[9])
if (debugEnable) {
log.debug "Battery level = ${batCap}"
}
sendEvent(name:"battery", value: batCap)
}
else if (button != null) {
switch(parsedMap.data[6]) {
case "00":
buttonState = "pushed"
break
case "01":
buttonState = "doubleTapped"
break
case "02":
buttonState = "held"
break
}
if (debugEnable) {
log.debug("button = " + button + " buttonState = " + buttonState)
}
sendEvent(name: buttonState, value: button, descriptionText: "Button $button was $buttonState",isStateChange:true)
}
}
return
}
Cheers lads - works a treat. Quality is a bit wank to be honest, and the 'hold' seems to be sporadic at best, but I suspect this isn't down to the driver.
Many thanks!
Well yeah, like I say I threw mine out. It had the feel of a Christmas cracker toy.
Any suggestions on a substitute?
Don't fancy entering the giddy heights of picos etc, as I have better things to spend my pennies on than a button for a thousand quid.
Ta! =)
I use these a lot now - only 4 buttons tho. https://www.amazon.co.uk/gp/product/B08J3TMGJH/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
Vesternet have a selection of more-than-4-button but they don't all have the full three button actions.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.