Update status of device

Good debugging info, but I can’t see anything wrong with it, sorry.

I found out these huge and messy logs when I toggle the the device and press refresh button on the app. This whole log happens each time I do that. Does this tell me something?

This is the code that refreshes the device status except only when I press the refresh button on the app. I’d also take a look at this site: http://docs.smartthings.com/en/latest/device-type-developers-guide/zigbee-example.html.

def refresh() {
zigbee.onOffRefresh() + zigbee.onOffConfig()
/return zigbee.readAttribute(0x0006, 0x0000) +
zigbee.readAttribute(0x0008, 0x0000) +
zigbee.configureReporting(0x0006, 0x0000, 0x10, 0, 600, null) +
zigbee.configureReporting(0x0008, 0x0000, 0x20, 1, 3600, 0x01)
/
}

def configure() {
log.debug “Configuring Reporting and Bindings.”
zigbee.onOffConfig() + zigbee.onOffRefresh()
/return zigbee.configureReporting(0x0006, 0x0000, 0x10, 0, 600, null) +
zigbee.configureReporting(0x0008, 0x0000, 0x20, 1, 3600, 0x01) +
zigbee.readAttribute(0x0006, 0x0000) +
zigbee.readAttribute(0x0008, 0x0000)
/
}

I misunderstood your question. If Zigbee is involved then you need to parse messages arriving from it to determine if a change of state happened. This should all happen in the parse() method. Then you use the sendEvent to adjust the new state. But the events must come from the Zigbee side

1 Like

Try adding the following above the sendevent line.

event.isStateChange = true

1 Like

For sure my device sends out the events because that’s how I’m able to get an update on status in the app except only when I press the refresh button. Unfortunately adding, “event.isStateChange = true”, didn’t help and I still have to press the refresh button on the app to see an update in status. What else could I try?

I recommended that because I thought it was writing to the log when you flipped the switch, but not refreshing in the UI. If it’s not sending the command, I’m not sure if there’s anything you can do.

1 Like

Were you able to figure this out? I am having the same problem in that my dimmer won’t change state if it is manually turned off or on.

If it’s a zigbee device you should be able to configure the reporting interval so that it automatically reports the current state, it just won’t be immediate.

Device Handlers now support scheduling so if it’s a zwave device you can manual request a report at a regular interval.

Thanks for the info.

Do you have a suggestion on where to get information on how to manually request the interval?

Thanks again,
Chet

Which device?

Z wave dimmer switch

Add the following lines to the “updated” method.

unschedule()
runEvery5Minutes(healthPoll)

Add the following method below the “updated” method’s closing bracket.

def healthPoll() {
	sendHubCommand(new physicalgraph.device.HubAction(zwave.basicV1.basicGet().format()))
}

If it doesn’t work with basicGet() you might have to use switch binary which would look like:

zwave.switchBinaryV1.switchBinaryGet().format()