[RELEASE] Contact Sensor as Smoke or Carbon Monoxide (CO)

devicetype
dth_sensors

(Allan) #1

I made two modification of the standard Z-Wave Contact device so it can be used as a Smoke or a Carbon Monoxide sensor for those that are hard wiring their sensors in. The smoke device type also will appear in Smart Home Monitor as a available device. I did this because of recently adding my Kidde Smoke & CO sensors into some contact switches project I did here:

Either pull from the GitHub or add my GitHub to your IDE. Hopefully someone finds them useful.

GitHub: vseven - SmartThings_VSeven - master


Integrating Kidde Smoke / CO Sensors into SmartThings Properly
Integrating Kidde Smoke / CO Sensors into SmartThings Properly
(Tim Danks) #2

Hi Vseven,

Just tried this using Ecolink Door sensor and Smoke code in this chain creating the device handler. It seems to work but for some reason the state/status does not change in the tiles and battery shows as “–”. I was able to add to SHM and it does trigger the events and activity shows up but the tile or right now status never changes from “Clear”? I basically paired the device as the Ecolink Door sensor then edited the device type in the My Devices tab to the new device type. Like I mentioned it recognizes the changing state but doesn’t update the device status. Did I miss something?

Tim/


(Allan) #3

Are you pulling from GitHub or copying and pasting whats above? If from GitHub it should be working correctly (there were some tweaks thanks to another member) but the above might be outdated.

Also with the sensors if you read my original thread I had issues pulling them in. I would try to remove them, exclude them from the network, make sure you are within a couple feet of your hub, and add them back in. Once back in reassign my device type and it should come up correctly with a status and battery level.


(Tim Danks) #4

Thanks. I did cut and paste from above “release” but can get from github. How do I find it in Github? Both Smoke and CO.


(Allan) #5

Ok. So first clean it out. Remove the sensor from SHM then go into the IDE and switch the EcoLink devices back to the default handler or any generic door/window contact handler. Then go to My Device Handlers and delete out the old custom device. Click Settings and add a repository with the above information. Then on that same page click Update from Repo -> Smartthings_VSeven. Under the New should be both my handlers. Select both, check the Publish checkbox, and Execute Update. Then go into your devices and reassign to the new one.

Let me know if you have any issues and/or if it worked correctly. You should get a Clear/Alarm status along with the battery level.

-Allan


(Tim Danks) #6

Thanks Allan, Did all that and have linked and published your Repo in my Device Handlers. Even removed the actual device and re-paired. With default device handler I get battery level and status changes when open/close contact. Everything works as expected. Changing to your handler I do get battery level now but the “Right now” status never changes from “clear” with gray background in the UI. If I go to “Recently” it does show the status changes as I open/close the contacts just not in the “Right Now” tiles or under “MyHome/Things” tab in the UI. Tim/


(Tim Danks) #7

BTW, I am using magnet as the trigger for open/close of contacts fro testing as I have not built the other part yet.


(Allan) #8

Is the cover closed on the sensor? I know with the cover off they don’t report correctly. Or hook up temp wires to the inputs, close the cover, and short the wires.


(Tim Danks) #9

Yes I saw another comments about cover and have kept it closed at all times when testing. Also put a couple wires on the inputs closed cover and shorted. As I mentioned everything seems to work except the UI visual status doesn’t change. The actual states changes are recognized by the system. It seems to be something with the UI state, or presentation of the state.


(Allan) #10

Figured it out. Think when another member updated my device type for the multistate tile instead of the old tile I was using he used “clear” and “smoke” for the two states while on my original I used the “clear” and “detected” which is what the tile needs. So internally it still trips SHM and shows in the history but the tile wasn’t updating.

I fixed it…update your device from the repo and you should see it say smoke.

-Allan


(Tim Danks) #11

Many Thanks. That did the trick. Now the easy part…connecting it into the actual alarms wiring and getting all manner of living creatures in the house on edge for testing it a few times. :grinning:


(Allan) #12

Yeah…I tested it with a magnet so the actual alarm didn’t go off (sleeping baby). But all the lights in the house turned on and the ceiling fans turned off as expected so it was a good reminder of how its setup at least :slight_smile:


(Gregoiredore) #13

Hi @vseven I do think we have the same issue with the Fibaro CO sensor which is seen as a motion sensor too. I thought maybe you could help on converting a motion sensor DH to a CO ?


(Allan) #14

The real solution is for SmartThings (@Zach_Varberg ?) to accept the CO capability into Smart Home Monitor instead of faking the sensors to be smoke. With that said if you give me the exact device type name it lists for the device (Under My Devices) I’ll convert it over.


(Gregoiredore) #15

That would be awesome. I should receive the device within a few days


(Gregoiredore) #16

@vseven : I have been trying to change the DH by myself and to understand how it works.
I understant I will need

  • the device fingerprint (which I can get throughout the graph API while pairing the device, if I get it right)
  • the command class versions : I have no clue how to get them…

(Allan) #17

Naw…its a lot easier then that. You juat replace the “contact” parts with “smoke” parts and leave the rest of the DTH intact. Where it makes the open call you change it to clear and when it makes the closed call you change it to smoke.

Give me a couple hours to get to my laptop and ill post something.


(Peter Klein) #18

Hi,
Thanks for your work with this project. I would like to do the same, but was wondering if I had to buy the exact door sensors you used, or if I could go with the cheaper Monoprice Garage Door sensor Product # 11987
(has dry contacts)? Would your code work with that sensor (or how hard would it be for me to make that sensor work)?

Thanks again
Pete


(Allan) #19

I have had issues with the monoprice sensors, namely with them not reporting back to closed when a door opened. Happened pretty frequently to the point I got rid of all of them. YMMV.

With that said you might be able to use the same code since most contact sensors are the same. I.e. my code is based on the standard SmartThings DTH for a contact sensor so any contact sensor “should” work if it uses the standard DTH.


(Peter Klein) #20

Thank you for the quick response!! I wasn’t able to find the 2-pack of the sensors you used on Amazon. If you have any links/deals, I’d appreciate a link.