Wow thanks for the thorough reply. I just got this today so it’s nice to know so much code is on github. Easier to figure out what was going on.
In Canada, that $9 can of CO2 test costs $44!!!
This may be a bit old…
I used the code above and noticed that I still only have 1 icon (Says clear - and shows a battery level)
listed under the device.
Does anyone else have this happen or do most people see the 3-4 icons?
This is the 3+ icons that I would like to have if possible
Hi @impact,
Version 2 of the mobile app changed all that now.
SmartApps is a tab.
Activity is a tab called Recently.
Preferences is now the gear in the upper right corner.
Remove is now within Preferences.
it would present a more “polished” look and feel if ST would put a little more into the DHL to show a separate Smoke and CO tile.
If this is seeing the zcombo as a CO detector, then why can’t I select it as a sensor for the “CO2 Vent” SmartApp under the Safety and Security section? And did they mean “CO2” or “CO”?
I’m sure the developer meant CO. I made the same mistake too.
ST’s device type for the zcombo has “capability "Carbon Monoxide Detector"
” defined, so if the smartapp is properly looking for that capability it should find it. Here’s more information on the capabilities the app should be using:
http://docs.smartthings.com/en/latest/capabilities-reference.html#id151
I tried finding the ST source code for that app on Github, which looks like @Dianoga may have originally wrote (perhaps before joining ST?). I was hoping to dig into the code, but no luck.
@Dianoga, is that code anywhere where we can see it?
CO2 vent was probably one of mine from long ago. And it was specifically for Carbon Dioxide (CO2). I was using it with the Netatmo.
I’m not sure where the code is. I don’t see it in any of the usual places.
Thanks @Dianoga for the clarification, I thought I was going crazy. If you happen to find that code would you mind sharing? I’d like to adapt that to a CO detector to have it function similarly. Thanks!
Found it. I have no idea if it still works, but you’re welcome to play with it.
/**
* CO2 Vent
*
* Copyright 2014 Brian Steere
*
* 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.
*
*/
definition(
name: "CO2 Vent",
namespace: "dianoga",
author: "Brian Steere",
description: "Turn on a switch when CO2 levels are too high",
category: "Health & Wellness",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png"
)
preferences {
section("CO2 Sensor") {
input "sensor", "device.netatmoBasestation", title: "Sensor", required: true
input "level", "number", title: "CO2 Level", required: true
}
section("Ventilation Fan") {
input "switches", "capability.switch", title: "Switches", required: true, multiple: true
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
initialize()
}
def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
initialize()
}
def initialize() {
state.active = false;
subscribe(sensor, "carbonDioxide", 'handleLevel')
}
def handleLevel(evt) {
def co2 = sensor.currentValue("carbonDioxide").toInteger()
log.debug "CO2 Level: ${co2} / ${settings.level} Active: ${state.active}"
if(co2 >= settings.level && !state.active) {
log.debug "Turning on"
switches.each { it.on(); }
state.active = true;
} else if(co2 < settings.level && state.active) {
log.debug "Turning off"
state.active = false;
switches.each { it.off(); }
}
}
can you tell me how to view the code after a test to confirm it has actually tested both smoke and CO?
Hi @sscopp , this discussion is 6 years old now, and a lot has changed. Device handlers are no longer used, but instead Edge drivers are used. The IDE’s live logging (where to see live events from devices) is also gone, and now the CLI is where that’s done. The code for Edge drivers is still on Github though.
Thanks for the prompt reply. Yes, I know all is or has moved to local edge drivers. The edge driver on github is only listed as a First Alert smoke alarm, not the z combo I have that does both smoke and CO. If I were to try this driver, how do I remove it from the hub so I could go back to the one i am currently using? Will the old one, the one currently in use, be listed in the “Select a Different Driver” section?
I don’t know what CLI stands for. Please clarify.
Thanks
Steve
CLI instructions.
Ok, cool I wasn’t sure. I have two zcombo detectors running ST’s Edge driver, and I know for sure the smoke part works. I haven’t tested in a while, but I recall the test called out CO as well:
If the one you are currently using is an Edge driver you’ve installed on your hub, then you will be able to select it again, but if it’s a DTH there’s no going back (plus you’ll be migrated anyway eventually).
To remove an Edge driver, find your hub in the mobile app. Once there, tap on the three dots in the upper right and select Driver. All drivers installed on your hub will be listed. Find the one you want to remove and tap on the blue delete button, but make sure no device is using the driver
The CLI is a new interface similar to the IDE, but it’s all command line based, not browser based like the IDE was. It’s yet to be seen what ST will replace the IDE with, or if we’re stuck with the CLI. Here are two useful discussions, especially the SmartThings API Browser tool:
CLI (just one of many)
Thanks for this information. I was able to get this working and can see the real time logs from the devices.
Yes, that’s the same image in my zcomb smoke co devices. I have 5 total all using the exact same driver. However, when the test button is pressed, on 2 the history lists smoke tested, then co tested, then smoke clear then co clear. On the other three it only displays the smoke tested and smoke clear. No listing for CO. Those three are newer than the other two. I called first alert and they said they should all function the same, however, this issue would be a smartthings issue.
Can you set yourself up with the SmartThings API Browser I linked above? Once you do that, check to see if there’s a difference between with them specifically with Mfg Code and Model.
Here’s how to find that. Go to the API browser tool, and click on Devices → Devices:
Next, find your device in the list and click on it:
Next, click on Details and then the table below will show up:
If there is a difference, ST may have to add that model to their driver. If there’s no difference, it could be the device did not get properly configured when it joined, which means removing it from ST and rejoining it back to your hub, OR selecting a new driver (we’ll cross that bridge if needed later).