Pro Tip: When posting code in the forums, please use the “Preformatted Text” feature in the menu bar (paste your text, highlight it, then click the “’< / >’” button in the menu bar.) This makes your code readable and prevents the forum software from stripping out certain characters.
One thing that stands out is you are missing the custom “Attribute” statements in the Device Handler necessary for your “motion0, 1, 2, 3” tiles. You also listed “motion1” twice in the “details()” section.
To get these 4 motion detectors to be exposed independently, you will need a “Multiplexer” SmartApp and 4 virtual motion detector devices. You need to make sure you pay VERY CLOSE ATTENTION to using the exact same names (case sEnSiTiVe) throughout the Arduino sketch, Device Handler, and Multiplexer SmartApp. The virtual motion detectors will be generic.
I have been working on an example where I create multiples of each device type in one Arduino Sketch, along with the corresponding Device Handler, Multiplexer SmartApp, and associated virtual devices. Hopefully I’ll have some free time to finish this example up as I believe it would help users.
Dan, your response of the smartapp not having to ‘see’ things in the Things view was the answer.
I had not tried using the smartapp because I made this mistaken assumption. A quick test of the smartapp pointing to the temp and switch on the same device worked…just the way it is supposed to…
The DH and .ino are pretty much vanilla your code with the exception of adding the DS18B20 reference instead of the DHT.
This is going to be controlling the valve that feeds water to my solar panels and heats my pool in case anyone is wondering what i’m doing…
Thanks to all those that indulged me on this one…
Finally, I’m ready to try to get this pulse counting implemented since I have now the ESP8266 and your ST_anything_ESP and thus dont need the Thingshield and Arduino Mega. Does the .ino and .groovy need to be modified for ST_ESP and arduino - non-thing-shield.
I just looked through my PS_PulseCounter class that I wrote back in 2015. This class is specific to the Arduino 2560 due to the need to implement Hardware Interrupts to properly count the pulses accurately.
Therefore, I really doubt it will work on the ESP8266 platform in its current configuration. When I have some time, I’ll see whether or not this code can be ported to run on the ESP8266 platform.
I still support the Arduino Mega with either the ThingShield (Zigbee) or an ESP-01 (Wifi) for network connectivity. However, I have not yet ported the old PulseCounter sketch and Device Handler example files to work with the newer Ethernet connectivity.
I already added support for using an ESP-01 module as a “WiFi shield” for the Arduino Mega. Check out my ST_Anything_WiFiESP.ino example sketch.
If you want to use any ESP8266 module as a standalone controller, try the ST_Anything_ESP8266WiFi.ino example sketch. I have run a stripped down version of this sketch on a ESP-01. I had to strip it down due to only having 2 GPIO pins.
I may actually have two shields. I definitely have one never used spare Shield, and may have one that I used (very little) for prototyping/testing new device types. I will check tonight and send you a private message.
BTW: Giving up my precious Shields would not have been possible without all of Dan’s great work!
grateful for your work I am from Colombia and I have smartthings in my house and I am a DIY enthusiast, I have saved some Xbee WIFI S6B, I would like to know if these can be connected to smartthings
I have never used an Xbee module, but others have. Search the forums and you’ll find some examples, although they are pretty scarce. The old ST ThingShield (Zigbee) and Ethernet based connectivity are much more popular. These are the connectivity options I support in ST_Anything.
Dude… you rock!!! I just now noticed the whole cancellation deal with ThingShield and then read all the angry posts about it. Your solution is not only faster and more elegant, it is cheaper and more standard. If the ST folks were really on the ball they would have thought of this themselves. Anyway, thank you. You have made so many important contributions to the community. I ordered a few W150’s and a few ESP8266’s to try it out and I can’t wait. Now I just have to think of a fun project… maybe controlling my hot tub…
Ken - Be sure to try using the latest and greatest code which eliminates the need for virtual devices altogether. My latest software uses the new Composite Device Handler (Parent/Child) to permit one device to have multiples of a single ST capability (like having 8 contact sensors on one arduino.) I haven’t updated the Github ReadMe yet, but I am working on it…
I had a similar issue and wonder if it’s the 5V output of the Arduino going to the 3.3V ESP-01. I bought a 5.5V-3.3V voltage regulator to try, but changed my project to use the Arduino Ethernet Shield. Only one regulator would be needed as the 3.3V output of the ESP to the Arduino would be fine. I did find a couple post that indicated that the ESP should be 5V tolerant for some of the input ports, but not sure if this is completely correct.
Anyway, something to consider as the 5V input my eventually mess up the ESP. If you try it before me, please let us know your results.
Update: I do have a separate 3.3V supply input voltage for my ESP-01.
I agree with @Garnet. I too have seen some unstable behavior from the Arduino + ESP-01 combination.
Can you please share a wiring diagram of exactly how you have connected the ESP-01 to the Arduino? Are you trying to power the ESP-01 directly from the Arduino’s 3.3v pin? Or do you have a dedicated 3.3V power supply for the ESP-01?
Since I already have the system running and it has been running great under the old board does anyone know if you can set this up to openand close a damper and turn off and on a fan on a fresh air duct that I am going to through into my HVAC system. I would like to be able to open and close at a percentage based on voltage.
I have the same problem. After about a week it freezes but the networking is still responsive. I originally had the ESP-01 then tried it with the w5100 shield and same issue on both the new and old st_anything code versions. Sucks cause I really love this setup. In order to get it working I have to power cycle the board and then it repeats