Displaying Temperature instead of Motion in SmartApp


(Robin) #3

Using this handler as a template:

Change line 114:

main([“status”, “acceleration”, “temperature”])

To:

main([“temperature”, “acceleration”, “status”])


#4

you are correct. I use the native app on an Android device and on an iOS device.


#5

Just implemented what was provided, and it works like a champ. I appreciate the quick response.
Thanks


#6

Robin - I’ve implemented your solution (e.g. creating and using a new DH, and changing line 114 as you described), yet the tile in the SmartThings app still shows the status versus the temperature. In the year since this topic was addressed, has anything changed that would be cause for an alternative solution?


(Ron Talley) #7

I’ve been meaning to do some maintenance on my setup and this was on the list. I did the method as listed above it still works for me.


#8

Ron - Thank you. I’m stumped.

I’ll provide more information with the goal of finding the issue.

For completeness, my SmartThings Multipurpose Sensor is showing as “model: multiv4.” Perhaps I am using a different model.

I made minimal changes in using a self-published DH based on the default DH. Please see below.

//	2018-06-03 Re-named to SmartSense Multi Sensor - Temperature and set runLocally to false

//	Original Code
//	definition(name: "SmartSense Multi Sensor", namespace: "smartthings", author: "SmartThings", runLocally: true, minHubCoreVersion: '000.017.0012', executeCommandsLocally: false, mnmn: "SmartThings", vid: "generic-contact-2") {

// 	New Code
	definition(name: "SmartSense Multi Sensor - Temperature", namespace: "smartthings", author: "SmartThings", runLocally: false, minHubCoreVersion: '000.017.0012', executeCommandsLocally: false, mnmn: "SmartThings", vid: "generic-contact-2") {

And

//		2018-06-03 Swapped position of temperature and status in main and details

//		Original Code
//		main(["status", "acceleration", "temperature"])
//		details(["status", "acceleration", "temperature", "battery", "refresh"])

//		New Code
		main(["temperature", "acceleration", "status"])
		details(["temperature", "acceleration", "status", "battery", "refresh"])

Despite using the revised DH, the sensor still shows the Open/Closed status versus the current Temperature in the Dashboard and under Devices in the SmartThings app.


(Robin) #9

Change to:

main(["temperature"])


#10

Robin - Yes, I have also tried that solution without success. I have also tried limiting both main and details to temperature.

//		2018-06-07 Removed acceleration and status from main

//		Original Code
//		main(["status", "acceleration", "temperature"])
//		details(["status", "acceleration", "temperature", "battery", "refresh"])

//		New Code
		main(["temperature"])
		details(["temperature", "acceleration", "status", "battery", "refresh"])

I save and self-publish the new DH and ensured the sensor is using the “SmartSense Multi Sensor - Temperature” DH.


(Ron Talley) #11

Are you sure you are changing the device type in the device settings in the IDE?


#12

Yes, based on what I see in the IDE; screen shot embedded here.

Capture


(Robin) #13

Are you clicking publish > for me, after updating the code?


#14

Robin - Yes, I am using Publish - For Me.

I’ve noticed one difference between my code and the prior recommendations: “runLocally: true” versus “runLocally: false” (or omitting this variable).

I’m unable to set runLocally: true; it prompts the error message: “org.springframework.security.access.AccessDeniedException: Run Locally Permission not allowed for DeviceType” … .

I am still stumped otherwise. The sensor is reporting data properly, and I have tried removing it and re-adding it without the desired outcome.


(Robin) #15

Don’t suppose you accidentally made a duplicate handler with the same name? And have the device set to the unchanged duplicate?


#16

I was optimistic that this could be the issue. I’m disappointed to report otherwise. I restored the device to its original DH; deleted my custom DH; then created, published, and assigned the custom DH (with new name) to the device.

I used a document compare function to compare the default DH with my custom DH and confirmed the only differences are exactly as documented previously.


#17

SOLVED. Based on the thread below, I’ve learned that custom DH do not work in the version of the SmartThings app that I am using. Ouch.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #18

Oh… You could have saved everyone a lot of time by starting with this fact. :wink:.

Seriously … There are very few reasons to use the new SmartThings App… yet.

If I could change the universe, I would make it disappear - until it was actually ready and had feature parity with SmartThings Classic.


(J Tr Nj) #19

After reading this thread and others - here is an updated answer. I had many issues editing the device handler and getting it to work with the new Smartthings app. I am using the NEW Smartthings App on an iPhone and I too want to see just the temp reading on the Dashboard view of the mobile app using a Smartthings Multi Sensor. I removed the sensors from my devices first. Then I re-added them and renamed them via the new mobile app. Then in the IDE desktop app- I edited the Device and selected 'SmartSense Temp/Humidity Sensor" from the Published list (don’t pick SmartSense Multi Sensor) then Save. It works fine- My New Smarthings App shows the Temperature right on the Dashboard Tile.
image


(Gene Clark) #20

@RobinWinbourne wondering if you can shed some light on why I may be getting the following error when trying to make this modification to handler. I’d like to display temperature instead of open/closed status in main view. All I did was swap temperature and status on line 115. Here’s my handler code as well.


(Robin) #21

I would hazard a guess that you have the webCoRE dashboard open in a tab on the same browser.

Try running the IDE in an incognito browsing tab or a different browser to the one webCoRE is running on.


#22

In the definition line, change runLocally to false.