Announcing the "ST_Anything" Arduino/ThingShield Project

Ok let me try re-uploading my code again and seeing if I get any output this time

Hey All,

Has anyone been able to use the water sensor on a digital pin? I’ve got an esp-01 that I’m tryina use as a combo water/temp sensor. I’ll assign the water sensor D0 in the IDE, it’ll show up as a child device when setup in smart things, but when watching the serial console the esp ignores the pin if it goes high or low. This happens on the nodemcu as well (if I wanted to make two water sensors for example). I dont need the analog, its connected to a water sensing board with digital output and ajustable threshold.

The Water Sensor ST_Anything class only supports Analog inputs currently. It wouldn’t be too hard to modify a copy of the IS_Contact sensor class to do what you’re wanting.

1 Like

I have a couple of questions, but first I’d like to say THANK YOU! to Dan and Daniel for all their hard work on this project! awesome stuff!

I am playing around with ST_Anything on an ESP8266 nodeMCU board. I currently have 4 DS18B20 temperature sensors and a capacitive water sensor to keep an eye on my boat when it is stored outdoors over the winter. I basically have a few battery heat blankets (made for the purpose, NEVER use a household heating pad or bed style blanket for this! you WILL burn your boat down!) to monitor some key spots that I don’t want to freeze and to make sure water / snow melt isn’t leaking in. The water sensor gives an analog out, and I added a line of code to the water sensor .cpp file that posts the ADC value to the “recently” tab while preserving the “wet. dry” indication. I wanted to see an actual number so I could get a feel for how the water level on the sensor changes the value if I need to make any adjustments and dragging a laptop outside is a pain. I simple added another line that sends the raw m_nSensorValue as a string rather than doing the if/then on it.

Usually you would have all the DS18B20’s sharing a single pin as they all should have unique addresses from the factory. I see that you have the capability for multiple sensors on the same bus by reading the header file but I have them all on their own pins because I couldn’t figure out how to modify the code in the sketch to implement this. Not to beat on you, because I can’t claim to be the comment king of coding and you’re giving your time and energy for free, but commenting your code helps so much for the rest of us! So I guess is there some example code I missed on how this is done or could you please post some?

Also can someone point me to a post on how to run multiple ESP8266’s with ST_Anything, I’ve seen it mentioned that it is possible, but I can’t find the post explaining how to do it. I guess the fact you add a MAC address in the parent device setup tab for one device is throwing me. Do you add more device handlers or a comma in there between MACs or what? I would really like to make my own garage door controller that I can trust not to open on its own when I’m away without better layers of authentication than the commercial products already out there. I think I can leverage this project to do that since it allows for some “outside of smartthings” processing. I’ve had outdoor lights come on during the day and false sensor trips too many times to trust smarththings with something like the garage door…

And finally - Smartthings is being changed. I honestly haven’t been keeping up very closely, but I did notice somewhere that this project will only work with “classic” - Is this still the case and are there any plans to update ST_Anything to stay alive should be all be suddenly forced to move to the new app?


Please see this project I documented a few years ago where I have 2 temp sensors on the same pin. You have to first get the sensor serial number of each probe as documented in this post:


Then in your sketch you will address them:
DeviceAddress freezerProbe = { 0x28, 0xFF, 0x17, 0x99, 0x01, 0x15, 0x02, 0x13 };
DeviceAddress fridgeProbe = { 0x28, 0xFF, 0xD3, 0x6D, 0x01, 0x15, 0x02, 0x51 };

FYI, you may find much more up to date information in my newer ST_Anything thread at

Within each .cpp/.h file inside the various …Arduino\libraries\ST_Anything… folders, you will find detailed comments/documentation for the use of each of these C++ classes/objects. For example, from the top of PS_DS18B20_Temperature.cpp file, you will find the following which details the usage of this class.

//			  For Example:  st::PS_DS18B20_Temperature sensor1(F("temperature1"), 120, 0, PIN_TEMPERATURE, false); (for a single sensor)
//                          st::PS_DS18B20_Temperature sensor1(F("temperature"), 120, 0, PIN_TEMPERATURE, false, 10, 3); (for 3 sensors)
//			  st::PS_DS18B20_Temperature() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - either "temperature1" for a single sensor, or "temperature" for multiple sensors
//				- long interval - REQUIRED - the polling interval in seconds
//				- long offset - REQUIRED - the polling interval offset in seconds - used to prevent all polling sensors from executing at the same time
//				- byte pin - REQUIRED - the Arduino Pin to be used for the One-Wire DS18B20 sensor conenction
//				- bool In_C - OPTIONAL - true = Report Celsius, false = Report Farenheit (Farentheit is the default)
//				- byte resolution - OPTIONAL - DS18B20 sensor resolution in bits.  9, 10, 11, or 12.  Defaults to 10 for decent accuracy and performance
//				- byte num_sensors - OPTIONAL - number of OneWire DS18B20 sensors attached to OneWire bus - Defaults to 1

If you simply wanted the voltage/value from the sensor, I would recommend that you simply use the ST_Anything’s PS_Voltage voltage device. You could use this in addition to the PS_Water device. Both could read data from the same analog pin.

Running multiple copies is very simple… Just manually add another new ST_Anything Parent Device via the ST Web IDE. Then, in your phone’s app you will see the second parent, which will require you to configure the MAC address, TCP/IP address, and port like you did for the first one. Just use the unique MAC and TCP/IP address from the second ESP8266.

Samsung/SmartThings future plans are very unclear. I have no idea if any of this will work with the new app in the future. I have ported all of ST_Anything to run on Hubitat. In fact, I have moved about 99% of my devices over to Hubitat. I prefer local processing. So, at least you’ll have that platform as an option should ST decide to further alienate the DIY/Maker community.

One more tip - The Arduino MEGA ST_Anything examples demonstrate a vast number of example devices from ST_Anything. You will still start with an ESP8266 example, but can copy and paste the device definitions from the MEGA’s sketch into the ESP8266 sketch. At least it helps demonstrate the usage of these various devices.

And, as always… I’d love for someone to step up and help improve the documentation! :wink:

1 Like

Thanks so much for pointing out the things I obviously missed!!!

I have been a bit pressed for time and admittedly didn’t read as close as I should have.

Thanks again.


1 Like

I just came across this thread. BTW, the link to appnote is no good.

Are you saying you can connect 10k resistor from I/O pin to ground and connect I/O pin directly to alarm system pin and the alarm system will still work while letting Mega2560 sense whether alarm pin is on or off?

Does I/O pin pull-up resistor need to be enabled in your solution as source of current?

Are you assuming alarm circuit is simple normally open or normally closed switch in parallel with 10k resistor?

And this avoids need for voltage divider and transistor?


I am reading this thread two years after the post. Is this kewashi’s transistor circuit still the simplest and recommended way to connect an existing wired alarm system’s sensors to SmartThings while letting the existing alarm system continue to work normally?

This thread is really long and I’m wondering whether anyone has posted a simpler solution which allows the existing alarm system to work while still being able to connect the wired sensors to SmartThings.

At this point, I would probably recommend using optocouplers to keep the two circuits optically isolated from each other. A simple voltage divider to feed the led side of the optocoupler to step the voltage down to something within spec, and then the output to the micro controller.

The old link is no good. Here’s a new link:

I agree - the method I used referenced above wasn’t robust so I abandoned it. It turns out the alarm circuit was slightly altered and it messed things up. ST worked but my alarm had some signals shifted. Fortunately it wasn’t permanent damage so disconnecting returned my alarm to normal. I will try the optocoupler next. That should keep things truly separate.

Thanks for advice! Optocouplers it is!

My current wired alarm system has 14 wired sensors which I want to connect using optocouplers to Arduino and SmartThings.

Is the HiLetgo New Version ESP8266 NodeMCU LUA CP2102 ESP-12E Internet WIFI Development Board still recommended or is there something better?

14 sensors is far more than a single NodeMCU ESP8266 can handle. If you choose the NodeMCU ESP8266, you will probably need three of them.

If you have the ability to run Cat5 Ethernet to your Alarm Panel, you might want to use an Arduino MEGA 2560 + W5100 Ethernet shield. This will allow you to connect everything to s single board.

The third option is that you could use a NodeMCU ESP32 based board. The ESP32 has a lot more I/O pins than the ESP8266. I believe you could almost get everything connected to one ESP32, but maybe not quite. Also, the ESP32 is newer and less mature than the options above, so proceed with caution.

At least these are all very inexpensive options, so it’s not like you’d be out a ton of money if you had to change.

It is probably best to post new questions regarding ST_Anything in the more active and current thread at

Finally, have you looked at Konnected? Konnected is a purpose-built alarm panel integration for SmartThings. Not sure if they have their version ready to allow you to leave the current panel in operation though. I know they were working on a solution. If you haven’t taken a look at Konnected yet, it may be worth your while.


Thanks for your suggestions! I could run cat5 to my alarm if needed. I’d like to avoid using three ESP8266s to save space in the alarm panel box. I’m hoping to mount everything to the inside of the door.

Is this the NodeMCU ESP32 you are referring to?

After this thread, I will move future questions to current thread.

I was happy to see Konnected thread until I realized it did not support leaving current panel operational. I’ll look at Konncted thread and see what they are up to.

I am awed by the level of support you provide to your ST_Anything releases!

I use this Logic Level Converter on my DCS panel to read the key pad bus, it’s been working fine for a couple of years. it has no problem converting 12V logic to 3.3V logic. You can find these even cheaper on Ebay.

1 Like

Yes, that’s the same ESP32 module that i have done my testing with.

One way to reduce your 14 zones down to a smaller number is to combine some of them in series. You won’t know exactly which device caused the circuit to be open, but often that’s not important.

Never used one of these, but it might help with your problem.

1 Like

I’m kind of lost because it simply tells me that there’s no wifi shield.

Using :ST_Anything_Multiples_MEGAWiFiEsp.ino
with ESP01 tx to arduino’s rx1 and rx to arduino’s tx1

There’s nothing to write into the ESP01 for it to accept communication with mega2560?

Thank you in advance?