Can the SmartThings hub receive a temperature from a device and transfer it to another device?

Hi there,

Is is possible, in a SmartThings environment, one way or another, to
have a temperature being sent from one device to another through the
SmartThings hub?

Can the SmartThings hub receive a temperature from a device and transfer it to another device?

These are the answers I’m looking for.

In my case, I want a thermostat to display the outdoor temperature.

I’m looking for a way to tell SmartThings to take temperature from device A and send a temperature report to device B.

You could definitely do that with a SmartApp if you have one device with a temperature attribute and another device with a setTemperature command.

2 Likes

Do you have any code example on how to pass a temperature to another device?

Basically, in your SmartApp, you will subscribe to the temperature of the source device (ex. subscribe(sourceDevice, "temperature", tempChanged)), then in tempChanged, call some method on the destination device to set its temperature (ex. destDevice.setTemperature(newTemp)). You may want to take a look at the basic SmartApp documentation, then it should be pretty straightforward - http://docs.smartthings.com/en/latest/smartapp-developers-guide/index.html

3 Likes

Thank you Brice.

I will work on that.

By the way, do you know how to format a message to go out?
I have something like this:
zwave.sensorMultilevelV3.sensorMultilevelReport(sensorType: 1, scale: deviceScale, precision: p, scaledValue: convertedDegrees).format()

but in the log window, I get this error:
error
groovy.lang.MissingPropertyException: No such
property: scaledValue for class:
physicalgraph.zwave.commands.sensormultilevelv3.SensorMultilevelReport @
line 553

Where can I find the properties for that message?

@obycode
Another question:

I have set the following preference

preferences {
input"outTemp", “capability.temperatureMeasurement”, title: “Select an outdoor sensor”
}

When I press the “Preferences” button on the the mobile app, there is a section “Select an outdoor sensor” as desired.
But when I press that button, it brings me to a screen where it says “No device to connect”.

However, I do have a multi-sensor included on the SmartThings hub.

Why is my sensor not shown on the list?

The sensor is an AEOTEC MultiSensor Gen5

This one is outside of my expertise. We’ll need someone else to chime in about z-wave details…

I’m not sure. The MultiSensor Gen 5 device type is defined with capability “Temperature Measurement”, so it should show up.

1 Like

What Device Handler (Smart Device Type) are you using for the sensor?

@JDRoberts, I’m not sure about your question…

The Outdoor sensor I’m using is the MultiSensor Gen5 from AeonLabs and its device type or device handler is “Aeon Multisensor Gen5” it’s the one that comes in default when I include the sensor to SmartThings.

Am I answering your question right?

Yes, that’s the answer. I can’t read groovy code, can someone check the IDE and see if the supplied device handler includes the Sensor capability?

I found the answer to my error regarding the sensorMultilevel3Report. the variable scaledValue does not exist, instead there is a scaledSensorValue variable…

https://graph.api.smartthings.com/ide/doc/zwave-utils.html#sensorMultilevelV5

1 Like

@JDRoberts

Yes the multisensor I used does have the Sensor capability

metadata {
definition (name: “Aeon Multisensor Gen5”, namespace: “smartthings”, author: “SmartThings”) {
capability "Motion Sensor"
capability "Temperature Measurement"
capability "Relative Humidity Measurement"
capability "Illuminance Measurement"
capability "Configuration"
capability "Sensor"
capability “Battery”

    fingerprint deviceId: "0x0701", inClusters: "0x5E,0x86,0x72,0x59,0x85,0x73,0x71,0x84,0x80,0x30,0x31,0x70,0x98,0x7A", outClusters:"0x5A"
}
1 Like

I think it’s been covered here… @April can you merge these two topics pls :wink:

2 Likes

Are you trying to the thermostat setpoint value or are you trying to change the current temperature value displayed by the thermostat?

I’m trying to display the sensor temperature on the thermostat display.
The sensor is meant to be an Outdoor Sensor.
I want the thermostat to display the outdoor temperature, therefore the thermostat needs to receive a Z-Wave command containing the temperature from a remote sensor.

Usually you would structure this like so:

  1. first, both the sensor and the thermostat have to be networked devices known to SmartThings. (A “device” could also be a web service.)

Each has their own individual device handler.

  1. you write a smartapp (not a device handler) that subscribes to changes in temperature from the sensor device.

  2. when that smart app is triggered by the change in temperature on the sensor device, it sends a display value to the thermostat.

Provided the physical thermostat device will accept an appropriate command to display that value, it will work.

You can think of this as being similar to the situation where you use a motion sensor to turn on a light.

Both the motion sensor and the light have their own device handler, and both are known to SmartThings.

A smart app subscribes to the events of the motion sensor, and then sends the turn on command to the light.

In some of your previous code, you have been trying to combine the two devices into one device handler, and it won’t work that way.

Logically, smartthings is having two conversations: One with the sensor, and one with the thermostat. It’s the smart app that is talking to both, taking information in from the sensor through an event subscription and sending information out to the thermostat.

  1. Alternatively, you could have the smart app poll the sensor for the temperature periodically, and then use the same set command to update the thermostat. But you would still have two separate device handlers.

Two devices, two device handlers, and one smart app talking to both devices.

(Of course, all of this assumes that the physical thermostat has been manufactured to accept an update command that will change the displayed value on the thermostat, not all thermostats will do this.)

@JDRoberts,

Yes, this somewhat describes what I want to do.
The thermostat is designed to accept a Z-Wave command with a remote temperature.

My question is the following:
In the SmartApp, what command should be used to send the temperature to the thermostat?

I have been looking in the commands list based on the capabilities, but I didn’t found any command that actually sends the temperature to another device.

You wrote the following:

You can think of this as being similar to the situation where you use a motion sensor to turn on a light.

Both the motion sensor and the light have their own device handler, and both are known to SmartThings.

A smart app subscribes to the events of the motion sensor, and then sends the turn on command to the light.

In this example, the SmartApp would use the switch.on() command.

But is there a “sendTemperature” command somewhere?

  1. when that smart app is triggered by the change in temperature on the
    sensor device, it sends a display value to the thermostat.

This is the part where I need guidance… how do I send a display value to the thermostat?

1 Like

What specific command is the thermostat expecting? And what is the device class in the conformance statement?