Philips Hue Dimmer Switch V2

Hi,
I paired a dimmer switch v1 just fine and now I wanted to do the same with the new v2 switch, but it gets recognized as a hue button control (?), hence only one button is shown. When I change the device type to the dimmer switch, nothing happens. It does show dimmer switch in the device list, but on the device page again only one button is listed.
Anybody had the same issue and can provide a workaround for this? Thanks in advance!

Did you hit configure after changing the driver?

yes, this does nothing

Okay, people using smartthings had the same problem and the user mvevitsis was so kind to provide a new device handler for the dimmer switch v2:

I tried to simply use sticks18 code and put in the new fingerprint, which does not work:
https://raw.githubusercontent.com/xxKeoxx/hubitat/master/device_drivers/HueDimmer.groovy

The device pairs and finds the device handler, but it shows up 3 times with different IDs and first I can push buttons and the App shows me the correct numbers, but after a few seconds this is not the case anymore and the switch just blinks orange after pressing a button.

Since I am not coding and cannot find information, which I ad hoc understand, to adapt the code, I hope somebody else is so kind and might help me with this?

Looks like the built-in driver will be in 2.2.8

Made the obvious changes - it compiles, but I have no way of testing so....

Converted Code
/**
 *  Hue Dimmer Switch (Latest Model)
 *
 *  Copyright 2021 Matvei Vevitsis
 *  Based on code by Jaewon Park
 *
 *  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.
 *
 */
import groovy.json.JsonOutput
import hubitat.zigbee.zcl.DataType

metadata {
	definition (name: "Hue Dimmer Switch (Latest Model)", namespace: "circlefield05082", author: "mvevitsis", ocfDeviceType: "x.com.st.d.remotecontroller", mcdSync: true, mnmn: "SmartThings", vid: "generic-4-button") {
		capability "Configuration"
		capability "Battery"
		capability "Refresh"
		capability "PushableButton"
		capability "Health Check"
		capability "Sensor"

		attribute "lastCheckin", "string"
		attribute "lastButtonState", "string"
		attribute "lastButtonName", "string"
		
		fingerprint profileId: "0104", endpointId: "01", application:"02", outClusters: "0019, 0000, 0003, 0004, 0006, 0008, 0005, 1000", inClusters: "0000, 0001, 0003, FC00, 1000", manufacturer: "Signify Netherlands B.V.", model: "RWL022", deviceJoinName: "Hue Dimmer Switch (Latest Model)"
	}
	preferences {
		input name: "holdTimingValue", type: "enum", title: "Hold event firing timing", options:["0": "When Hold starts", "1": "When Hold ends"], defaultValue: "0"
	}
}

private getBATTERY_MEASURE_VALUE() { 0x0020 }


private getButtonLabel(buttonNum) {
	def hueDimmerNames = ["On","Up","Down","Off"]
	return hueDimmerNames[buttonNum - 1]
}


private getButtonName(buttonNum) {
	return "${device.displayName} " + getButtonLabel(buttonNum)
}


def parse(String description) {
	def result = []
	
   	if (description?.startsWith('catchall:') || description?.startsWith('read attr -')) {
		result = parseMessage(description)
	}
	/*else if (description?.startsWith('enroll request')) {
		def cmds = zigbee.enrollResponse()
		result = cmds?.collect { new physicalgraph.device.HubAction(it) }
	}
	if (now() - state.battRefresh > 12 * 60 * 60 * 1000) { // send battery query command in at least 12hrs time gap
		state.battRefresh = now()
		def cmds = refresh()
		cmds.each{ sendHubCommand(new physicalgraph.device.HubAction(it)) } 
	}*/
	sendEvent(name: "lastCheckin", value: (new Date().format("MM-dd HH:mm:ss ", location.timeZone)), displayed: false)	
	return result
}


private parseMessage(String description) {
	def descMap = zigbee.parseDescriptionAsMap(description)

	switch(descMap.clusterInt) {
		case zigbee.POWER_CONFIGURATION_CLUSTER:
			if (descMap?.attrInt == BATTERY_MEASURE_VALUE && descMap.value) {
				return getBatteryResult(zigbee.convertHexToInt(descMap.value))
			}
			break
		case 0xFC00:
			if ( descMap.command == "00" ) {
				return getButtonResult(descMap.data)
			}
			break
	}
	return [:]
}


private getBatteryResult(rawValue) {
	def volts = rawValue / 10
	if (volts > 3.0 || volts == 0 || rawValue == 0xFF) {
		return [:]
	}
	def minVolts = 2.1
	def maxVolts = 3.0
	def pct = Math.max(1, Math.min(100, (int)(((volts - minVolts) / (maxVolts - minVolts)) * 100)))
	log.debug "Battery rawData: ${rawValue}  Percent: ${pct}"
	return createEvent(name: "battery", value: pct, descriptionText: "${device.displayName} battery is ${pct}%")
}


private getButtonResult(rawValue) {
	def result = []
	def buttonStateTxt
	
	def button = zigbee.convertHexToInt(rawValue[0])
	def buttonState = rawValue[4]
	def buttonHoldTime = rawValue[6]
	log.debug "Button data : button=${button}  buttonState=${buttonState}  buttonHoldTime=${buttonHoldTime}"
	
	if ( buttonState == "00" ) {  // button pressed
		return [:]
	} else if ( buttonState == "02" ) {  // button released after push
		buttonStateTxt = "pushed"
	} else if ( buttonState == "03" ) {  // button released after hold
		buttonStateTxt = (HOLDTIMING)? "held" : "released"
	} else if ( buttonHoldTime == "08" ) {  // The button is being held
		if (HOLDTIMING) {
			return [:]
		} else {
			buttonStateTxt = "held"
		}
	} else {
		return [:]
	}
	
	def descriptionText = "${getButtonLabel(button)} button was ${buttonStateTxt}"
	log.debug descriptionText
   	result << createEvent(name: "lastButtonName", value: getButtonLabel(button), displayed: false)
	result << createEvent(name: "lastButtonState", value: buttonStateTxt, displayed: false)
	
	if (buttonStateTxt == "pushed" || buttonStateTxt == "held") {
		result << createEvent(name: "button", value: buttonStateTxt, data: [buttonNumber: button], descriptionText: descriptionText, isStateChange: true, displayed: false)
		sendButtonEvent(button, buttonStateTxt)
		if (buttonStateTxt == "pushed" || HOLDTIMING) {
			runIn(1, "setReleased", [overwrite:true])
		}
	}
	return result
}


private sendButtonEvent(buttonNum, buttonState) {
	def child = childDevices?.find { channelNumber(it.deviceNetworkId) == buttonNum }
	if (child) {
		def descriptionText = "${child.displayName} button is ${buttonState}"
		log.debug child.deviceNetworkId + " : " + descriptionText
		child.sendEvent(name: "button", value: buttonState, data: [buttonNumber: 1], descriptionText: descriptionText, isStateChange: true, displayed: true)
	} else {
		log.debug "Child device $buttonNum not found!"
	}
}


private setReleased() {
	log.debug "setReleased()"
	sendEvent(name: "lastButtonState", value: "released", displayed: false)
}


def refresh() {
	def refreshCmds = zigbee.configureReporting(0xFC00, 0x0000, DataType.BITMAP8, 30, 30, null) + zigbee.configureReporting(zigbee.POWER_CONFIGURATION_CLUSTER, BATTERY_MEASURE_VALUE, DataType.UINT8, 7200, 7200, 0x01)
	refreshCmds += zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, BATTERY_MEASURE_VALUE)
	log.debug "refresh() returns " + refreshCmds
	return refreshCmds
}


def configure() {
	log.debug "configure() returns refresh()"
	return refresh()
}


def updated() {
	log.debug "updated() called"
	if (childDevices && device.label != state.oldLabel) {
		childDevices.each {
			def newLabel = getButtonName(channelNumber(it.deviceNetworkId))
			it.setLabel(newLabel)
		}
		state.oldLabel = device.label
	}
	for (child in childDevices) {
		if (!child.deviceNetworkId.startsWith(device.deviceNetworkId)) { //parent DNI has changed after rejoin
			child.setDeviceNetworkId("${device.deviceNetworkId}:${channelNumber(child.deviceNetworkId)}")
		}
	}	
}


def installed() {
	log.debug "installed() called"
	def numberOfButtons = 4
	createChildButtonDevices(numberOfButtons)
	sendEvent(name: "supportedButtonValues", value: ["pushed","held"].encodeAsJson(), displayed: false)
	sendEvent(name: "numberOfButtons", value: numberOfButtons, displayed: false)
	numberOfButtons.times {
		sendEvent(name: "button", value: "pushed", data: [buttonNumber: it+1], displayed: false)
	}
	// These devices don't report regularly so they should only go OFFLINE when Hub is OFFLINE
	sendEvent(name: "DeviceWatch-Enroll", value: JsonOutput.toJson([protocol: "zigbee", scheme:"untracked"]), displayed: false)
	sendEvent(name: "lastButtonState", value: "released", displayed: false)
	//state.battRefresh = now()
}


private void createChildButtonDevices(numberOfButtons) {
	log.debug "Creating $numberOfButtons child buttons"
	for (i in 1..numberOfButtons) {
		def child = childDevices?.find { it.deviceNetworkId == "${device.deviceNetworkId}:${i}" }
		if (child == null) {
			log.debug "..Creating child $i"
			child = addChildDevice("smartthings", "Child Button", "${device.deviceNetworkId}:${i}", device.hubId,
				[completedSetup: true, label: getButtonName(i),
				 isComponent: true, componentName: "button$i", componentLabel: "Button "+getButtonLabel(i)])
		}
		child.sendEvent(name: "supportedButtonValues", value: ["pushed", "held"].encodeAsJSON(), displayed: false)
		child.sendEvent(name: "numberOfButtons", value: 1, displayed: false)
		child.sendEvent(name: "button", value: "pushed", data: [buttonNumber: 1], displayed: false)
	}
	state.oldLabel = device.label
}


private channelNumber(String dni) {
	dni.split(":")[-1] as Integer
}

private getHOLDTIMING() {
	return (holdTimingValue=="1")
}
1 Like

Thank you! @thebearmay Only one device is found now, but I don't get a button response in the hubitat web overview. I guess I will wait a little bit longer for the fw 2.2.8 - I hope this will not take months, though... :slight_smile:

If you turn on debug what do the log messages show when you press a button?

I am looking for debuggin, which I cannot find. Here is the normal log from yesterday whith some errors already though:

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:37:45.287 [debug](http://192.168.50.92/device/edit/150)refresh() returns [zdo bind 0xB0BD 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0xB0BD 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0xB0BD 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:37:44.174 [error](http://192.168.50.92/device/edit/150)org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_circlefield05082_Hue_Dimmer_Switch__Latest_Model__454.push() is applicable for argument types: (java.math.BigDecimal) values: [1] Possible solutions: use([Ljava.lang.Object;), run(), run(), dump(), parse(java.lang.String), with(groovy.lang.Closure) (push)

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:37:42.283 [debug](http://192.168.50.92/device/edit/150)refresh() returns [zdo bind 0xB0BD 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0xB0BD 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0xB0BD 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:37:39.726 [error](http://192.168.50.92/device/edit/150)org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_circlefield05082_Hue_Dimmer_Switch__Latest_Model__454.ping() is applicable for argument types: () values: [] Possible solutions: find(), print(java.lang.Object), find(groovy.lang.Closure), print(java.io.PrintWriter), print(java.lang.Object), run() (ping)

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:37:10.798 [error](http://192.168.50.92/device/edit/150)org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_circlefield05082_Hue_Dimmer_Switch__Latest_Model__454.push() is applicable for argument types: (java.math.BigDecimal) values: [1] Possible solutions: use([Ljava.lang.Object;), run(), run(), dump(), parse(java.lang.String), with(groovy.lang.Closure) (push)

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:36:53.183 [debug](http://192.168.50.92/device/edit/150)refresh() returns [zdo bind 0xB0BD 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0xB0BD 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0xB0BD 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:36:53.176 [debug](http://192.168.50.92/device/edit/150)configure() returns refresh()

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:33:23.434 [debug](http://192.168.50.92/device/edit/150)Battery rawData: 28 Percent: 77

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:33:15.220 [debug](http://192.168.50.92/device/edit/150)refresh() returns [zdo bind 0xB0BD 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0xB0BD 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0xB0BD 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0xB0BD 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:33:15.200 [debug](http://192.168.50.92/device/edit/150)configure() returns refresh()

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:33:15.193 [error](http://192.168.50.92/device/edit/150)org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: user_driver_circlefield05082_Hue_Dimmer_Switch__Latest_Model__454.addChildDevice() is applicable for argument types: (java.lang.String, java.lang.String, org.codehaus.groovy.runtime.GStringImpl, null, java.util.LinkedHashMap) values: [smartthings, Child Button, B0BD:1, null, [completedSetup:true, ...]] (installed)

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:33:15.160 [debug](http://192.168.50.92/device/edit/150)..Creating child 1

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:33:15.149 [debug](http://192.168.50.92/device/edit/150)Creating 4 child buttons

[dev:150](http://192.168.50.92/logs#pastdev150)2021-05-15 22:33:15.147 [debug](http://192.168.50.92/device/edit/150)installed() called

Okay - needed push and ping commands defined. Took a stab at mapping those where I think they should go.

Try pulling the code from:

https://raw.githubusercontent.com/thebearmay/hubitat/main/development/hueDimmerPorted.groovy

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:41.115 [debug](http://192.168.50.92/device/edit/151)setReleased()

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:40.061 [debug](http://192.168.50.92/device/edit/151)Child device 3 not found!

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:40.057 [debug](http://192.168.50.92/device/edit/151)Down button was pushed

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:40.055 [debug](http://192.168.50.92/device/edit/151)Button data : button=3 buttonState=02 buttonHoldTime=01

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:39.974 [debug](http://192.168.50.92/device/edit/151)Button data : button=3 buttonState=00 buttonHoldTime=00

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:37.769 [debug](http://192.168.50.92/device/edit/151)setReleased()

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:36.730 [debug](http://192.168.50.92/device/edit/151)Child device 4 not found!

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:36.728 [debug](http://192.168.50.92/device/edit/151)Off button was pushed

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:36.726 [debug](http://192.168.50.92/device/edit/151)Button data : button=4 buttonState=02 buttonHoldTime=01

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:36.594 [debug](http://192.168.50.92/device/edit/151)Button data : button=4 buttonState=00 buttonHoldTime=00

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:34.983 [debug](http://192.168.50.92/device/edit/151)Battery rawData: 28 Percent: 77

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:33.522 [debug](http://192.168.50.92/device/edit/151)setReleased()

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:32.481 [debug](http://192.168.50.92/device/edit/151)Child device 1 not found!

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:32.474 [debug](http://192.168.50.92/device/edit/151)On button was pushed

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:32.472 [debug](http://192.168.50.92/device/edit/151)Button data : button=1 buttonState=02 buttonHoldTime=01

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:32.402 [debug](http://192.168.50.92/device/edit/151)Button data : button=1 buttonState=00 buttonHoldTime=00

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:26.649 [debug](http://192.168.50.92/device/edit/151)refresh() returns [zdo bind 0x2B6B 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0x2B6B 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0x2B6B 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0x2B6B 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0x2B6B 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:26.642 [debug](http://192.168.50.92/device/edit/151)configure() returns refresh()

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:12.284 [debug](http://192.168.50.92/device/edit/151)Battery rawData: 28 Percent: 77

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:04.015 [debug](http://192.168.50.92/device/edit/151)refresh() returns [zdo bind 0xF277 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0xF277 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0xF277 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0xF277 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0xF277 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:03.987 [debug](http://192.168.50.92/device/edit/151)configure() returns refresh()

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:03.979 [error](http://192.168.50.92/device/edit/151)org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: user_driver_circlefield05082_Hue_Dimmer_Switch_v2_Ported_454.addChildDevice() is applicable for argument types: (java.lang.String, java.lang.String, org.codehaus.groovy.runtime.GStringImpl, null, java.util.LinkedHashMap) values: [smartthings, Child Button, F277:1, null, [completedSetup:true, ...]] (installed)

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:03.949 [debug](http://192.168.50.92/device/edit/151)..Creating child 1

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:03.938 [debug](http://192.168.50.92/device/edit/151)Creating 4 child buttons

[dev:151](http://192.168.50.92/logs#pastdev151)2021-05-16 13:30:03.936 [debug](http://192.168.50.92/device/edit/151)installed() called

Getting better results, but still there seems to be an issue with the button configuration. And I really thought I could transfer this on my own - hahahaha.

EDIT: ah and I am just looking at it: hubitat found more devices then one again!

Looks like it should have tried to add 4 component devices, if it did then I may only need to tweak the find child inside the sendButtonEvent method. If it didn’t then we start with createChildButtonDevices...

1 Like

I am not sure if I am getting what you mean. Here is what happens when I do zigbee pairing:

Okay, not what I thought you were seeing. Remove those, and let’s try with the code I just modified (same url as above).

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:30:48.578 [debug](http://192.168.50.92/device/edit/153)Battery rawData: 28 Percent: 77

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:30:40.214 [debug](http://192.168.50.92/device/edit/153)refresh() returns [zdo bind 0x1D8F 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0x1D8F 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0x1D8F 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0x1D8F 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0x1D8F 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:30:40.206 [debug](http://192.168.50.92/device/edit/153)configure() returns refresh()

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:30:24.349 [debug](http://192.168.50.92/device/edit/153)Battery rawData: 28 Percent: 77

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:30:16.010 [debug](http://192.168.50.92/device/edit/153)refresh() returns [zdo bind 0x2FB1 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0x2FB1 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0x2FB1 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0x2FB1 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0x2FB1 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:30:16.004 [debug](http://192.168.50.92/device/edit/153)configure() returns refresh()

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:30:01.531 [debug](http://192.168.50.92/device/edit/153)Battery rawData: 28 Percent: 77

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:29:53.252 [debug](http://192.168.50.92/device/edit/153)refresh() returns [zdo bind 0x32AD 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0x32AD 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0x32AD 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0x32AD 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0x32AD 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:29:53.247 [debug](http://192.168.50.92/device/edit/153)configure() returns refresh()

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:29:53.240 [error](http://192.168.50.92/device/edit/153)org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: user_driver_circlefield05082_Hue_Dimmer_Switch_v2_Ported_454.addChildDevice() is applicable for argument types: (java.lang.String, java.lang.String, org.codehaus.groovy.runtime.GStringImpl, null, java.util.LinkedHashMap) values: [hubitat, Virtual Button, 32AD:1, null, [completedSetup:true, ...]] (installed)

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:29:53.214 [debug](http://192.168.50.92/device/edit/153)..Creating child 1

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:29:53.194 [debug](http://192.168.50.92/device/edit/153)Creating 4 child buttons

[dev:153](http://192.168.50.92/logs#pastdev153)2021-05-16 18:29:53.193 [debug](http://192.168.50.92/device/edit/153)installed() called

I think there's a problem creating the child devices for each button. With this in the log it only says it's creating 1, with the other code before in the log it says on/off/down pushed, but also that the child devices are not found. This time I don't get the information back that a button was pushed. and it finds 4 devices in total (same screen basicly as posted above).

Looks like it doesn’t like the

[“pushed”, “held”].encodeAsJSON()

Need to play with it a bit...

Edit: Made a few changes - now generating 4 virtual buttons...

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:33:03.167 [debug](http://192.168.50.92/device/edit/154)setReleased()

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:33:02.101 [debug](http://192.168.50.92/device/edit/154)82AE:1 : Hue Dimmer Switch v2.1 Ported On button is pushed

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:33:02.089 [debug](http://192.168.50.92/device/edit/154)On button was pushed

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:33:02.087 [debug](http://192.168.50.92/device/edit/154)Button data : button=1 buttonState=02 buttonHoldTime=01

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:33:01.936 [debug](http://192.168.50.92/device/edit/154)Button data : button=1 buttonState=00 buttonHoldTime=00

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:56.284 [debug](http://192.168.50.92/device/edit/154)Battery rawData: 29 Percent: 88

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:47.920 [debug](http://192.168.50.92/device/edit/154)refresh() returns [zdo bind 0xEBD4 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0xEBD4 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0xEBD4 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0xEBD4 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0xEBD4 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:47.914 [debug](http://192.168.50.92/device/edit/154)configure() returns refresh()

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:33.818 [debug](http://192.168.50.92/device/edit/154)Battery rawData: 29 Percent: 88

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.622 [debug](http://192.168.50.92/device/edit/154)refresh() returns [zdo bind 0x82AE 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0x82AE 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0x82AE 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0x82AE 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0x82AE 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.617 [debug](http://192.168.50.92/device/edit/154)configure() returns refresh()

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.609 [error](http://192.168.50.92/device/edit/154)org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.encodeAsJson() is applicable for argument types: () values: [] Possible solutions: encodeAsBase64() (installed)

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.486 [debug](http://192.168.50.92/device/edit/154)..Creating child 4

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.407 [debug](http://192.168.50.92/device/edit/154)..Creating child 3

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.330 [debug](http://192.168.50.92/device/edit/154)..Creating child 2

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.214 [debug](http://192.168.50.92/device/edit/154)..Creating child 1

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.199 [debug](http://192.168.50.92/device/edit/154)Creating 4 child buttons

[dev:154](http://192.168.50.92/logs#pastdev154)2021-05-17 07:32:25.197 [debug](http://192.168.50.92/device/edit/154)installed() called

Thanks @thebearmay! Now, on the device page I have 4 component devices. The first button push is regocnized and stated correctly (as sometimes before), but the unit keeps blinking orange and no more button pushes are recognized. The other 3/4 devices are still found in the pairing process. And your virtual buttons are also in the Log Overview now (logs stating nothing, except beeing installed).

Missed a encodeAsJson... Fixed that, so hopefully....

dev:1592021-05-17 13:57:50.486 debugsetReleased()

dev:1592021-05-17 13:57:49.447 debugC873:1 : Hue Dimmer Switch v22 Ported On button is pushed

dev:1592021-05-17 13:57:49.444 debugOn button was pushed

dev:1592021-05-17 13:57:49.442 debugButton data : button=1 buttonState=02 buttonHoldTime=00

dev:1592021-05-17 13:57:49.372 debugButton data : button=1 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:48.795 debugC873:2 : Hue Dimmer Switch v22 Ported Up button is pushed

dev:1592021-05-17 13:57:48.792 debugUp button was pushed

dev:1592021-05-17 13:57:48.790 debugButton data : button=2 buttonState=02 buttonHoldTime=00

dev:1592021-05-17 13:57:48.738 debugButton data : button=2 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:48.166 debugC873:3 : Hue Dimmer Switch v22 Ported Down button is pushed

dev:1592021-05-17 13:57:48.159 debugDown button was pushed

dev:1592021-05-17 13:57:48.157 debugButton data : button=3 buttonState=02 buttonHoldTime=00

dev:1592021-05-17 13:57:48.147 debugButton data : button=3 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:47.605 debugC873:4 : Hue Dimmer Switch v22 Ported Off button is pushed

dev:1592021-05-17 13:57:47.601 debugOff button was pushed

dev:1592021-05-17 13:57:47.600 debugButton data : button=4 buttonState=02 buttonHoldTime=01

dev:1592021-05-17 13:57:47.519 debugButton data : button=4 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:46.817 debugsetReleased()

dev:1592021-05-17 13:57:46.791 debugC873:1 : Hue Dimmer Switch v22 Ported On button is pushed

dev:1592021-05-17 13:57:46.787 debugOn button was pushed

dev:1592021-05-17 13:57:46.786 debugButton data : button=1 buttonState=02 buttonHoldTime=00

dev:1592021-05-17 13:57:46.711 debugButton data : button=1 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:45.823 debugsetReleased()

dev:1592021-05-17 13:57:45.797 debugC873:2 : Hue Dimmer Switch v22 Ported Up button is pushed

dev:1592021-05-17 13:57:45.792 debugUp button was pushed

dev:1592021-05-17 13:57:45.791 debugButton data : button=2 buttonState=02 buttonHoldTime=00

dev:1592021-05-17 13:57:45.744 debugButton data : button=2 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:45.708 debugBattery rawData: 28 Percent: 77

dev:1592021-05-17 13:57:44.799 debugC873:3 : Hue Dimmer Switch v22 Ported Down button is pushed

dev:1592021-05-17 13:57:44.794 debugDown button was pushed

dev:1592021-05-17 13:57:44.792 debugButton data : button=3 buttonState=02 buttonHoldTime=00

dev:1592021-05-17 13:57:44.723 debugButton data : button=3 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:44.669 debugsetReleased()

dev:1592021-05-17 13:57:43.614 debugC873:4 : Hue Dimmer Switch v22 Ported Off button is pushed

dev:1592021-05-17 13:57:43.610 debugOff button was pushed

dev:1592021-05-17 13:57:43.609 debugButton data : button=4 buttonState=02 buttonHoldTime=01

dev:1592021-05-17 13:57:43.508 debugButton data : button=4 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:43.021 debugsetReleased()

dev:1592021-05-17 13:57:41.908 debugC873:1 : Hue Dimmer Switch v22 Ported On button is pushed

dev:1592021-05-17 13:57:41.895 debugOn button was pushed

dev:1592021-05-17 13:57:41.893 debugButton data : button=1 buttonState=02 buttonHoldTime=01

dev:1592021-05-17 13:57:41.799 debugButton data : button=1 buttonState=00 buttonHoldTime=00

dev:1592021-05-17 13:57:37.386 debugrefresh() returns [zdo bind 0x736E 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0x736E 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0x736E 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0x736E 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0x736E 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

dev:1592021-05-17 13:57:37.381 debugconfigure() returns refresh()

dev:1592021-05-17 13:57:20.854 debugBattery rawData: 29 Percent: 88

dev:1592021-05-17 13:57:12.461 debugrefresh() returns [zdo bind 0xC873 0x01 0x01 0xFC00 {00178801092592D6} {}, delay 2000, he cr 0xC873 0x01 64512 0 24 30 30 {} {}, delay 2000, zdo bind 0xC873 0x01 0x01 0x0001 {00178801092592D6} {}, delay 2000, he cr 0xC873 0x01 1 32 32 7200 7200 {01} {}, delay 2000, he raw 0xC873 1 0x01 0x0001 {10 00 00 20 00}, delay 2000]

dev:1592021-05-17 13:57:12.369 debugconfigure() returns refresh()

dev:1592021-05-17 13:57:12.232 debug..Creating child 4

dev:1592021-05-17 13:57:12.147 debug..Creating child 3

dev:1592021-05-17 13:57:12.069 debug..Creating child 2

dev:1592021-05-17 13:57:11.982 debug..Creating child 1

dev:1592021-05-17 13:57:11.958 debugCreating 4 child buttons

dev:1592021-05-17 13:57:11.956 debuginstalled() called

Very close! At first I got a response on the device page for all buttons. I tried to use it in the button controllers app and realized that I do not get a response on the device page anymore.

Furthermore, first I tried to simply add this controller in addition to another (old one, which is working). And the app gave me an error, when clicking on the setup for each button: "java.lang.NullPointerException: Cannot invoke method tokenize() on null object on line 561 (selectActions)" I have no idea, if this is relevant though...

I appreciate your help. Thank you so much :slight_smile:

I suspect I may also have to port over the ST Child Button. What app is giving you the NPE error on 561 (might be a command or attribute I need to create in the child button)

Download the Hubitat app