[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

I’m migrating to Openhab, would be nice to have a binding equivalent to the handler you have for ST

I’ve never messed around with OpenHAB. Unfortunately, when I wrote ST_Anything along with my son, we were focused on the ST Zigbee ThingShield. Thus the communications interface is a very simple ascii name value pair (space delimited.)

When i added Ethernet support, I kept the same simplistic interface. It does not comply with any true standards.

Not sure what it would take to add OpenHAB support.

Have you looked at “MySensors”? I think it is supported by OpenHAB… :thinking:

1 Like

I hadn’t come across the MySensors project before, looks perfect.

Thanks for the tip : )

Can anyone help me get ST_Anything working with an Arduino Uno with a Tentacle Shield using I2C to talk to sensors?

If it is using I2C sensors, then I would hope it should not matter that you’re using a special shield to hold these sensors.

What are the sensors? Specific model numbers? Do these have readily available Arduino libraries? Decent example sketches?

I support many I2C sensors already. Temperature, Humidity, Pressure, Illuminance…

Adding new sensors is simply a matter of adding a new device class (.h and .cpp) which implements one of the standard SmartThings capabilities and reads data from a specific sensor type using an available Arduino library. Plenty of examples available for I2C devices in the ST_Anything library.

That’s great.

I’m using the Tentacle Shield by Whitebox Labs to hold Atlas Scientific PH, ORP and temperature sensors.

The shield has 4 slots for these sensors and can communicate using I2C or serial.

Detailed description here:

https://www.whiteboxes.ch/docs/tentacle/t1/#/

This is a sample sketch:

https://raw.githubusercontent.com/whitebox-labs/tentacle-examples/master/arduino/tentacle-setup/tentacle_setup/tentacle_setup.ino

This is the github for the sensors in I2C mode:

This is the github for Whitebox Labs:

BTW, I sent a private email – not sure if you received it.

Thank you,

Joseph

Yes I am still looking. From what I believe to be a good solution I am thinking

Some Sort of Arduino device (with wifi to connect to network, i do have ethernet close currently)
2 Relays (either separate or built into board)
2 Magnet sensors

I am basing this off the garage door device in ST_Anything. I can run wires from magnets back to the board, but also want to know there there is anyway to the ST Multipurpose sensors.

Right now I have the 4 port relay board in place in the interim as basic push buttons, but this is a cool project for me to work on. Just looking for any input as to best equipment to buy as a first step into playing in this arena.

Thank you @ogiewon for awesome work. Got an initial version of a dimmer device up and running today on NodeMCU.

I am unable to add a dimmer device to a scene - when I select my dimmer device on creation of new scene, the app refreshes and goes back to scenes list. This is on Android. Is this a known behavior?

Thanks,
-MB

Good question. Unfortunately, I don’t know how Scenes on ST work. I have never used a ST Scene, and these days I am running Hubitat as my primary hub.

Hopefully another ST + ST_Anything user will be able to assist.

I’m using ST_Anything and things work pretty well, I have some lights running through a relay and everything works most of the time. The problem I have is really with smart things, but I’m not sure where else to ask this. If the power goes out, or if the wifi disconnects at the set time to turn on, the lights never turn on. Is there a way to create some kind of looping check during a set time to turn them on, and again to turn them off? There only appears to be a way to set a specific time on and off, and I can’t imagine going through and creating 288 more on routines to run every 5 minutes being the smart way to achieve the goal. I looked at the IFTTT stuff, and it doesn’t seem to be any smarter.

I guess I was expecting it to be like programming where you could make a loop, for instance, If time is > 0700 and if time is < 1900 then turn on switch A, else turn off switch A, have it loop infinitely and wait 300 seconds between. If anyone knows how to achieve this kind of goal, I’d be really appreciative. I haven’t even been able to find a good way to search what I’m looking for.

Take a look at webCoRE. It is a community created rules engine for SmartThings that should allow you the flexibility you’re looking for.

Curious… :thinking: How often are you losing power and/or WiFi at your home? These are both incredibly rare at my home.

It’s not often, but they control the lighting for my bearded dragons so even one time when I’m at work can be a pretty big problem. I’ll check that out.

I need help on this one. Im a beginner. I had set up my keurig to work with alexa by using an arduino uno a 5v board out of a usb wall plug and a smart light bulb… ive since broken that uno and now i have an esp32 and want to hook it up to smart things to control my keurig. For some reason i cant find a link that with an example i can work from.(they all want to add in complicated things. I need to control 2 buttons and a switch.

Were you using ST_Anything on your UNO? If so, much of the sketch can be reused on the ESP32.

Or, is this your first time using ST_Anything? If so, start with the example sketch ST_Anything_Multiples_ESP32WiFi and get that running just to get used to how ST_Anything works. From there, we can tweak the sketch to remove unnecessary devices and to add exactly what you need.

When you say “control two buttons and a switch”, please provide some more details of what you mean exactly. I don’t know if these are part of the Keurig or something else. A simple wiring diagram would be very helpful to explain what you’re trying to accomplish.

Welcome to the community!

Ok so no on the st_anything. Keurig 110 power>smart light bulb insides>5v board>uno. Uno went to power button and to brew button as well as lid switch. Unforturately the code my have been accidentally altered as well. The switch part is the worst. Currently the way i activate it manunally is by first seperating then touching the 2 lid switch wires together to activate. So its state is always on and needs to be turned off then on to activate

Also where do i get the st_anything info to set up? What libraries do i need?

That information is all in the ReadMe in my GitHub repo…

here is the original code:
we had it in the setup function so it would only run once because it was the aurdino was being turned on and off my a smart light bulbs board.
MyKeurig

Compiled 11/27/18

This Sketch serves the basic function of cycling a Keurig k35 model's brew cycle Autonomously without the need
to open the lid. It presses the power button, cycles the lid, brews a (medium size in my case) cup of coffee,
then safely shuts down the Keurig after completing the brew. This can all be achieved by modifying the existing
button panel harness by means of elongating the ground, power, lid, and brew circuits, and attaching them as follows:
Ground to D1
Power Button to D2
Lid Switch to D3
Desired Brew Button to D4

Thanks for checking out my first sketch and Happy Brewing

*/
const int power = 2;
const int lid = 3;
const int brew = 4;

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin D2 as an output for “POWER BUTTON”
pinMode(power, OUTPUT);
// initialize digital pin D3 as an output for “LID POSITION SENSOR”
pinMode(lid, OUTPUT);
// initialize digital pin D4 as an output for “10oz BREW BUTTON”
pinMode(brew, OUTPUT);

//BEGIN BREW CYCLE
//SET ALL OUTPUTS TO OFF
digitalWrite(power, HIGH);
digitalWrite(lid, HIGH);
digitalWrite(brew, HIGH);
//TOGGLE POWER SWITCH
digitalWrite(power, LOW);
delay(1000);
digitalWrite(power, HIGH);
//WAIT TO POWER UP, CYCLE LID POSITION
delay(5000);
digitalWrite(lid,HIGH);
delay(1000);
digitalWrite(lid, LOW);
//WAIT, TOGGLE BREW BUTTON
delay(5000);
digitalWrite(brew, LOW);
delay(1000);
digitalWrite(brew, HIGH);
//WAIT POWER OFF 15MIN
delay(900000);
digitalWrite(power, LOW);
delay(1000);
digitalWrite(power, HIGH);

Serial.begin(9600);
}

// the loop function runs over and over again forever
void loop(){

thank you for some reason the it was only showing me the esp32 setup get hub on this page

So, that original sketch simply toggles three digital outputs. I am confused as to the purpose of this. Is the goal to have SmartThings start a brewing cycle at a certain time each day? Is that what the purpose of the smart bulb’s zigbee radio board? Were you using the zigbee board out of an old Cree bulb by any chance? What was the previous home automation system, if not SmartThings (out of curiosity!) ?

My guess is the bulb’s zigbee board received a command from a home automation system, which then caused its output to somehow reset/power on the Arduino. The Arduino then simply toggled the digital outputs per a hard-coded schedule.

Does that about sum it up?

If so, you can use an ESP8266 or an ESP32 board to replace the smart-bulb’s zigbee board, as well as the Arduino UNO (assuming the Keurig can be manipulated in the same manner using a 3.3v board like ESP8266 or ESP32, as opposed to the 5v board of the UNO.

Do you have some relays wired between the UNO and the Keurig?

A wiring diagram will be very helpful… :wink:

so the goal, which i did succeed for a couple months until the keurig malfunctioned, was to wake up naturally (not any specific time) say alexa good morning. and while still in bed my coffee would brew and my bathroom heater would turn on and my bathroom lights would slowly lighten up. honestly the hands down best way to wake up in the world. lol. give me a min and ill draw one up… also no relays

1 Like

So, it would probably be easiest to simply create this as a specialized Arduino sketch, that uses my WiFi communications library to integrate with SmartThings. Basically, you just need an “Alexa to SmartThings to Arduino Switch” device. Then, when the Arduino receives the command to turn on the ‘switch’ device, the sketch will run your sequence of digital output commands. At the end of the cycle, the Arduino will tell SmartThings that the ‘switch’ has been turned off, so everything is ready for the next cycle.

When I get some free time, I’ll whip up a very simple example sketch that you can use and then add your custom code to. One thing that will need to happen is that all of your hard-coded ‘delay()’ statements will need to be replaced with ‘millis()’-based timing logic instead. The WiFi communications library does not like long delay() statements as they block the Arduino board from servicing the network stack.