[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

Hi, Dan. I did a download zip of your repository so I believe I should have all the files. Visually they all appear to be there.

I have also compiled WiFiscan and WiFimulti without a problem.

Thanks for all the time you have put into this project and for your help.

Got motions working, thank you for the help as always!
I have noticed something. If the board stops responding or is disconnected somehow, the app simply stays at the last state. It appears it is working, but until you look close, you don’t notice. Do you have a way to report if communication is lost?

Thanks

All I can tell you is to go back through the ReadMe, step by step, and make sure you didn’t miss anything in setting up your Arduino environment.

Are you using v2.3 of the ESP8266 Board Manager package?

@lukeb each child device has a custom attribute called LastUpdated which has the last date and time an update was received. By default, this should update at least once every 5 minutes.

You could use one of the Community SmartApps that can notify you if a device does not receive an update within a certain timeframe.

I found I am using v2.2 but whenever I try to update to 2.3 I get an error downloading 2.3.0.zip.

I tried downloading Arduino repository but that only gets me v2.2 again.

I will keep working on it. Thanks.

Are you trying to download the ESP8266 Board Package for Arduino manually? If you follow the instructions in my ReadMe, it should point you to another website (SparkFun, IIRC) that shows you how to easily add the ESP8266 support to the Arduino IDE. You then use the built-in Arduino IDE ‘Boards Manager’ feature to adjust the version of the ESP8266 Core support.

From my ReadMe


“If building for a standalone ESP8266 board, make sure you have configured the Arduino IDE to include support for these boards. Follow the guide at ESP8266 Thing Hookup Guide - SparkFun Learn”

1 Like

I can download and instal Arduino and instal esp8266 board as in the instructions you sent, but when I use board manager to change the version I get an error and I haven’t found a way around it yet. This also happened when I first installed Arduino about 2 years ago and I gave up then.

Well, I spent about 6 hours checking, deleting Arduino couple of times including all directories, found a Arduino forum with many things found including altering java settings. Tried deleting all java and reinstalling and rebooting PC. Also tried through a proxy server. The final result is now I haven’t got any esp8266 boards and can’t get any to download.

That sounds very frustrating. Do you have another computer that you can test with? If not, have you tried logging into your computer with a new account/profile and trying again? If nothing else works, it sounds like you may need to clean install windows.

I am trying to find a way to put a power sensor into the somethings via ST_anything. I have been able to read a SCT013 current transformer using the OpenEnrgyMonitor using the EmonLib.h library. could a sensor type created to monitor power from the SCT013?

That’s a good question, and one that I’ve tinkered with a little myself. Reading accurate values of a CT (current transformer) is not a trivial thing to do.

Can you explain what your end goal is? Maybe there is a simple way to achieve what you’re trying to do without a bunch of complicated power monitoring software.

If accurate power readings, tracking, and trending are important to you, I’d recommend getting an IoTaWatt device (http://iotawatt.com). The creator of this device has been working hard on this device and software for a few years now. It is all Open Source, so you could actually build one yourself. However, I gladly handed over my money for one as I believe 1) he deserves to be compensated for his work and excellent support AND 2) his device is safety rated for NA and EU.

If you really want to use the EmonLib, I’d recommend you just use my “SmartThings
” communication libraries to integrate an Arduino sketch with SmartThings. ST_Anything is designed for more general purpose devices. I believe the timing requirements for monitoring a CT are pretty tight. ST_Anything is not designed for that. ST_Anything uses the “SmartThings
” libraries behind the scenes for all communications with the hub. It is pretty easy to use, assuming you’re a coder.

This project started out as a way to monitor my washer and dryer. I have an esp8266 with a water sensor, for leaks, a bmp280 in the outlet duct of the dryer to monitor temperature, humidity , and pressure to determine when the dryer is done. I also have a motion detector to turn on the room light and a DS18B20 temperature sensor for ambient room temp (just because I could). To determine if the washer is done I have an Aeon Labs DSC06106-ZWUS power monitor and when the current drops close to zero the washer is assumed to be done. I would like to put the washer function in with the other sensors and hence my looking at adding a CT to the st_anything.

The emon.lib seems to have only two parameter, the pin number and a correction factor. I am guessing to integrate this with st_anything is would need to create polling sensor and add this in. Is there one of the existing polling sensor libraries that would be a good start for this.

I believe you could do this with ST_Anything, since you’re just looking for an ‘on’ versus ‘off’ result. I would suggest you start with the PS_Voltage.h and .cpp files as a starting point. Try just polling the CT connected to an Analog Input pin to see what kind of results you get (without the emonlib.) You might get lucky.

Internally to the PS_Voltage class, you could start modifying the code to perhaps smooth out the signal since it will be cycling at 60Hz. You’re just looking a a continuous period of time where the voltage does not change to know the washer is ‘off’. If the voltage starts changing, then you can send an ‘on’. I would recommend sending naming your new polling sensor a F(“switch1”) name in the constructor. Inside the code, only send data when the state changes and send “on” and “off” instead of the raw voltage. By doing this, ST will receive either “switch1 on” or “switch1 off” and create a Child Switch device which will have nice “on” and “off” states for readability.

That last bit may be a bit confusing
 Let me know when you get to that point if you still have any questions.

Good news, I have managed to compile the a smartphones multiples sketch on my laptop. Looks like I will be working on that from now on. Thanks again for all your work and patience. Of course, you may hear from again.

Hey Dan
 I am getting back to making some custom things using your code. I am starting over and I can’t get the button devices to be created. I am using a W5100 board and a very simple variant of your script that defines only 8 simple buttons. The install goes fine but it doesn’t make the child devices and it keeps saying I haven’t set up the parent completely, but I did. What am I missing? Do I have to define at least one non-button item?

Never mind
 I think I figured it out. Buttons don’t make virtual devices - they are attributes of the parent device. I saw it register activity in the log when I grounded the pin so it is working. I added two contact devices just for giggles and they were created just fine. I think I am now all set. You might want to clarify how buttons work in the documentation - unless I missed it.

1 Like

Anyone know why an ESP8266 might give errors trying to upload a sketch? I get the same error even if I try to upload a simple “blink” sketch. It just says mem upload error. I have AnyThing working great on a W5100 board but both of my ESP8266 boards give this error. They are older versions so I’m thinking they may have outdated firmware. They say “ESP8266 MOD” on the chip.

Yep, it’s in there
 :wink:

Button Devices - "where do they show up?" Buttons show up in the SmartApps that use them. The Aeon Minimote Device Handler, for example, has one tile with a remote control icon on it. Nothing else. It also has zero configuration options as well. I used this as a model for adding "Button" capabilities to ST_Anything per a user request. When you define the number of buttons (via the gear-based configuration menu in the parent DH) you are announcing to all SmartApps the number of buttons defined. This in turn allows SmartApps like "Smart Lighting", "CoRE", and "WebCoRE" to know how many "buttons" to offer you to configure an action. So, the easiest test is to create a new "Smart Lighting" automation, where you define the action to be based on a button "pushed" or "held" event from the Parent Device (no child devices are created for buttons). Give it a try! I have used this successfully in the past for testing purposes.

You have changed the Board Manager to the NodeMCU ESP8266 entry, correct? And, the Arduino IDE is properly finding the COM port created by the ESP8266?

Yup
 I have the board set properly and the board is identified on the serial port. I have no clue why it isn’t working. I am thinking my ESP boards have a non-Arduino firmware on them
 I vaguely recall reading something about Lua firmware somewhere