Great success LOL 
It worked like a charm LOW and Inverted=true
Thank you for your very much appreciated help
Denis
Great success LOL 
It worked like a charm LOW and Inverted=true
Thank you for your very much appreciated help
Denis
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.
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?
I think you might want to write a truly custom sketch that uses my āSmartThingsESP8266WiFiā library for communications to your ST Hub. This is the same library that ST_Anything uses behind the scenes. This way, you can easily control the frequency of what data is sent to SmartThings (e.g. only every 30 seconds), while still reading the sensor as fast as youād like and controlling the RGB strip. As long as the strings you send to SmartThings follow the exact same naming convention that ST_Anything uses, the ST_Anything Parent and Child Device Handlers will still work without any changes.
As is always the case, you need to make sure that you do not use any blocking calls in the loop() portion of the sketch, like the ādelay()ā function as those wreak havoc on the network communications. Use āmillis()ā to create timers.
Here is an example sketch that I wrote for another user earlier this year that demonstrates the use of the SmartThingsESP8266WiFi library with a custom sketch.
Thanks Dan. I started doing this initially but I was hoping to take advantage of the great code that has already been written. For example, I modified the PS_Ultrasonic::getData() function to only send the string to ST if a parameter is not set. That way I can call it all I want without sending the string to ST. The only thing I canāt figure out is how to call the PS_Ultrasonic::getData() function directly.
In your sketch, you should be able to simply call the deviceās getData() function using the following as a guideline. The problem youāre most likely having is one of scope of the variables. Since the devices are declared in the setup() routine, you will need a global variable to hold a reference to the PS_Ultrasonic object to be able to use it in the loop() routine.
Before (outside of) your setup() routine, declare a variable as follows:
st::PS_Ultrasonic* ultrasonicDevice;
in your setup() routine you should have something similar to the first line below. Add the second line to your setup() routine.
//Polling Sensors
static st::PS_Ultrasonic sensor1(F("ultrasonic1"), 60, 0, PIN_ULTRASONIC_T, PIN_ULTRASONIC_E);
//Add this line
ultrasonicDevice = &sensor1;
In your loop() routine you should be able to simple call
ultrasonicDevice->getData()
Hopefully these changes make sense. Let me know how it goes for you.
This is exactly what I was looking for. Iāll try it tonight. If I submit a pull request when itās done, is this something you would merge? If so, should it be added to the current ultrasonic library, or should it be completely separate?
You can submit a pull request. Iāll need to look at your changes to evaluate how generic they are, especially for existing users. Backwards compatibility is always very important.
Hello Dan,
Thanks for your hard work on developing this nice library. I am building a small project for my house to control a bunch of relay switches in addition to several temperature/ultrasonic sensors. As I need quite a few inputs and outputs, I chose to use an arduino mega2560 with ESP-01 as the wifi link. The setup is quite straightforward. However, I noticed that the switch devices do not always respond. When I pressed the swtich button in the SmartThings App, it sometimes got stuck in the TurningOn or TurningOff state. Whenever this happened, the relay could not switch accordingly. When I monitored the Serial outputs (with debug enable), it did not show the entry for the āswitch onā command as it should for a successful switching event like below. So I guess somehow the command got lost during communication, and it happens randomly. All the polling sensors, on the other hand, seem to be working well.
Handling request from ST. tempString = switch3 on
Everything: Received: switch3 on
EX_Switch::beSmart s = on
Everything: Sending: switch3 on
As a control test, I loaded the same codes to a nodemcu (ESP-12E), and all the switches always work as expected. Do you have any suggestions on what could be the problem? Thanks!
I have never found the Arduino MEGA + ESP01 to be a very reliable communications solution. The Arduino MEGA + W5100 Ethernet Shield is very reliable. Also, as you have already found, the NodeMCU ESP8266 is also a very reliable solution. The NodeMCU ESP32 is also pretty good, and it offers quite a bit more I/O vs the ESP8266.
I tried for a few months to get the MEGA + ESP01 to be reliable, but I was never successful. I am always hopeful that someone else with rise to the challenge and figure out if there is a better way to do it and issue a pull request to the ST_Anything GitHub repository.
Another option might be to use a Raspberry Pi, running my sonās much newer OmniThing project. It does not yet support all of the same devices as ST_Anything, but it runs on a Pi, or ESP8266, with very reliable WiFi connectivity.
Iām new to this project and would greatly appreciate anyoneās assistance. My goal is to merely turn the LED on the ESP8266 off and on with smartthings. What Iāve done is created a virtual switch in smartthings and tried to integrate it using the āButton Controllerā app. When I hit refresh in the app, my serial port on the ESP8266 updates, however, the switch remains off. Can anyone provide me with a clue for what I need to do?
Thanks
Matt