Announcing the "ST_Anything" Arduino/ThingShield Project

Here’s my circuit. The long horizontal board is an upside down AMS1117. I wired it all up just as explained in the Instructable site.

It tries to connect to WiFi but just keeps cycling. See screen grab below. Is there some way to debug what is going on? Looks like the ESP01 is being found but then that isn’t logging in to the AP. It just cycles without success as shown.

Update: I double-checked every pin and connection with my multi-meter and convinced myself that the circuit is wired up correctly. All resistances match what they should be. Is it possible the ESP01 board got fried from heat due to soldering?

Ken, have you tried using one of the WiFiEsp library example sketches? This will at least let you know of your wiring is correct. Best to get one of those sketches working before adding the complexity of ST_Anything, which uses the WiFiEsp library as well.

Is anyone else having to power off and power on the Mega2560 with W5100 in order to get status updates on there smartthings app? I’m still experiencing that it stops sending updates after a couple of weeks, but it’s still pingable and free of memory. Weird?

I have been running one on my desk for a few weeks without it missing a beat. It is running my example “Multiples” sketch for the MEGA + W5100. Is there any way for you to leave a PC connected to it with the Arduino IDE Serial Monitor window open?

Have you added any custom code to your sketch? Sometimes users try to add a bunch of software to their sketch’s loop() routine which can mess up the timing of ST_Anything “behind the scenes” main engine.

Any chance things are overheating? Have you tried a different Arduino MEGA or W5100 shield? I also now support the W5500 shield (not sure if it would help or not!)

I’d love to help you fix the issue.

Hi Dan -

Having such great fun with this project. Have you attempted any integration with Amazon’s Alexa yet? I just received my new Dot and connecting it to Smartthings is very easy with a Samsung-supported integration. However, I’m not sure that integration supports the parent/child hierarchy and wondered if you knew. I was able to get this project integrated but Alexa seems to only know the child names.

For example, I have an instance of this project labeled side (switch1) and side (switch2). I’ve tried every way I can think of to enunciate the “turn on” command for this but nothing worked. About to give up, I said “Alexa turn on switch 2” and it worked. Maybe just the current state of “tthings” as they work through the parent/child stuff and an FYI to those that may have gotten their Prime-day goodies.

You can rename the child devices to anything you’d like from within the ST App on your phone. Alexa cannot differentiate between a parent and child devices. Just name the child devices by clicking on the gear icon for each child and seeking the name to something more meaningful and easier for Alexa to comprehend.

Make sure you go back in the Alexa Smart App inside your phone’s SmartThings app and expose all of the child devices so Alexa can discover them. Then ask Alexa to “discover my devices.” Afterwards, you can go into the “Amazon Alexa” App on your phone and create groups of devices if desired. This allows you to turn on/off groups of devices with a single command…

Thanks for the great info. I had no idea you could rename the child devices so that’s a great feature. Back to the fun.

No custom code, I sent you my sketch last time and you verified everything looked normal. I’ll keep a serial monitor hooked up to it and see what the output gives me through time. Weird I guess I’m the only one experiencing it

Hi,
I am just learning about ST_Anything and wanted to see if it is a fit for me.
Since the ESP8266 is so cheap, I wanted to create a few buttons around the house that are battery powered. I have seen a few tutorials on how the ESP8266 can be put into deep sleep mode and wake up when pressed.

When the button is pressed, I want it to mimic a button press of a real z-wave switch. I would like it to report history of when it was last pressed and stuff.

I also want for my switches to be able to be picked up as switches by the Amazon Echo so I can use my voice to activate them.

Is ST_Anything geared towards doing having multiple devices around the house running on their own ESP8266s?

One project I wanted to pursue is being able to have my ESP8266 listen for 433mhz signals as if they were switches. You can buy 433 door sensors, motion sensors, etc. pretty cheap. I wanted to see how I can integrate those sensors into my Smart Things world.

Yes, you can have multiple ST_Anything based micro controllers around your house for various purposes. Each one can have 1 to many devices attached to it.

As for battery operated mode, I know of only one other user who created a battery powered device using an ESP8266 and a temperature probe. He used the deep sleep feature of the ESP8266 from directly within the sketch’s setup() routine. Thus, his ESP would power itself on after a predetermined amount of time, then run through the setup routine which first connects to WiFi and then sends an initial set of data for each device attached to the controller. He would then put the device back in deep sleep. NOt quite sure how you would do this for a button press, but I am sure it could be done. Why not just buy an Aeon Minimote instead? It has a rechargeable battery built in, and supports four buttons (pressed and held for 8 total functions), is z-wave, and runs locally on the ST hub.

ST_Anything does support RF via the RCSwitch library. This is used to SEND signals to a 433MHz device, but not receive them. I am sure you could build a custom device to listen for 433MHz signals as well, but I haven’t worked on that capability.

Have you considered looking at this device for handling 433MHz devices? Not sure if anyone has integrated it with SmartThings yet, but for ~$10, you can’t beat the price and packaging. If it is like other Sonoff devices, it may be running on a ESP8266, which you may be able to program with custom firmware.

Hello @ogiewon and all
1st of all thank u ever so much for all of this, i love the fact that i can integrate my NodeMCUs to Smartthings, what an amazing work u did.
Now i got a few issues that i am not sure if they been mentioned before, my set up is a Wemos D1 mini v2.3.0 ESP8266 this is an original good quality Wemos nodeMCU ESP8266.
I am based outside the US so there is not integration with ST IDE and github, had to manually create each device handler by copy pasting your code.
I created the parent ST_Anything and the child switches only (the switch and the relay switch). I followed your instructions to the letter from your github repository and also connected an LED + to pin D1 of the of the Wemos nodemcu to test the “switch”.
Issues:

  1. The LED on pin D1 comes ON when the Smarthings app relevant switch button is OFF and the LED switches OFF when the smarthings app button is ON. The functionality is reversed. The serial prompt of the Arduino IDE reads correct so when the app button is off the IDE reads off etc. For some reason the LED lights up or switch’s off though the other way around relative to the smarthings app button/tile like i said. Btw the “relay switch” function on pin D8 works fine, its on or off when it should be.
  2. I get a red popup message every 3 or 5 seconds in the smarthings app that reads “Child device creation failed. Please make sure that the ‘null’ is installed and published”. It does not appear to influence the functionality allot of the app though but it keeps popping up.
  3. Like i said i had to manually copy paste the groovy device handlers i want as github is not integrated with the ST IDE outside of the US but could not ether import the groovy files from my C drive as the ST IDE gives me an error message. This is not a big issue but it forces me to copy paste everything.
    The 1st issue is my biggest problem, any advice on all issues is more than welcomed by at this point.
    Many thanks

The logic for any digital input or output is user configurable. In the example below, the logic for the digital output is set to inverted logic (i.e. the last argument set to “true”). You can easily change this by simply setting the last argument to “false” instead. This is found in the sketch’s setup() routine.

static st::EX_Switch executor2(F("switch1"), PIN_SWITCH_1, LOW, true); //Inverted logic for "Active Low" Relay Board

The arguments for every device are documented in the source code for each arduino device’s .h or .cpp files. Take a look at EX_Switch.h in the …Arduino\Libraries\ST_Anything folder and read the comments at the top for more information regarding valid values for each argument. Here’s an example snippet…

//			  st::EX_Switch() 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 startingState - OPTIONAL - the value desired for the initial state of the switch.  LOW = "off", HIGH = "on"
//				- bool invertLogic - OPTIONAL - determines whether the Arduino Digital Output should use inverted logic

The RED Pop up message should only appear if you look at the “Recently” tab for the parent device. I have noticed this too and you can probably safely ignore it as log as all of your child devices were created properly and are working as expected. It seems that if you send a message to the phone app that performs the pop-up, it will continue to pop-up every time you look at the “recently tab” until that message eventually drops off the bottom of the window. At least this is how it behaves on iOS during my testing a few months ago.

1 Like

@ogiewon it worked thank you for the hint, i inverted the output and its working like you explained. Also i added most of the other device handlers and the warning popup stopped. I tracked the error messages from the ST IDE and noticed that they where referring to other missing DHs.

I wanted to ask u another thing pls. I am not a coder so my programing skills are limited. Is there any chance for you to edit your current Arduino sketch to make another version to include some LED sequences for WS2812b RGB individually addressable LED strips? For example to have 3 or 4 diferent tiles on the ST phone app that would correspond to different static colours e.g. white, blue, red and an LED sequence e.g party mode.
There are some examples of LED strip sequences on GitHub with libraries but i do not know how to integrate them correctly on your ST anything sketch and libraries. Code examples:


https://drive.google.com/drive/folders/0B7X7uW1LPCaeSC1yWFlhSi1jS3M
There is a video example here that depicts what i am trying to explain but unfortunately is for the Arduino ST shield wich is discontined as you know.

Another similar example but its not using Arduino scetches but the MCU is again ESP8266 based:

It would be awesome if you could do this or provide detailed guidance on how to do it by editing your the Arduino NodeMCU ESP8266 sketch to incorporate some of the LED strip light functionality written in the code of the above links (excluding that code’s Alexa and other non light functionality as it is not needed once integrated with smarthings Alexa can discover the different sequences as different switches) and by adding new ST DHs for some light colours and sequences.
Thank you again for all of your awesome work on this and for opening a new word of possibilities.

Glad to hear you got things working as desired. We really tried to design ST_Anything for flexibility and configurability.

As for the LED strip functionality… I have a strip of Neopixels, but I have never found the time to integrate it with ST_Anything. It’s on the list, albeit pretty low on the priority list. Wish I had better news, but I just don’t want to give you false hope for a quick solution.

Probably the simplest approach, if you want to try writing the code yourself, would be to start with the EX_DimmerSwitch class and use it as a starting point for writing your own ST_Anything class. I would use each of the 100 dimmer levels to represent a different LED pattern as shown in the first video. However, the standard EX C++ class is not executed every iteration of the Arduino loop() function, thereby preventing fancy sequences as shown in the video.

I’ll have to think about it some more… :slight_smile:

1 Like

Hi Ken,

Just checking in to see if you are still willing to sell your Smartthings
Shield.

I will purchase when you are ready.

Thanks

Ben

Good morning,

If there is anyone willing to sell a Smartthings Arduino shield, please let me know

Thanks

Ben

@ogiewon thak u for this i can give it a go but i think only u can actualy make it.
Please give it a go as soon as you can…
I cannot find EX_DimmerSwitch could u point me to the right place pls?

It is in the ST_Anything Arduino library folder. You’ll find a .h and .cpp file for it. If you’re not a C++ programmer, you may find it a bit challenging.

1 Like