/** * Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*
* Author: mark
* version 2 user defineable timeout before checking if door opened or closed correctly. Raised default to 25 secs. You can reduce it to 15 secs. if you have custom simulated door with < 6 sec wait.
*/
definition(
name: "tempHandler",
namespace: "Mark-C-uk",
author: "Mark Cockcroft",
description: "Simulated thermostats",
category: "Convenience",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/garage_contact.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/garage_contact@2x.png"
)
preferences {
section("Choose the thermstat to provide reading"){
input "tempin", "capability.temperature", title: "temp provider", required: true
}
section("Choose the Virtual thermostat"){
input "tempout", "capability.temperature", title: "temp reciver", required: false
}
}
def installed() {
installer()
}
def updated() {
unsubscribe()
installer()
}
def installer(){
def Tin = tempin.currenttemperature
def Tout = tempout.currenttemperature
subscribe(tempin, "temperature", tempHandler)
log.debug "updated ... temp of $Tin is $tempin and $tempout is $Tout"
// if (Tin != Tout) { // sync them up if need be set virtual same as actual
// tempout.temperature("$tin")
// }
}
def tempHandler(evt){
//testing
log.debug "$evt.unit"
log.debug "evt.value"
//tempout.temperature("$tin")
}
DH
/**
* virttemp
*
* Copyright 2019 Mark Cockcroft
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*/
metadata {
definition (name: “virttemp”, namespace: “Mark-C-uk”, author: “Mark Cockcroft”, cstHandler: true) {
capability “Temperature Measurement”
}
@mark_cockcroft I just sorta discovered your work with simulated devices (and I LOVE it!) and I set up the temp handler. It works great in the old app and if you tap on the device itself in the new app. But on the main screen of the new app, it always just says “checking status”. Have you run into this and/or do you have any suggestions?
As an aside, it also shows the celsius symbol in the new app even though the temps are in fahrenheit and I didn’t see any place to change this (not a big deal, just thought I’d mention it in case you had some thoughts about it)
@mark_cockcroft Great SmartApp and DH, exactly what I searched for.
But, I got the same problem in the New Smartthings App as @doncaruana.
The tile just shows "checking status, do you or anybody else have a suggestion how to solve it?