[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

Yes, all custom code must be installed using the primary ST account for the hub you’re using.

I do not recall anyone ever trying to use a sub-account. Congratulations! You’re the first! :wink:

I am glad to hear you got it working.

This is usually just an artifact of the ST App not updating quickly. This has been an issue for years. As long as the device does what it is supposed to do, thee really is no harm if the ST App is a bit sluggish. On iOS you can drag the screen down to force a refresh of the ST App.

You can control the initial conditions to make sure the outputs are in the correct states at startup by adjusting the parameters when you declare the devices in your sketch.

//			  Create an instance of this class in your sketch's global variable section
//			  For Example:  st::S_TimedRelay sensor1("relaySwitch1", PIN_RELAY, LOW, true, 1000, 0, 1);
//
//			  st::S_TimedRelay() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name
//				- byte pinOutput - 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 = "off", HIGH = "on"
//				- bool invertLogic - REQUIRED - determines whether the Arduino Digital Ouput should use inverted logic
//				- long onTime - REQUIRED - the number of milliseconds to keep the output on, DEFGAULTS to 1000 milliseconds
//				- long offTime - OPTIONAL - the number of milliseconds to keep the output off, DEFAULTS to 0
//				- intnumCycles - OPTIONAL - the number of times to repeat the on/off cycle, DEFAULTS to 1
//
1 Like

I have my August Lock connected to SmartThings, I am trying to use NFC Tags connected to my Arduino board to control the locks. Using this library I see I can integrate lots of things with SmartThings, but I don’t see any controller related to NFC. Just wanted to check if it’s supported in current release? Thanks.

Unfortunately, there is currently no support for an NFC reader. If you’re a c++ programmer, you could add it.

Hi there Dan i hope you had a fantastic weekend;
- bool startingState - REQUIRED - the value desired for the initial state of the switch. LOW = "off", HIGH = "on"
I modified the sketch to change from yours that was LOW (as it should be) to HIGH with the hopes that the relays will be booting up as off and initially they do they are off… but once you touch them once they go right back to their On state and than Off than back On and remain that way from than on!!!
It is beyond me :slight_smile:

Have a great week
Denis

I was wondering the same thing but i figured it was beyond the scope of this project since its goal is to keep things as simple as possible… however i want to implement the same thing and while searching i found this thread Nfc-ing a lock that i am thinking about pursuing.
It uses a Particle Photon however and not an Arduino also IFTTT
D

Can you give us a diagram of what you are talking about? I’ve never seen NFC tags “connected” to anything. All the tags I’ve used get programmed and then placed. So, are you carrying around the tag? Or are you reading a placed tag with your phone?
And when you say NFC, do you actually mean RFID? Because they are different. Basically, if you can give a better description or a link to what you’re talking about, I think that would help someone to answer your question.

Did you also change the ‘invertState’ parameter? I am assuming your relay may be the opposite logic of the ones i have used. By trying all of the combinations of the 2 parameters, you should be able to get it to work the way you want. There are only 4 combinations.

Great success LOL :slight_smile:
It worked like a charm LOW and Inverted=true

Thank you for your very much appreciated help
Denis

1 Like

Glad to hear you found a working configuration!

Dan,
Have you ever considered or even have a dth for controlling small amplifiers for audio in a whole house install? I have read you can monitor output from an audio device such as a Chromecast audio to trigger power to an amp.

No, I have never considered this. What is the use case, exactly? You want to command a Chromecast to play some audio or video, and then have a Amplifier/Receiver turn on automatically? I would personally use a Logitech Harmony Hub to handle this, not ST_Anything. Amazon even has a Logitech Harmony Hub with Remote on sale today for $50.

To start you can build a very inexpensive whole house amplifier to drive multiple rooms with speakers. I currently use a 12 channel amp that auto powers 2 channels on separate Chromecast devices.

https://www.parts-express.com/dayton-audio-ma1240a-multi-zone-12-channel-amplifier–300-815

That unit is 500.00. There are some great prices on 2 channel amps that don’t have auto sensing built in to power on and off from audio input. These can be had for about 30-40 each. I have this setup for a whole house audio system that any device can stream music to a Chromecast audio and play single out multiple rooms at once.

There are also some projects that can auto start a stream on action tiles.

Chromecast audios are on sale right now for 15.00 as well…

OK, that helps… What type of control for these amps are you looking for? Just a simple on/off type of signal? If so, ST_Anything would easily do that for you, using a relay connected to a digital output. You would have to use ST to know if the Chromecast is on or off, and then simply change the state of the ST_Anything 'Switch" device appropriately.

I’m having trouble adding a device with ST_anything. Under “type” there’s no longer an option for “Parent_ST_Anything_Ethernet” . Has anyone else had this problem and solved it?

Thanks
Matt

Found it at the very end. Did not get alphabetized.

1 Like

To start to control them on, off would be great but how would I know when the Chromecast is on or off?

Well, it appears you can control the amp though a mini jack on the back. From the manual:

So it appears that you can use the port on the back to trigger the device to turn on and off and can read its current state with the other port. To read the 12V output though, you’d have to run it through a 12 v relay as the input pins on the ESP8266 are 3.3v max. It appears that would be the limit of your ability to control though.

The chromecast is off whenever your TV is off, if your TV is what is supplying the power. The Chromecast doesn’t have a switch. If it’s plugged in, it’s on.

That’s where you would need some sort of SmartThings to Chromecast integration. That is not in the scope of ST_Anything.

I’ve got an ultrasonic sensor and an RGB strip hooked up to a nodeMCU and got it working perfectly with ST. However, I want to add some code local to the nodeMCU to have the RGB strip react in realtime to the ultrasonic sensor. This would require a reading from the sensor several times per second which means the callback routine wouldn’t work very well.

Is there a way for me to get sub-second readings from the nodeMCU from the library that is loaded as part of ST_Anything without messing with the polling frequency for ST and without trying to run a local loop against the sensor?