[RELEASE] ST_Anything - Arduino/ESP8266/ESP32

Hey @ogiewon and ST_Anythingers… I’ve been bedeviled for a while with my ST hub (v2) rejecting connections. Basically the .connect() eventually times out. I’m using the IP address of my hub and port number 39500.

For debug purposes, I’ve tried both the ST_Anything libraries and even the basic WebClient example that comes with the Arduino IDE. In both cases, the attempt to connect eventually times out. This is not true for existing ST_Anything devices, but it is true for new ST_Anything devices.

Has anyone seen this behavior from the hub before?

You may want to try pulling the power on your v2 Hub for 30 seconds (along with pulling the batteries if applicable.). I have seen some weird behavior from hubs when they get into a funky state.

Also, are you sure that the new microcontroller is on the same LAN as the v2 hub? Can you ping the microcontroller? Does it have a unique IP address? Correct subnet mask, hub IP, etc?

Un-freaking-believable. I cannot say how many hours I wasted swapping Arduino boards, ethernet shields, code debugging, whining to my wife… and all it took was a hub reboot. My hub is hidden away in the suspended ceiling between the basement and the upstairs, so I don’t visit it often. That’ll change.

Grateful. A bit embarrassed. Grateful.

Paul

1 Like

Hey ST_Anythingers,

I’ve been a consumer of wisdom here for years. Learned a ton the hard way. Finally time for me to contribute something modest back.

For those of you using Arduino Mega plus Ethernet Shield plus your own IoT interface board, I’ve designed a 3D-printable case for it. You can find the files for this here: https://www.thingiverse.com/thing:4597829

I hope it’s helpful for some.

–Paul

1 Like

Ok I am close just need a little more guidance. I have the data coming in on Serial2 and can see on my serial monitor.

How do I use the st::Everything ::sendSmartString(“humidity1 79”);?

I tried using
String strTemp(Serial2.readString());
st::Everything::sendSmartString(strTemp);
and serial monitor shows
Everything: Sending: 60%

but no child device is created in the app. I am still learning and thanks for the help.

The string that you send must exclude the % symbol. It also must include the “humidity1 “ prefix.

Maybe try something like

String strTemp = “humidity1 “ + Serial2.readString();

The space is required between the name and value.

Do not include the % symbol.

I know the new app has been an issue. For my garage door setup, I was able to see the contact state in the app. Now it appears broken. I do get notifications when the doors open and close by text. Curious why it worked and now is broken?
Also, if i check the it in ide, shows correct status.

Thanks as always!

Things within the SmartThings back-end are always somewhat in a constant state of change, as well as the ‘New’ SmartThings App. As such, I have no clue what changed to cause the behavior you’re seeing. As I am no longer using ST_Anything on SmartThings, I really cannot even try to test it/troubleshoot it.

What are you using now?

I am using Hubitat as my main hub for home automation. I still have my ST Hub hooked up, as ST has many integrations available that Hubitat does not. So it is good to keep my options open. However, all of my ST_Anything devices are now connected directly to Hubitat, as it offers local processing for my custom drivers and apps.

So once the classic SmartThings app is sunsetted, the only supported way to use ST_Anything is on the Hubitat?

Two years ago I used ST_Anything to interface my existing alarm box sensors to SmartThings. Everything was working great until a few months ago (not sure how long ago) when all of the sensors stopped talking to SmartThings. Did anything change on the Arduino side, SmartThings side, which would explain this? Do I need to update the Arduino or SmartThings code?

does anyone else having issue with new SmartThings app? last week my app stoped showing status for any of my ST_anything implementations.

classic APP is showing the status and i can switch them and new app does not. I can’t do anything in the new app with ST_Anyhting. i have tried uninstalling and installing the app. Alexa also got an update from SmartThings and no longer showing ST_Anyhting devices. Thank you for any help.

ST_Anything is fully supported on the Hubitat platform. On the SmartThings platform, ST_Anything gets minor tweaks and updates. However, I am not planning on any massive rewrite of the DTHs for the 'New" ST App.

Try fully powering down your ST Hub and then powering it back up. Also, if you didn’t reserve an IP address for your ST Hub in your router, that would explain it.

Always a good idea to update all of the code to the latest version to see if that would help.

Hopefully one of the current ST_Anything users will take of the challenge to update the DTHs to support the ‘New’ ST App. I have made some minor tweaks over the past few months, but I don’t use the ‘New’ ST App.

I thought I had a problem with the new app, but in the end it turned out to be a problem of a shared account:

My wife and I are both users on our Samsung account. But Smartthings is connected to her phone as the first (primary) user. In part this is because my employer has Mobile Device Management on my phone and it gets in the way of a few things. I noticed that from my phone I could not add SmartApps, for example. But when I found another device and logged in as my wife, I could do anything I wanted. The UX is different, but the functions are largely still there.

Happy to help you navigate if you’re stuck.

1 Like

Yep, things are grim for custom stuff (ST_Anything) on new app. Some options that I’ve been through. Running the last option now.
Smartthings+ST_Anything; lots of stuff broke, dashboard is terrible, only phone dashboard

Smartthings+ST_Anything+Sharptools; get all your dashboard tiles back up on sharptools, all good. But if and when the smartthings IDE goes away things might get broke again. PC and phone dashboard.

Hubitat+ST_Anything(HubDuino); Everything back the way it was except dashboard and phone app not so good. Custom device handlers work. Local processing. Can configure on PC.

Hubitat+ST_Anything(HubDuino)+Sharptools; Everything back the way it was, good sharptools dashboard and looks same in phone app. Custom device handlers work. Local processing, Can configure on PC.

3 Likes

@vbogach1 - I just updated the Parent ST_Anything DTHs based on some other posts I found regarding how the 'New" ST App deals with Child Devices. Feel free to give this new Parent DTH a try. You will need to remove the current Parent, which will remove all of the Child Devices as well. And then manually create the Parent device again within the ST IDE. Instead of using the Classic App to configure the Parent’s settings, you can simply configure those settings from within the ST IDE for the Parent Device, and then click SAVE. The Child devices will then be created.

I just tested this using only the “New” ST App, and all of the child devices behaved well. Much much better than when I tried this about a month back. So either the changes to the Parent DTH, or some backend ST platform changes, have made things better.

I have tried this and still can’t get to work. I deleted parent inside IDE and added Parent ST_Anything DTHs and configured it. Now its not even working in classic :-(. I’m at the point just to switch to Habitat.

Hi @ogiewon.
Thanks for the update.
I can confirm my devices are performing well with your updated handler within the new app.
can you tell me what controls the reset time when using child motion sensors ?
i’ve got 2 configured and are detecting motion but can sometimes take a couple of minutes to go back to no motion.
Thanks again

Sure… two things impact the amount of time required for a motion sensor to report ‘inactive’. The first is the sensor itself. Some have adjustment screws on the sensor to set the amount of time before changing the digital output state from active to inactive.

The second is an optional parameter for the IS_Motion device itself. See the last parameter in the documentation below.

//******************************************************************************************
//  File: IS_Motion.cpp
//  Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)
//
//  Summary:  IS_Motion is a class which implements the SmartThings "Motion Sensor" device capability.
//			  It inherits from the st::InterruptSensor class.
//
//			  Create an instance of this class in your sketch's global variable section
//			  For Example:  st::IS_Motion sensor5(F("motion1"), PIN_MOTION, HIGH, false, 500);
//
//			  st::IS_Motion() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name
//				- byte pin - REQUIRED - the Arduino Pin to be used as a digital output
//				- bool iState - OPTIONAL - LOW or HIGH - determines which value indicates the interrupt is true
//				- bool internalPullup - OPTIONAL - true == INTERNAL_PULLUP
//				- long numReqCounts - OPTIONAL - number of counts before changing state of input (prevent false alarms)
//              - long inactiveTimeout - OPTIONAL - number of milliseconds motion must be inactive before sending update to hub (default = 0)
1 Like