SmartThings Community

Is there a way to force a sensor to respond even if the value hasn’t changed?

(Jimmy) #61

The checkinterval needs to be adjusted based on your minimum. If you don’t want to see temperature reports more frequently than every 5 minutes, set the minimum to 300. The check interval should then be set to the devices minimum check-in time, doubled plus a buffer. That’s why you see it as an equation.


So based on that I will change the minimum to 3600 (1 hour) and maximum to 14400 (4 hours) and then adjust the checkInterval to 7200 (twice the minimum). Showing all that below. Does that look right to work?

def configure() {
	// Device-Watch allows 2 check-in misses from device + ping (plus 1 min lag time)
	// enrolls with default periodic reporting until newer 5 min interval is confirmed
	sendEvent(name: "checkInterval", value: 2 * 7200 * 7200 + 1 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])

	log.debug "Configuring Reporting and Bindings."

	// temperature minReportTime 30 seconds, maxReportTime 5 min. Reporting interval if no activity
	// battery minReport 30 seconds, maxReportTime 6 hrs by default
	def manufacturer = device.getDataValue("manufacturer")
	if (manufacturer == "Heiman"|| manufacturer == "HEIMAN") {
		return refresh() +
		        zigbee.temperatureConfig(30, 300) +
		        zigbee.configureReporting(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0021, DataType.UINT8, 30, 21600, 0x10) +
		        zigbee.configureReporting(0x0405, 0x0000, DataType.UINT16, 30, 3600, 100, [destEndpoint: 0x02])
	} else {
		return refresh() +
		        zigbee.configureReporting(0xFC45, 0x0000, DataType.UINT16, 3600, 14400, 100, ["mfgCode": 0x104E]) +   // New firmware
		        zigbee.configureReporting(0xFC45, 0x0000, DataType.UINT16, 3600, 14400, 100, ["mfgCode": 0xC2DF]) +   // Original firmware
		        zigbee.batteryConfig() +
		        zigbee.temperatureConfig(3600, 14400)

(Jimmy) #63

you want value: 2 * 3600 + 1 * 60


copy that, punching it in now!


So put it in and updated looked like it took. Looking at the device info i noticed the stated checkinterval changed though, see attached. S

omething to worry about?

(Jimmy) #66

ah, looks like that device uses the checkinterval set in the parse() method. update it there.


revert the other code back or leave it modified?

(Jimmy) #68

you can just leave it


looks like all is set now. wait another night overnight and see what comes out of it. you guys have been awesome!


Still have devices going offline, see attached for 2x similar sensors running this code.


How about setting checkinterval based on your max reporting time? Right now, it’s set to report every 1 to 4 hours, but shows offline after 2 hours. Bump checkinterval up to 8 hours and it should keep showing online unless you miss at least two consecutive reports.

(Jimmy) #72

Ah, yes. It should be 2x max plus 1 minute.


updating now and seeing how it goes overnight!


just wanted to report back that all seems to be working great! Updates with values every 4 hours, maintains connection in the app. Thanks to all who helped this noob along!