[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

Ok, that Is NOT a ST_Anything sketch! :wink:

Please start with my ST_Anything_Multiples_ESP8266WiFi.ino sketch to get a working baseline.

Then we can help you make changes to suit your requirements.

1 Like

Thank you so much. I didn’t know where to start. - Psi

You can’t do all of that. The baud rate is whatever the board supports, not what you want it to be. And the 12-E supports 115K. Agree with Dan
start with the example sketch included in the library and edit it for your needs. That’s the way i started. Couldn’t be easier.

Thank you, Ryan! You and Dan have been so responsive! I’ll do that. - Art

2 Likes

If can’t figure it out, just post your sketch here. Little tip though, what Dan referred to as “preformatted text”
after you paste into the forum, highlight your sketch/code and then click the </> icon right up above. It makes it SOO much easier to read. :slight_smile: Good luck!!

1 Like

Oops! I Clicked on the “opening” </> icon , but didn’t realize I needed a terminating tag. (I should’ve known, given the HTML’ish motif.) - Psi

I’m working on adding support for a barometric pressure sensor. Looking at the code used in “ST_Anything_TemperatureHumidity” and the example code, there should be a device handler of type temphumid. I searched the github repository, and there are references to it in the deprecated groovy handlers, but there’s nothing in the current handlers.

Is it still used? If not, can you explain how the parent knows to create both temperature and humidity child handlers? Is it just based on the “temperature1”, “humidity1” arguments passed in the .ino file when the polling sensor is defined (ie, each is treated as the device handler name)? I was planning to copy this as temphumidpressure to create 3 children for sensors that support all 3.

Josh,

Yes! You’ve got it figured out. ST_Anything implements a very simple ascii “name value” pair data structure for data transfer in both directions. The DHT TempHumid sensor is unique as it measures two independent attributes, termperature and humidity.

So, while every other ST_Device only needs to be named correctly (i.e. the first argument like F(“switch1”), or F(“smoke1”)), the devices with multiple name/value pairs need to know what names to use when transmitting their data. That is why I added the “temperature1” and “humidity1” arguments to the DHT device’s constructor.

I am curious which ST Capability you are planning to use for barometric pressure? There is no ST standard Capability that I have found for Barometric Pressure, or Atmospheric Pressure. The closest thing that I see is ‘Sound Pressure Level’, but it is not really an exact fit
???

So, either you’ll need to use an existing Child Device Handler, like ‘Voltage’, or you can create a custom one. The problem with custom capabilities is they are not very useful in Standard SmartApps (i.e. they cannot be “seen”). webCoRE does allow you to use custom attributes, so you could just use capability “sensor” if you go the custom route. Also, you’ll need to modify the Parent DTH to accept a new capability, like “pressure1 1.01”. Take a look near the bottom of the Parent DTH and you’ll see the lookup to determine which Child DTH to use to create a Child Device. It should make things a little more clear.

Hope this helps.

Thanks! I haven’t looked into the device handler and ST Capabilities very much yet. I don’t plan to really do anything with the data other than log it (webCoRE I believe allows saving to a Google Sheet) and have it available to glance at in the SmartThings app. I’m mostly implementing it because this particular sensor has that added capability in addition to temperature and humidity, and for my own curiosity to see how the pressure changes day to day.

From your explanation, it sounds like the custom attribute might make the most sense for my use case? Ideally though, I’d like to implement it in a way that would be useful to other people if they also have the same sensor. But offhand I can’t think of anything useful that could be done with a SmartApp in response to pressure changes.

I think a custom attribute makes sense for now. Since it will be non-standard, you’ll have to create your own Child Device Handler and modify the Parent DTH accordingly.

Dan,

I have this controlling my garage door opener, and it works great. I have a NodeMcu connected to one of the opener’s remote controls. I added a contact sensor via a micro switch attached above the top of the door. The contact is actuated by a paddle that I attached to the door and makes a solid connection. Occasionally the door contact reports that the door is open only when the door is actually closed. It usually is only momentary and if not refreshing the parent corrects the false indication. Would you know why this is happening and is there anything I can do to fix this? Either way this works great and has been easy to set up. I would just like to integrate this contact sensor and some others with my Smart Home Monitor.
Thanks for all your work.

I am a little confused. Can you explain the issue with a little more detail? Is the issue only with the display in the ST Application? Or are you saying that you have to click ‘Refresh’ on the Parent Device in order to get the device’s state to update?

It would help if you posted your Arduino Sketch here so we can take a look. Make sure to remove your WiFi credentials.

That fixed it, thanks!

1 Like

Would anyone know the best way to send data from one NodeMCU to another? I have two NodeMCU’s running with ST Anything and i would like to send the temperature data from one of them to the other so i can display the data on an LCD screen connected to it. I was just wondering what options there are for doing this? Is it possible to retrieve data from other sensors connected to the same SmartThings hub?

This may give you some help.

1 Like

Trevor,

There is no obvious solution to get data from one ST_Anything instance to another. I am worried about attempting to create additional network traffic between the two NodeMCU devices as ST_Anything is constantly using the ESP8266’s WiFi to send and receive data from the ST Hub. I am not saying it wouldn’t work, but I do know that the ESP8266’s WiFi implementation does have some limits on how many active network connections are allowed. You also do not want to intercept packets intended for ST_Anything’s main logic.

You can easily link to the two devices together via SmartApps like Simple Lighting or webCoRE, the same way any other two devices can be linked together. However, that is not going to easily get your temperature data from one NodeMCU to another for display on a local LCD panel.

If I think of any ideas, I’ll be sure to share them here.

A local power source sounds like a more practical solution. At 5.9 ohms, 1.2A would incur a 7V drop, which should prevent the camera from operating, if it really needs the 12V. 120mA incurs a 0.71V drop which should be fine. Mixing power and signal on a cable also presents a crosstalk environment whereby your video quality could suffer, though CAT5 may tolerate it for your application because digital transmissions are inherently immune, as long as the noise is within your signals’ specification. You might be able to run 24VAC and use a 12VDC power supply on the camera side (or an alternate low impedance energy storage devices which can also present a hazard).

1 Like

Hey Guys, quick question I may have missed somewhere.

Is there a better way to change your wifi credentials besides reflashing the Arduino code? It seems like that would be quite a chore if you have multiple integrated circuits set up all around your house.

Thanks in advance. Also, thanks to Dan for his tremendous work on all of this. Greatly appreciated.

You could use OTA.
https://randomnerdtutorials.com/esp8266-ota-updates-with-arduino-ide-over-the-air/

1 Like

As @Jason_Brown mentioned, the ESP8266 modules now support Arduino IDE OTA updates. However, it would appear to be a little tricky if what you’re wanting to do is change the WiFi credentials. You have to update all of the ESP8266 devices first, with a new sketch/credentials, and then change the WiFi credentials on your Router/Access Points.

I am curious as to why you’re changing the WiFi credentials?

You could try using a guest-type WiFi SSID and credentials for the ST_Anything devices, as long as your router does not impose restrictions on this SSID to prevent ‘talking to LAN devices’. This would then allow you to change your main WiFi password without impacting the ESP8266 devices.