MCOHome MH9 CO2/Temp/RH Sensor Device Handler

A few months back I bought a MCOHome MH9 Z-Wave sensor for my lounge. It’s basically a mains powered CO2, Temperature, and Humidity with a display.

http://www.mcohome.com/show_list.php?id=15&sid=51

Like an idiot, I forgot to check if it had a DH, and the company doesn’t seem interested in helping.
So at long last, I have gotten around to trying my hand at a DH. I am not a programmer but do have some idea, however, I seem to have fallen already and need some help, please!

The Unit is already connected to my Z Wave network and I have the Raw Description:

networkSecurityLevel: ZWAVE_LEGACY_NON_SECURE
zw:L type:2101 mfr:015F prod:0901 model:3102 ver:1.04 zwv:3.67 lib:05 cc:31,9E,70,71,85,72,86

I don’t believe I have a problem with metadata or tiles but my next hurdle is to view the “parse data” so I can decide what data I need to extract.

I managed to copy/paste/modify the following together in the hope it would dump that data into the log:

def parse(String description) {
def result = null
def cmd = zwave.parse(description, [0x31: 3])
if (cmd) {
result = zwaveEvent(cmd)
log.debug “Parsed {cmd} to {result.inspect()}”
} else {
log.debug “Non-parsed event: ${description}”
}
return result
}

def zwaveEvent(physicalgraph.zwave.Command cmd) {
return createEvent(descriptionText: “{device.displayName}: {cmd}”)
}

This returns:

Parsed BasicReport(value: 92) to [‘descriptionText’:Sensor - Lounge CO2: BasicReport(value: 92), ‘linkText’:‘Sensor - Lounge CO2’, ‘isStateChange’:false, ‘displayed’:false]

I don’t understand why its only giving me CO2 readings and not Temperature and RH as well. I am not sure if the code above is wrong or if I need to change the unit set up in some way ( I am pretty sure its setup by default to transmit all the readings when they change).

All I am after is the 3 values been displayed (no setup and battery isn’t necessary) so I can use them in Webcore to trigger some events and InfluxDB so I can display them using Grafana. I don’t care if they are received at set intervals or when they change as I can deal with either.

Any help appreciated. Thanks
Neil

id suges monioring for a while, or change location, most devie only send data when a change occurs, so unless there is significant temp or humidity change you wont see anthing

also looking at you code, the Non-parsed events will show on the log.debug but not in the event only the cmd defined at the begining will

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.