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

Thanks for the responses everyone. Looks like I had multiple problems:

  • As Nate suggested, looks like i had a ‘bad’ USB cable. I tried a different one and that solved one problem
  • As Tyler suggested, my laptop (not a work one, but an MSI gaming laptop) was also causing me problems. I re-did everything from my desktop and had some success
  • I say “some” as one of my node’s still won’t connect. I’m thinking it’s likely something bad on the board, as the other one worked with zero issues. I have 2 new nodes coming (I needed them for another reason anyway), so we’ll see how those work when they arrive in a week or two.

The great news though is that I have one board working and all of my door sensors hooked up and working great. Still working on my motion sensors, but I should be able to figure that out on my own!

Thanks again for all the help, and especially to Nate for getting this all together. Fantastic stuff!

@heythisisnate, ive uploaded the lua file via the “upload” button and no errors show whilst uploading.

im now getting this in ESPlorer:

im also getting this in live logging:

im losing my mind- and I know its gonna be a simple solution!!

Hey Jak, now we’re getting somewhere! The error message is helpful. This error indicates that the devices may not be authorized to your SmartApp. A couple things to check:

  1. In the ST mobile app, go to Automation -> SmartApps -> Coud Sensor and make sure that all of your wired contact and motion sensors are selected in the “Select Devices to Monitor” section.
  2. Verify that you’ve published the SmartApp for yourself (go to Publish -> For Me in the SmartApp web-based IDE).
  3. If all else fails, go ahead and modify line 55 in the SmartApp code, removing the sensor types that you’re not using. For example, if you only have contact sensors you can remove the motionSensors and smokeDetectors variables on this line. This shouldn’t really be necessary, but it may help with debugging.
1 Like

You Hero!!

i had to remove contatc and smoke sensor from line 55, thank you so much @heythisisnate

2 Likes

no matter what I seem to do I can’t get past step 5 “Generate an OAuth token”. I’ve tried to recreate things from scratch to get around any issues bit I always seem to get the following from the REST Chrome app:

can someone suggest an option for me to try?

many thanks!

If you guys can wait a week or two, I’m working on automating the setup to make this more plug and play. I know right now there are a lot of steps to get set up, and it’s not really user friendly for non-techies.

I have lots of ideas to streamline this and may eventually try to make a consumer product out of it. Stay tuned.

1 Like

found my issue - I was using url and not uri in the POST function.finally got the success and am now working fine.

Overall a great project but there is a lot of technical steps that can trip many folks up. Automating that process would be huge.

thanks for all the work!

1 Like

Got this hooked up and working. Thanks for creating the project. I setup 2 devices and I want to get the rest. When I want to add a device, I seem to have redo the OAuth steps and then add each device. Is there a simpler way to add devices to the SmartApp. Repeating the OAuth steps is a bit tedious. Thanks!

Yes. To add additional devices, use the SmartThings mobile app. Once you’ve created and published the new device in the web based IDE, open the mobile app and go to Automation -> SmartApps -> Cloud Sensor. Then tap the device category and check the checkbox for the newly added device.

Hi Nate, this is Malcolm. I posted on the different section but could keep posting as new users are only allowed 3 responses to one topic. How stupid is that.

I changed the port from 443 to 8100 but still no luck. Everything else works great but the alarm code. What can I do to track this down. Once of your previous comments was for me to PM you. How do I do that?

Thanks Malcolm.

Stop and think for a moment about how a new account with no posting history might be created and abused for the purpose of clogging up threads with pointless repetitive posts and/or spam and you’ll realize that the temporary limitation in question isn’t really stupid at all.

Hi Malcolm,

Make sure that the deviceId you have set in the alarm section of your variables.lua matches exactly the id of the device in the SmartThings web IDE – this is the long hexadecimal number in the last part of the URL when you go to My Devices > Alarm.

If you want to DM me the contents of your variables.lua I can see if I can spot anything wrong. To do that just click on my user icon and click the blue Message button.

Hi Nate, I don’t get a “blue message button” when clicking on your icon. Again it appears I don’t have that feature, probably because I’m a new user!

Is there any other way to get files to you. I would post online here but I’m not sure what info would compromise security of my system.

Thanks

Here it is:

  • alarm is the configuration to connect your alarm system’s siren or strobe. SmartThings Alarm capability supports
    – both siren and strobe states, so you can connect up to two wired devices to two pins on the NodeMCU ESP8266 board,
    – using a relay to switch a higher voltage device.

    deviceId - The SmartThings deviceId of your NodeMCU Connected Alarm device. Set this to nil to disable siren/strobe support.
    httpPort - The port used for your SmartThings hub to communicate with the built-in HTTP server on the NodeMCU
    sirenPin - The pin on the board connected to your siren relay. Set to nil to disable.
    strobePin - The pin on the board connected to your strobe relay. Set to nil to disable.
    alarm = {
    deviceId = “b9fdfe4c-96d5-4387-ab2f-0db009795d96”,
    httpPort = 8100,
    sirenPin = 8,
    strobePin = 7
    }

You can post it here. Just the alarm section of your variables.lua.

I edited my previous post. With alarm info…BTW, in your Alarm.lua file there is a number of lines of code where you had used SirenPin when, I believe, it is supposed to be StrobePin.

I posted/edited my previous post with alarm section of variables.lua… Below is the log from ST…

The host and port is null which means the sync command did not work. Can you put some debugging lines in the sync function in your SmartApp code to make sure the device id matches.

Hello everyone, exciting new release news!

I’ve been hard at work on ways to make the initial setup and installation easier for all of you. One of the tricky parts was the OAuth flow. I’m pleased to announce nodemcu-smartthings 1.6 now greatly simplifies the OAuth flow. You now just need to point your browser to http://<your-device-ip>:8100/oauth, paste in the Client ID and Secret, and the application takes care of the rest.

There are also a few bug fixes and enhancements in the 1.6 release, so I recommend that everyone update when convenient. See the release notes for details and upgrade instructions.

The next exciting thing: I’m very close to being able to automate the whole setup, making it possible for me to distribute pre-flashed boards with the software already loaded. Initial configuration would be done via your web browser. This eliminates the need for flashing or editing/uploading code!

If you’ve been hesitant to try this project because you were worried about the technical steps involved, now you’re in luck! I’m opening an online store to sell NodeMCU alarm system integration board DIY kits pre-loaded with my software for SmartThings!

I’m going to start to take pre-orders now to gauge demand, and I expect to be ready to make the first shipments in August. I’m selling two kits, one with a relay for an alarm/siren and one without that can also be used as an add-on for additional sensors. I have many more ideas for additional features and kits that I can create, so I hope that this is just the beginning!

I’m committed to keeping the project open source, and allowing anyone to continue to use the software for free. Many of you have asked for a way to donate to the project, so now I have opened a Donations Page where you can donate in increments of $10 to the future development of nodemcu-smartthings. I appreciate the support!

Please continue to let me know your feedback. I’m looking forward to growing this project into something great!

1 Like

Appreciate the continued development! I am still running on 1.3 and it works perfectly, I only noticed a missed command twice since I installed the system in March.

Any benefits for me to upgrade to 1.6, I am only using door and motion sensors (no siren, smoke).

I am working on a SmartThings tour of my house on my channel (MacTechGenius) and I will definitely throw in a link to your store page in the description.

Any plans to incorporate OTA updates?

@kamran no need to upgrade since you’re not using a siren. I am thinking about how to do OTA updates but haven’t started on it yet.

1 Like