Refresh command on a Smartthings arrival sensor

devices
presence
hubv2

(mike tarrant) #1

Hi Guys, so far I have got a refresh function taken from the motion sensor refresh, which I appreciate has attributes that the arrival sensor doesnt and vice versa. I have put the functions in question at the bottom of the post. Does anyone know what the correct command would be to refresh the lqi and rssi values and which attributes I need to strip? I have also posted the debug outputs at the bottom.

def refresh() {
    log.debug "refresh called"
    def refreshCmds = [
        "st rattr 0x${device.deviceNetworkId} 1 0x402 0", "delay 200",
        "st rattr 0x${device.deviceNetworkId} 1 1 0x20", "delay 200"
    ]

    return refreshCmds + enrollResponse()
}

def enrollResponse() {
    log.debug "Sending enroll response"
    log.debug "decoded hex: ${device.hub.zigbeeEui.decodeHex()}"
    log.debug "non decoded hex: ${device.hub.zigbeeEui}"
    String zigbeeEui = device.hub.zigbeeEui
    [
        //Resending the CIE in case the enroll request is sent before CIE is written
        "zcl global write 0x500 0x10 0xf0 {${zigbeeEui}}", "delay 200",
        "send 0x${device.deviceNetworkId} 1 ${endpointId}", "delay 500",
        //Enroll Response
        "raw 0x500 {01 23 00 00 00}",
        "send 0x${device.deviceNetworkId} 1 1", "delay 200"
    ]
}

Logs:

    0c0e222c-1825-471a-9237-016f09be34d4
	16:47:01:
	debug
	Parse returned catchall: 0104 0402 01 01 0040 00 4084 00 00 0000 01 01 000086

	0c0e222c-1825-471a-9237-016f09be34d4
	16:47:01:
	debug
	Parse started with description catchall: 0104 0402 01 01 0040 00 4084 00 00 0000 01 01 000086

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:57:
	debug
	Parse returned read attr - raw: 408401000106200086, 
dni: 4084, endpoint: 01, cluster: 0001, size: 06, attrId: 0020, result: 
unsupported attr

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:57:
	debug
	Parse started with description read attr - raw: 
408401000106200086, dni: 4084, endpoint: 01, cluster: 0001, size: 06, 
attrId: 0020, result: unsupported attr

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:52:
	debug
	Parse returned catchall: 0104 0402 01 01 0040 00 4084 00 00 0000 01 01 000086

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:52:
	debug
	Parse started with description catchall: 0104 0402 01 01 0040 00 4084 00 00 0000 01 01 000086

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:43:
	debug
	Parse returned catchall: 0104 0402 01 01 0040 00 4084 00 00 0000 01 01 000086

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:43:
	debug
	Parse started with description catchall: 0104 0402 01 01 0040 00 4084 00 00 0000 01 01 000086

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:31:
	debug
	non decoded hex: D052A87273E50001

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:31:
	debug
	decoded hex: [-48, 82, -88, 114, 115, -27, 0, 1]

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:31:
	debug
	Sending enroll response

	0c0e222c-1825-471a-9237-016f09be34d4
	16:46:31:
	debug
	refresh called