Help Modifying SmartSense Motion DH

I just got 4 Iris motion/temp sensors but they only update changes on every full degree and I am in Canada and would like to see the .5 degree changes, not just the full degree. When I manually refresh I see 20.65C so the device can do it, but the auto-refreshes only happen on the full degree. Looks like these sensors are using the Smart Sense Motion device handler. Can anyone point me to where I can edit the code to make a custom DH so it updates (and displays) in .5C increments?

Thanks in advance

Hi @Xtropy,

In regards to seeing changes on more decimal positions, you could experiment with these lines of code:

return celsius for line 222

and

return celsiusToFahrenheit(celsius) for line 224

I’m not sure how many decimal positions that would display, but it’ worth a shot. Maybe that change will cause it to report the way you want?

EDIT: Looks like it goes out 3 decimal positions. I just tried that change on one of my devices. You could change those lines for 2 positions by using this (I didn’t test this):

def xcelsius = (celsius.toFloat()/1).round(2)
return xcelsius

def xcelsiusToFahrenheit = (celsiusToFahrenheit(celsius).toFloat()/1).round(2)
return xcelsiusToFahrenheit

I changed to this but didn’t help. Did I change the correct lines? Starting at 219

def getTemperature(value) {

def xcelsius = (celsius.toFloat()/1).round(2)
return xcelsius

def xcelsiusToFahrenheit = (celsiusToFahrenheit(celsius).toFloat()/1).round(2)
return xcelsiusToFahrenheit

}

Looks like it, yes. Those are lines 222 and 224.

Time to phone-a-friend. @mitchp or @Sticks18, any ideas you can think of?

Well I played around and changed to the following code:

Lines 210-217

def getTemperature(value) {
	def celsius = Integer.parseInt(value, 16).shortValue() / 100
	if(getTemperatureScale() == "C"){
		return celsius
	} else {
		return celsiusToFahrenheit(celsius) as Integer
	}
}

Lines 258-264

private Map getTemperatureResult(value) {
	log.debug 'TEMP'
	if (tempOffset) {
		def offset = tempOffset as BigDecimal // **************** was as int ***************
		def v = value as BigDecimal // **************** was as int ***************
		value = v + offset
	}

Everything looks great during a manual refresh but whenever polling/auto refresh is done, it rounds up again to an Integer. Very frustrating.

Suggestions anyone?