[RELEASE] ST_Anything - Arduino/ESP8266/ESP32

The bench testing seems to work great - the only hiccup is when I press the tile in ST - the first on pulse seems to last a few seconds before it begins the timed pulses at 0.5 secs. Seems like it is the connection/transmit time between ST and the ESP8266 - once the connection is made it works as expected, for subsequent tile pushes. Thanks for the advice!!

1 Like

I created an additional variable (flow) in my sketch that I used to be able to see in the history of the parent device. Its an irrigation control with 8 relays and a flow meter counting pulses from a hall sensor. In logs, I can see the variable show up as “Parsing: flow 191”. Is there a way to view this in the SmartThings app or create a child device that shows the value?

Sure… What you’ll need to do is change the text that you’re sending from the sketch to ST from “flow 191” to one of the supported names, like “voltage1 191” (the numeric “1” as a name suffix is required!) This will cause the parent device to create a Child Voltage device and update its value to “191”. Another suitable option would be to use the Child Power device, which means you would have the sketch send “power1 191”.

Play around with the various numeric child devices to see what works best for your needs. Unfortunately, using custom attributes is much more difficult then it used to be back in the ST Classic App days.

1 Like

Hi @ogiewon , thanks for all your work for St_anything

Im pretty sure this platform is the best for me to do what im looking for. Ive seen few post up there that are very close from what i want to know but i dont have big skills into this !

Im using some Lolin Node MCU v3 Esp8266 with a esp-12e chip , my goal is to monitor battery voltage using A0 analog port 0-3.3v that i can scale to 12vdc .

I want to monitor a 12v deep cycle battery in my trailer that is solar charged into smartthings

I have looked to the Multiples_esp8266 WIFI into the library but it doesn’t seems to include any analog input support for voltage monitoring,

is there a way to do it ?

Thanks for your support !!

1 Like

I dunno how I did that , because I’m a very beginner at all this , but ive been able to modify the code by doing some copy paste from other device handlers that you made , and doing some tweaks… but ive been able to have a voltage child app created and working with my Node Mcu V3.0. Now i need to buy some resistors and scale this thing out .

1 Like

@dsrq - Great work! Glad you were able to figure out how to add the PS_Voltage device to a sketch and get it working.

Can you share your code examples? Was looking for something very similar.

@EdHayes3 - If you explain your requirements, I’d be happy to help guide you through the process of configuring an ST_Anything Arduino sketch.

Is it possible to use this library to read the status of other devices in smartthings (i.e. a light switch)

Not really directly possible, without some workarounds.

Can you please explain exactly why you’d like to do this?

I would like to make some motorized blinds but don’t have easy access to power for the window so I was hoping to make it battery/solar powered, but that would require using the sleep function of the ESP8266. So I was thinking if I could create a virtual switch to be a place holder for the state of the blinds, then when the ESP8266 would wake up and check the status of that virtual switch and either open or close the blinds based on the status of the virtual switch.

Interesting idea… :thinking: Unfortunately, ST_Anything is not designed where the microcontroller can request a data update from SmartThings. It is definitely something that you could add if you wanted to, though.

Upon wake-up, have the microcontroller send a command to the Parent device. It would need to be unique, something like “request Refresh”. Then, have the Parent device intercept this message and somehow request the child devices issue their last command again. Make sure the microcontroller stays awake long enough to receive the command.

The parent/child devices you mention are these ST_Anything devices, I want to get the states from other devices in my smartthings hub.

I am thinking I may need to create a smartapp to allow access to the devices in my smartthings hub?

Ideally I would have the 8266 send a POST/GET request to a URL and it would return the state of a specified device

Yes, I was referring to ST_Anything parent/child devices.

Based on what you’re trying to accomplish, you might want to skip ST_Anything and instead, look at using one of the newer ST API’s to directly communicate with the ST Cloud.

turned out to be easier than i thought.

just had to create a token at SmartThings. Add a little smartness to your things.

then sent this GET request to the below address with bearer token authentication to get list of device ids
https://api.smartthings.com/v1/devices/

once you have a device id you want then you GET request to the following to get status
https://api.smartthings.com/v1/devices//status:

thanks for the help!

2 Likes