Pulling Temperature reading to Virtual Temperature Device


#1

Tried everything on the forum but nothing is working. Any ideas on how to achieve this? I tried most methods and best I got so far was with custom Device Handle and Child/Parent app. All works but the value never updates the temp reads 0.


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

If you only have a simple, single or few manually created “Virtual Temperature Device” instances, then the simplest solution is to just add a trivial SmartApp that subscribes to your source device(s) and runs a Command on the Virtual Device to have it update it’s own Temperature Attribute.

Can you describe your full real-world use case in more detail?


#3

I’ve done this before by creating a virtual temperature device and a SmartApp that let’s you use 1 or many physical devices (which averages them).

Here’s the code for the virtual device:

https://raw.githubusercontent.com/constjs/jcdevhandlers/master/devicetypes/jscgs350/my-virtual-temp-tile.src/my-virtual-temp-tile.groovy

Here’s the SmartApp:

Parent:
https://raw.githubusercontent.com/constjs/jcdevhandlers/master/smartapps/jscgs350/virtual-temp-device.src/virtual-temp-device.groovy

Child:
https://raw.githubusercontent.com/constjs/jcdevhandlers/master/smartapps/jscgs350/virtual-temp-device-child.src/virtual-temp-device-child.groovy

Create your virtual device first, and then install the app. This worked for me for years. As soon as any of the physical device(s) updated the temp reading, the virtual would update as well.


#4

You are right this method works. I just needed to wait a couple of hours for it to update.