Hoping someone can help my spinoff of the Smart Humidifier smart app. I’m attempting to control my kid’s small room humidifier based on the outdoor ambient temp (Multisensor 6) and the current room humidity level from the indoor hygrometer (another Multisensor 6).
In essence, I’m trying to reduce the amount of condensation on his bedroom windows, yet still keep the humidity levels at respectable levels during frigid Iowa winters from suggestions here:
However, I’m having a tough time accessing the outdoor multisensor’s temperature reading within the humidityHandler(evt) section. I’ve read the docs and googled, but perhaps I’m missing a key search phrase or something.
Thanks!
preferences {
section("Monitor the temperature of which outdoor sensor?") {
input "temperatureSensor1", "capability.temperatureMeasurement"
}
section("Monitor the humidity of which indoor sensor?") {
input "humiditySensor1", "capability.relativeHumidityMeasurement"
}
section("Control Humidifier:") {
input "switch1", "capability.switch"
}
section( "Notifications" ) {
input "sendPushMessage", "enum", title: "Send a push notification?", metadata:[values:["Yes","No"]], required:false
input "phone1", "phone", title: "Send a Text Message?", required: false
}
}
def installed() {
subscribe(humiditySensor1, "humidity", humidityHandler)
subscribe(temperatureSensor1, "temperature", temperatureHandler)
}
def updated() {
unsubscribe()
subscribe(humiditySensor1, "humidity", humidityHandler)
subscribe(temperatureSensor1, "temperature", temperatureHandler)
}
def humidityHandler(evt) {
def currentHumidity = Double.parseDouble(evt.value.replace("%", ""))
def currentTemp = temperatureSensor1.temperatureState
log.trace "Reporting current humidity of $currentHumidity"
log.trace "Reporting current outdoor temp of $currentTemp"
....etc...
}
Full code here: