[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

Yes, the Arduino/ESP code is the same. You do have to modify your sketch to use the Hubitat Hub’s IP address and Port number (39501 on Hubitat instead of 39500 on ST.)

It really depends on you and your family’s needs and current habits. I personally really like my Hubitat Hub. It runs all of my custom code locally, which is what I really was after. Hubitat’s Mobile Phone App is not as polished or refined as ST. You also perform all Hubitat configuration from a web browser on your home network, rather than via the phone app. This has its pros and cons. For me, as someone who develops code, I very much prefer to use a web browser for the full development lifecycle. YMMV, of course.

With Hubitat, I have ‘automated my home’ and thus I really don’t use Dashboards for much of anything. For some users, for whom ‘remote control’ is what they are after, they often miss the ST Mobile Phone App.

Both systems have pros and cons. You can use both of them together if you wish, as the Hubitat Community has created a very good integration called Hub Connect. This allows ST devices to be mirrored to Hubitat, and vice versa.

Another consideration is your current list of devices/integrations. Older GE/Jasco Z-Wave switches and dimmers do not reliably report instant status updates. The newer Z-Wave Plus versions work much better, especially on Hubitat. Something to think about… I made the leap to Lutron Caseta and have never been more pleased with a home automation product. Extremely reliable and robust. The integration with Hubitat is excellent as well, as it is local over your LAN instead of Cloud-to-Cloud.

1 Like

Cant believe its takin me this long to start making use of this great project.

First of all I’m hoping to control a number LED strips using separate ESP8266’s throughout the house. I’m currently working on a hyperion ambilight with ws2812b LED’s, a pi 3 and an arduino uno. I have a long roll of these LED’s left.

Are these LED’s supported with ST_Anything using ESP8266’s?. It would be great to upgrade my ambilight with Smart things control using ST_Anything but not sure if it can be done

Since I’m using the Smarthings API in my own project ST_Anything will be perfect for a number of things im looking to add. Thanks again for this. It’s great!

ST_Anything Has some RGB/RGBW LED support, written by @vseven. This works for non-individually addressable LED strips.

As Dan said the library I wrote is for dumb/analog LED strips. I tried unsuccessfully to get programmable LED’s to work. They worked in a very limited fashion (less then 30 LED’s on a strip usually) but would lock up the ESP, both on the 8266 and the newer ESP32.

I just got a v4 hardware ESP32 a few days ago. It’s supposed to be a lot better hardware then the old v1 I was using so maybe I’ll try again but my wife bought me a Phillips Hue lightstrip for Christmas to play with so not sure how much motivation I have to get it working. If you want to try you are welcome to, I have the two library files and a sample sketch in my GitHub:

Otherwise the dumb/analog ones are pretty cheap and work well with this project. This post has more info on wiring them: [RELEASE] ST_Anything v2.9.7 - Arduino/ESP8266/ESP32 to ST via ThingShield, Ethernet, or WiFi

2 Likes

Thanks for the info guys. I’ll try and make use of the 10 metres of this strip I have so I’ll have to keep looking for an addressable RGB solution that can be integrated with smartthings.

If not I’ll leave the smart things integration out and control directly over TCP from my external application.
Maybe feedback into smartthings with Virtual Switches or something.

Regardless I have plenty other uses for ST_Anything so looking forward to getting some boards.

1 Like

Found this project here https://diyhue.org/.

It allows you connect my esp controlled strips to hue. Once they are added to Hue they should be available in Smart things.

I’ll give it a go and let people know if it works.

2 Likes

I am new to using ST_Anything. I am using an ESP8266 to control a dual relay setup. I have everything working properly, however I am trying to figure out how to make it so that when one relay is turned on, the other is turned off and vice versa. I looked through the example sketches but didn’t see anything that stuck out. Is there an easy way i can do this? Any help would be appreciated.

I am using the ST_Anything_Relays_ESP8266.ino as my base sketch for this.

Please explain your use-case for this two relay behavior. The reason I ask, is that I recently added support for a single ST_Anything device to operate a pair of relays in a manner very similar to what I believe you are asking for…

//******************************************************************************************
//  File: EX_TimedRelayPair.h
//  Authors: Dan G Ogorchock
//
//  Summary:  EX_TimedRelayPair is a class which implements the "Valve" device capability, where output1 opens a valve, and
//            output2 closes a valve.  It features optional automatic-turn-off time delay times for for both outputs.
//
//			  It inherits from the st::Executor class
//
//			  Create an instance of this class in your sketch's global variable section
//			  For Example:  st::EX_TimedRelayPair executor1(F("valve1"), PIN_RELAY1, PIN_RELAY2, LOW, true, 1000, 1000);
//
//			  st::EX_TimedRelayPair() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name
//				- byte pinOutput1 - REQUIRED - the Arduino Pin to be used as a digital output
//				- byte pinOutput2 - REQUIRED - the Arduino Pin to be used as a digital output
//				- bool startingState - REQUIRED - the value desired for the initial state of the switch.  LOW = "closed", HIGH = "open"
//				- bool invertLogic - REQUIRED - determines whether the Arduino Digital Output should use inverted logic (e.g. active high versus active low relays)
//				- long Output1Time - REQUIRED - the number of milliseconds to keep the output1 on, DEFAULTS to 1000 milliseconds, 0 = will stay on
//				- long Output2Time - REQUIRED - the number of milliseconds to keep the output2 on, DEFAULTS to 1000 milliseconds, 0 = will stay on

I have the two relays attached to a 3 wire setup to operate a water valve. I connect the open to one relay and the close to the other relay. When initiated each relay needs to operate for roughly 10 secs to allow the valve to full open/close. Although I want to prevent both open and close being activated at the same time. Appreciate the assistance.

Kyle,

The device I mentioned above will perform the exact task you’re looking for. It was designed to control a valve using two relays with timers to prevent actuating the valve motor for too long in either direction. Give it a try and let me know if you have any questions.

One thing, I wrote this for a Hubitat user. What I don’t recall is whether or not I added a Child Valve device Handler for SmartThings. [Update: I just checked and it looks like I did add the Child Valve DTH for ST as well.]

@ogiewon Got the sketch loaded up and works great. One question however is I see that by default when the board powers up it activates one of the relays to either open or close a valve. Is there a way to deactivate that feature? I live where storms are pretty common and power fluctuations/outages are common. A scenario I can think of that maybe problematic is if I install this valve on the main for my house, a leak sensor activates telling the valve to close and for some weird reason the power fluctuates causing the esp board to reboot and re-open the valve. I see I can change the parameter in the sketch to activate the closed valve on power-up. However, then I have a feeling the valve would close quite a bit when it should be normally open whenever a storm rolls through and blips the power. Hopefully that makes sense and there is a easy solution?

Appreciate the help.

I just looked through the EX_TimedRelayPair.cpp code and I believe you should be able to simply comment out the last two lines of the following routine. I believe this will prevent any outputs from occurring when the sketch starts up.

Start Soapbox
Personally, I do not believe this is a great idea for everyone else. When the board boots up, I am of the opinion that the outputs should go to a default state to ensure the physical world and the digital world are matched up. In your particular scenario, I can understand your concerns, especially with frequent power outages.
End Soapbox

	EX_TimedRelayPair::EX_TimedRelayPair(const __FlashStringHelper *name, byte pinOutput1, byte pinOutput2, bool startingState, bool invertLogic, unsigned long Output1Time, unsigned long Output2Time) :
		Executor(name),
		m_nOutputPin1(pinOutput1),
		m_nOutputPin2(pinOutput2),
		m_bCurrentState(startingState),
		m_bInvertLogic(invertLogic),
		m_lOutput1Time(Output1Time),
		m_lOutput2Time(Output2Time),
		m_lTimeChanged(0),
		m_bTimerPending(false)

		{
			//set pin mode
			pinMode(m_nOutputPin1, OUTPUT);
			pinMode(m_nOutputPin2, OUTPUT);
			//update the digital outputs
			if (((m_bCurrentState == HIGH) && (m_lOutput1Time > 0)) || ((m_bCurrentState == LOW) && (m_lOutput2Time > 0)))
			{
				m_bTimerPending = true;
			}
			m_lTimeChanged = millis();
			writeStateToPin(m_nOutputPin1, m_bCurrentState);
			writeStateToPin(m_nOutputPin2, !m_bCurrentState);
		}

Excellent work on ST_Anything. Its really cool and I am looking forward to playing with it. Can anyone please give advice on what I should purchase to make a complete garage door board. Actually i have 2 garage doors and want to add them both. I assume i need a board, some magnets, not sure if the relay to depress the switch comes with board or if i need to purchase as well. Thank you in advance.

@ogiewon Hello there sir and happy new year :slight_smile: time for another project
I want to use a nodeMCU that will have 3 on/off relays and a temperature reading from one of these a DS18B20 https://www.amazon.com/gp/product/B008HODWBU/ref=ox_sc_saved_title_5?smid=A28PCZ3GGXGBES&psc=1
can i attach one of these to ST_Anything and what do i use for that …so far i have always used DHT22 but these are different

thanks again in advance
Denis

In the ESP8266 example sketch, one of the devices is a DS18B20 temperature sensor. That should get you going. :slight_smile:

Can anyone help me get ST_Anything working with an Arduino Uno with a Tentacle Shield using I2C to talk to sensors?

Thank you!

Haven’t started using ST_Anything yet but a couple of questions for @ogiewon:

I’m slowly moving off SmartThings to another platform and would like to use ST_Anything on it with the existing Arduino code. Is there an API I can target when writing a handler/binding for it on the new platform?

How much effort would it take to have the Arduino return a very basic HTML page listing the status of the configured sensors? I can see this being quite useful as a debugging aid.

What is the “other platform”? You can reuse your Arduino code already on Hubitat :wink:

If it is using I2C sensors, then I would hope it should not matter that you’re using a special shield to hold these sensors.

What are the sensors? Specific model numbers? Do these have readily available Arduino libraries? Decent example sketches?

I support many I2C sensors already. Temperature, Humidity, Pressure, Illuminance…

Adding new sensors is simply a matter of adding a new device class (.h and .cpp) which implements one of the standard SmartThings capabilities and reads data from a specific sensor type using an available Arduino library. Plenty of examples available for I2C devices in the ST_Anything library.

Are you still trying to figure out your parts list?

The hardware you’ll need will depend on how you plan on hooking things up, especially to your home network.