Convert Your Wired Alarm System into a SmartThings Smart Home Monitor System for Under $25 with NodeMCU ESP8266 (2017)

Yes I have tried this also, I even remove/re-added them in the app with no success.

I receive the following error in the logs.

 java.lang.NullPointerException: Cannot get property 'id' on null object @ line 57

Edit: The thing is in the logs the device ID it is referencing with the above error does not exist.

If this hasn’t worked before, is it possible you got the device ids for the smoke sensors from the wrong place? Perhaps you grabbed the Network Device Id value instead of the id that’s in the URL when you show the device in the IDE?

Nope I am using the URL ID, and it worked fine with the contact sensors. In fact I was able to add another contact sensor without issues. Its only the smoke detector devices.

@raidflex could you post a screenshot of the smoke detector device page in the ST IDE that starts with e72e4f9e? The URL should be something like https://graph-na02-useast1.api.smartthings.com/device/show/e72e4f9e.

Make sure the Version is set to “Self-Published”

Here you go.

I think I see the problem, @raidflex. It’s a bug in my SmartApp code :blush:

Try replacing line 55 with this:
def allSensors = contactSensors + motionSensors + smokeDetectors - null

This is needed because you don’t have any motion sensors configured, and for whatever reason SmartThings puts a null in there instead of making it an empty array. The above line should remove the nulls from the array.

Let me know if this fixes it and if so I’ll publish the update.

1 Like

Yes this worked! Thanks.

Has anyone actually tested the smoke detectors after setting them with actual smoke or that canned smoke? I can confirm that if I pull any of the smoke detectors off it registers that zone as detected, but I did try getting one of the detectors to register with actual smoke which did not work. Using the same test with a blown out match the battery ones that I have did register and respond accordingly. These were 12V detectors wired directly into the alarm system. There are 6 of them in 2 different circuits. I am wondering if I would need to actually provide 12V to the circuit for them to function properly.

These are 2-wire detectors, below are the ones I have, I noticed in the data sheet the min voltages states 8.5. What I am thinking is I may need to use a relay to get these to work.

https://www.systemsensor.com/en-us/Documents/i3-Series_DataSheet_A05-0318.pdf

It sounds like those 2-wire smoke detectors won’t work connected directly to the ESP if they need 12V of current to function (the ESP8266 only outputs 3.3V). Actually, they’re probably dangerous set up like that because as you’ve shown, it’s not detecting smoke!

I think you can probably make it work similar to the way @kamran set up his sensors in parallel with the alarm panel. I don’t think a relay would help here, but instead some combination of resistors to draw current from the 12V smoke alarm circuit to the NodeMCU at no more than 3.5V might do the trick. I think this would require a bit of experimentation to get right, and as I’ve said before, my expertise is in software, not electrical, so I don’t feel qualified to give you wiring advice here … especially when dealing with safety devices like smoke detectors.

Yeah, the resistors may be the best option, I will have to research it more and look back at kamran’s setup . The CO detectors will probably need the same setup. Maybe someone on this board might have a little more knowledge with this kind of setup or electrical engineering. I hate to switch them out because the detectors are already there and wired in, but I also want something reliable.

I think I found something promising for you, @raidflex. This might be exactly what you need: http://amzn.to/2pv1fIG
edit: this one looks like it’ll work to and is available with Prime: http://amzn.to/2opDTon

It’s a smoke detector relay that some reviewers described that they set up as a contact sensor on a Zwave device. I suspect it’ll work exactly the same when connected to the NodeMCU. If you give it a try let me know how it works out.

1 Like

Nice find! This looks promising, I will try it out and report back. Thanks for the help.

Hi,

I’ve flashed the firmware, it said it was a success but when I open ESPlorer

all I get is :

_Can’t autodetect firmware, because proper answer not received (may be unknown firmware). _
Please, reset module or continue.
And a bunch of random character

If I try to send the LUA files I get timeout errors.

Any advice ?

Thanks,

In my experience, it always says that line about Can’t autodetect firmware. That’s normal.
You just need to toggle the RTS button in ESPlorer on and then off again to soft-reset the device after initial connection.

But I assume it is supposed to display the custom build info after a few moment ?

I’m trying to build a new firmware based on the module you listed, was there any other change to your build ? I noticed the one I downloaded from your link in 49KB the one build by nodemcu is 449KB.

(trying to flash now)

EDIT : I know what I did, and I’m ashamed… I did a save link as on your link instead of clicking and downloading from there… You get a bin file but apparently corrupted

Hi Nate, It’s probably a coincidence, but it seems like I’ve been getting several false sensor events since I upgraded to your latest cloud sensor smartApp to fix the smoke sensor 500 error. Before you introduced the polling feature, I would get the occasional missed sensor event. And when I upgraded everything for Siren support which included the sensor polling, I didn’t notice any issue. It seems to only started happening since I updated the smartApp to fix the smoke sensor issue.

Can you think of any reason I’d be getting false open contact sensor events? They seem to be open and immediate close events. At least 3 separate false open/close events have occured tonight triggering intrusion detection. It’s happened on two different contact sensors. One of the sensors hasn’t even been interacted with today.

I can’t see any reason why that one line bugfix would cause any false open events. I think the most likely culprit is a loose wire or two. Maybe some of the connections loosened a little bit last time you handled the device?

Thanks Nate. I’ll have a look at the wiring. I just had another event. This time it’s a window sensor. This doesn’t seem to be just one pin acting up. Not much in the live logging (I had it on to catch it.)

12:06:11 AM: debug Updated Master Bedroom Windows to 0

I wonder if this may have something to do with using so many pins. It’s just odd that it didn’t start having an issue until 3 to 4 days after I last touched the hardware.