Let me start by saying I’m not a dev by any means, I just wanted to share what i got working. This is not a tutorial, more like a list of things I used.
Over the last few months I have wanted to get my ESP8866’s into smartthings somehow. I’ve read a bunch of posts and didn’t really find anything complete. There’s a thread on here somewhere that I started from. The dev that posted the original code disappeared and I took his posted code and modified it to work for my needs.
I made a contact sensor and a water sensor. Both sensors use the same arduino code, but have different device handlers.
Quick materials needed
- Node MCU 12e ESP8266
- CATALEX water sensor
- Door reed switch
- DS18B20 Temperature sensor
- Arduino IDE
Load the .ino file to the arduino, you will need to setup the ip address and wifi settings. I only tested this on static settings, not dhcp.
Make sure you can access the webserver by the below URL’s. xxx=last octet of your ip address
http://192.168.100.xxx:9060/getstatus
http://192.168.100.xxx:9060/getTemp
Load up the device handler in smartthings.
Add a new device and choose the recently added device type. Use the mac address for "Network ID"
Edit the preferences and Set the IP,Port and Mac address of your ESP8266
If all went correctly…it should be working. Like I said, I’m not a dev. Feel free to critique, change, suggest anything you would like. I’m hoping others would be able to step in and help out if people want to use this.
Also, I don’t really understand Github, but here is the repo(I hope).
https://github.com/gopherxx/smartthings-sensor/tree/master/smartthings-sensor
-Thanks