Two Multisensor 6's - How to capture humidity for indoor sensor and temp of outdoor sensor?

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.


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() {
	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"

Full code here:

Condensation on the window is related to the fact the cold window pane is at or below the dew point of the more humid indoor air, not the humidity outside. If you have cold glass the only way for them not to condensate is to have dry air inside. You might consider double or triple pane windows, which of course is the expensive route, stick something on the sill to catch the moisture, or just not worry about it. An ideal humidity level is really between 50 and 60 percent to help fend off colds and flu. It has been shown that very dry air encourages the progression of the two. Gotta keep that snot moving! At the same you don’t want the air too humid or you encourage mold growth.

Sorry i know that is the code based answer you were after. I haven’t made any smart apps yet just device types including the one for the multi 6. I might take a look at it later though as I could see the application for other things like fresh air control dampers.

I would recommend the following changes:
def currentHumidity = evt.value.toDouble()
def currentTemp = temperatureSensor1.latestValue(“temperature”)

Here is more information on latestValue:

@ritchierich - Thanks for the suggestion. Now in the live logging I get a warning:

8827f9a9-23e4-43e3-b0e9-9d7967bea654 11:49:46 AM: warn No event handler found for temperature event 'zw device: 14, command: 9881, payload: 00 31 05 01 2A 01 50'

Do you have any thoughts on why that might be? Do I need to declare that outside multisensor as another device handler? How might that look?

This line expects a function called “temperatureHandler”. Do you have that function defined? I believe that is what is causing the error as I don’t see it in your code above.