[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

Yes, this is totally normal. ST_Anything sends an update of every sensor’s value every 5 minutes to ensure that ST has up to date, correct data. This feature can adjusted in the “…\libraries\ST_Anything\constants.h” file.

You can disable this behavior by uncommenting the following line

//#define DISABLE_REFRESH		//If uncommented, will disable periodic refresh of the sensors and executors states to the ST Cloud - improves performance, but may reduce data integrity

You can adjust how frequently the periodic refreshes are sent by editing this line

		//Interval on which Device's refresh methods are called (in seconds) - most useful for Executors and InterruptSensors - only works if DISABLE_REFRESH is not defined above
		static const int DEV_REFRESH_INTERVAL=300;				//seconds - Used to make sure the ST Cloud is kept current with device status (in case of missed updates to the ST Cloud) - primarily for Executors and InterruptSensors - only works if DISABLE_REFRESH is not defined above

As long as it’s normal, I’m happy with how you’ve done it.

Fantastic work Dan, appreciate your help. Happy to document what I’ve done in very simple terms if you need documentation help of that sort [I don’t think I can help with the techy stuff just yet]

Side note - noticed you around the Xbee threads - are you planning to add it to your libraries? see here - https://create.arduino.cc/projecthub/CR76/samsung-smartthings-arduino-switch-8c7fac?ref=user&ref_id=158865&offset=0

NB: though the Xbee modules are still pretty pricey at around £17 each!

Currently, no plans to add Xbee support. Still trying to get all of the LAN connected devices to be as reliable as possible.

Currently, the Arduino + Thingshield, Arduino + W5100 Ethernet Shield and NodeMCU ESP8266 are the most reliable platforms.

The Arduino + ESP01 (for WiFi only) is not very reliable. I am trying to figure out why, but I honestly think the combination is just not very robust in its current form.

I have also been adding support for Arduino + W5500 Ethernet shield, Arduino + ATWINC1500 WiFi , and Arduino MKR1000. It’s been taking longer than I hoped due to lack of spare time.

No time for Xbee support :wink:

Dan

1 Like

ST_Anything V2.7 is released with support for the Arduino W5500 Ethernet shield as well as a new NodeMCU ESP8266 Alarm Panel example sketch, and some other minor improvements.

Adding the additional W5500 Ethernet shield required me to break apart the “SmartThings” library into smaller folders. This was required to avoid compiler/linker issues due to so many of the Ethernet and WiFi devices using the exact same C++ class names. Please be sure to replicate the Arduino libraries exactly from my github repository.

Please let me know if you have any feedback.

1 Like

WARNING: Do not manually delete child devices!

Heads-up everyone (@erocm1231). SmartThings apparently has modified some of their back-end code for the Composite Device Handlers. As a result of this change, if you manually delete a CHILD device (either via the ST Phone App or the ST IDE) you will end up breaking your entire Composite device. The basic problem is that the “childDevices” collection is not properly cleaned up, leaving a NULL object in it. This was always the case, but I had worked around it using proper error handling to ignore the returned NULL child object. Now, I cannot retrieve any child objects in the childDevices collection because one of them is NULL.

If this happens to you, simply delete the PARENT device, which will delete all children as well. Then recreate the Parent and the children will be automatically created for you again. I know this is inconvenient, especially if you have your child devices integrated into various SmartApps. If you delete a child device after recreating the parent, the whole nightmare will start over again.

There is nothing I can do about it currently, until ST fixes the issue on their end.

@bflorian, @Jim, @slagle, @Tyler (please forward to anyone else at ST who can help, please! :slight_smile: )

To recreate the issue, make sure to create a few child devices with isComponent set to false. Delete 1 child device. Then, within the parent’s parse() routine, simply try to log childDevices.size(). This will throw a NullPointerException. Same thing happens if you try to iterate through the childDevices collection using childDevices.each.

Here’s an example of the logged error from simply calling

log.debug "parse() childDevices.size() = ${childDevices.size()}"

in my parent parse() routine,

Error:

12:50:46 PM: error java.lang.NullPointerException: Cannot get property ‘dateCreated’ on null object @ line 92

In the past, the collection’s size would simply never decrement when a child was deleted. This resulted in a null child being returned, which I was able to handle through a try/catch block. Now, we cannot even retrieve the size of the collection without throwing an exception, let alone iterate through the collection. Also, you cannot add a new child to the collection once it is in this state.

Any help would be greatly appreciated. Seems like the childDevices collection just needs to be properly cleaned up upon child deletion, to avoid this issue altogether.

Thanks,
Dan

Seems like a bug that really needs fixing.

1 Like

I have just released v2.71 of ST_Anything which includes the long awaited fix for the Arduino + ESP01 (for WiFi only) configuration. Note - the new version of ST_Anything now requires the Arduino IDE’s Serial Monitor window to use 115200 baud rate. This one change made the single biggest impact to resolving the issues I was able to reproduce with respect to reliability when using an Arduino + ESP01 combination. I have also added automatic reconnect logic in the event the WiFi signal is lost.

v2.71 also adds support for the Arduino MKR1000 board AND the WiFi101 shield (or Adafruit ATWINC1500 breakout board). Note: v2.7 added support for the Arduino + W5500 Ethernet Shield as well.

Adding all of these Ethernet/WiFi combinations required me to break apart the one single SmartThings communications library into multiple smaller libraries to avoid compiler/linker issues. Make sure you get all of the new “SmartThings…” and “ST_Anything…” Arduino libraries and replace (do not merge!) your old ones.

As usual, feedback is always welcome and appreciated!

Dan

2 Likes

Just wanted to thank you and your son. This works awesome. Couple of questions, just wanted some clarification. I want to use a relay module and some magnetic reed sensors to use as a garage door controller. I see what you have the “IS_DoorControl” however I am not clear on how to use it. In the code it says to change the name of the passed argument to include the name of the contact switch in your groovy code. wondering if this still needs to be changed, or what. Thanks.
For Example: st::IS_DoorControl sensor3(“leftDoor”, PIN_CONTACT_LEFTGARAGE_DOOR, LOW, true,
PIN_RELAY_LEFTGARAGE_DOOR, LOW, true, 1000);
//
// st::IS_DoorControl() constructor requires the following arguments
// - String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name
// - byte pinInput - REQUIRED - the Arduino Pin to be used as a digital input
// - bool iState - REQUIRED - LOW or HIGH - determines which value indicates the interrupt is true
// - bool internalPullup - REQUIRED - true == INTERNAL_PULLUP
// - byte pinOutput - REQUIRED - the Arduino Pin to be used as a digital output
// - bool startingState - REQUIRED - the value desired for the initial state of the switch. LOW = “off”, HIGH = “on”
// - bool invertLogic - REQUIRED - determines whether the Arduino Digital Output should use inverted logic
// - long delayTime - REQUIRED - the number of milliseconds to keep the output on

Use the new naming convention found inside all of the new ST_Anything_Multiples_****.ino sketch files. Also, near the bottom of the ST_Anything ReadMe, the device naming convention is explained.

The comment section in the IS_DoorControl.h and .cpp are slightly out of date. The new Composite Device Handler design expects each of the Arduino devices defined in your sketch to follow the new naming convention.

Let me know if you have any other questions. Depending on your relay board, you may need to tweak whether or not you need to use inverted logic for the output.

Dan

I’m not sure if I’m blind or what. The only references I can find are in the read me. which says:

 - Control: "doorControl1", "doorControl1", "doorControl1", ...

Which tells me the naming convention, and in the SmartThingsESP8266wifi sketch it says:

 #include <IS_DoorControl.h>  //Implements an Interrupt Sensor (IS) and Executor to monitor the status of a digital 
 input pin and control a digital output pin

However there is no demo of this command in the sketch, and nothing that I found that has an explanation of the arguments to pass. Thanks for your time!

I see the confusion… Sorry about the typo in the ReadMe file - I have fixed the naming convention section for the doorControl.

Also, the ESP8266WiFi example sketch is one of the few sketches that does not have the IS_DoorControl object shown as an example. I have modified a version of it below for you as an example. It uses D1 and D2 for the Reed Switch (Contact Sensor) and Relay respectively (which means I commented out the other devices in the example sketch that were using those pins.)

As I mentioned before, depending on your relay board (Active Low Logic versus Active High Logic), you may need to tweak the constructor arguments in setup() routine where the IS_DoorControl object is created. It is set up for a typical Arduino Relay board (i.e. SainSMart) which uses Active Low logic (i.e. pull the pin to ground to activate the relay.) If you can let me know what relay you’re using, I might be able to help figure out what the proper settings are for it.

//******************************************************************************************
//  File: ST_Anything_Multiples_ESP8266WiFi.ino
//  Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)
//
//  Summary:  This Arduino Sketch, along with the ST_Anything library and the revised SmartThings 
//            library, demonstrates the ability of one NodeMCU ESP8266 to 
//            implement a multi input/output custom device for integration into SmartThings.
//            The ST_Anything library takes care of all of the work to schedule device updates
//            as well as all communications with the NodeMCU ESP8266's WiFi.
//
//            ST_Anything_Multiples implements the following ST Capabilities as a demo of what is possible with a single NodeMCU ESP8266
//              - 1 x Alarm device (using a simple digital output)
//              - 1 x Contact Sensor devices (used to monitor magnetic door sensors)
//              - 1 x Switch devices (used to turn on a digital output (e.g. LED, relay, etc...)
//              - 1 x Motion devices (used to detect motion)
//              - 1 x Smoke Detector devices (using simple digital input)
//              - 1 x Temperature Measurement devices (Temperature from Dallas Semi 1-Wire DS18B20 device)
//              - 1 x Relay Switch devices (used to turn on a digital output for a set number of cycles And On/Off times (e.g.relay, etc...))
//              - 2 x Button devices (sends "pushed" if held for less than 1 second, else sends "held"
//              - 1 x Water Sensor devices (using the 1 analog input pin to measure voltage from a water detector board)
//    
//  Change History:
//
//    Date        Who            What
//    ----        ---            ----
//    2015-01-03  Dan & Daniel   Original Creation
//    2017-02-12  Dan Ogorchock  Revised to use the new SMartThings v2.0 library
//    2017-04-17  Dan Ogorchock  New example showing use of Multiple device of same ST Capability
//                               used with new Parent/Child Device Handlers (i.e. Composite DH)
//    2017-05-25  Dan Ogorchock  Revised example sketch, taking into account limitations of NodeMCU GPIO pins
//
//******************************************************************************************
//******************************************************************************************
// SmartThings Library for ESP8266WiFi
//******************************************************************************************
#include <SmartThingsESP8266WiFi.h>

//******************************************************************************************
// ST_Anything Library 
//******************************************************************************************
#include <Constants.h>       //Constants.h is designed to be modified by the end user to adjust behavior of the ST_Anything library
#include <Device.h>          //Generic Device Class, inherited by Sensor and Executor classes
#include <Sensor.h>          //Generic Sensor Class, typically provides data to ST Cloud (e.g. Temperature, Motion, etc...)
#include <Executor.h>        //Generic Executor Class, typically receives data from ST Cloud (e.g. Switch)
#include <InterruptSensor.h> //Generic Interrupt "Sensor" Class, waits for change of state on digital input 
#include <PollingSensor.h>   //Generic Polling "Sensor" Class, polls Arduino pins periodically
#include <Everything.h>      //Master Brain of ST_Anything library that ties everything together and performs ST Shield communications

#include <PS_Illuminance.h>  //Implements a Polling Sensor (PS) to measure light levels via a photo resistor

#include <PS_TemperatureHumidity.h>  //Implements a Polling Sensor (PS) to measure Temperature and Humidity via DHT library
#include <PS_DS18B20_Temperature.h>  //Implements a Polling Sesnor (PS) to measure Temperature via DS18B20 libraries 
#include <PS_Water.h>        //Implements a Polling Sensor (PS) to measure presence of water (i.e. leak detector)
#include <IS_Motion.h>       //Implements an Interrupt Sensor (IS) to detect motion via a PIR sensor
#include <IS_Contact.h>      //Implements an Interrupt Sensor (IS) to monitor the status of a digital input pin
#include <IS_Smoke.h>        //Implements an Interrupt Sensor (IS) to monitor the status of a digital input pin
#include <IS_DoorControl.h>  //Implements an Interrupt Sensor (IS) and Executor to monitor the status of a digital input pin and control a digital output pin
#include <IS_Button.h>       //Implements an Interrupt Sensor (IS) to monitor the status of a digital input pin for button presses
#include <EX_Switch.h>       //Implements an Executor (EX) via a digital output to a relay
#include <EX_Alarm.h>        //Implements Executor (EX)as an Alarm Siren capability via a digital output to a relay
#include <S_TimedRelay.h>    //Implements a Sensor to control a digital output pin with timing capabilities

//*************************************************************************************************
//NodeMCU v1.0 ESP8266-12e Pin Definitions (makes it much easier as these match the board markings)
//*************************************************************************************************
//#define LED_BUILTIN 16
//#define BUILTIN_LED 16
//
//#define D0 16  //no internal pullup resistor
//#define D1  5
//#define D2  4
//#define D3  0  //must not be pulled low during power on/reset, toggles value during boot
//#define D4  2  //must not be pulled low during power on/reset, toggles value during boot
//#define D5 14
//#define D6 12
//#define D7 13
//#define D8 15  //must not be pulled high during power on/reset

//******************************************************************************************
//Define which Arduino Pins will be used for each device
//******************************************************************************************
#define PIN_WATER_1               A0  //NodeMCU ESP8266 only has one Analog Input Pin 'A0'

#define PIN_ALARM_1               D0  //SmartThings Capabilty "Alarm"
//#define PIN_SWITCH_1              D1  //SmartThings Capability "Switch"
//#define PIN_CONTACT_1             D2  //SmartThings Capabilty "Contact Sensor"
#define PIN_BUTTON_1              D3  //SmartThings Capabilty Button / Holdable Button (Normally Open!)
#define PIN_BUTTON_2              D4  //SmartThings Capabilty Button / Holdable Button (Normally Open!)
#define PIN_MOTION_1              D5  //SmartThings Capabilty "Motion Sensor" (HC-SR501 PIR Sensor)
#define PIN_SMOKE_1               D6  //SmartThings Capabilty "Smoke Detector"
#define PIN_TEMPERATURE_1         D7  //SmartThings Capabilty "Temperature Measurement" (Dallas Semiconductor DS18B20)
#define PIN_TIMEDRELAY_1          D8  //SmartThings Capability "Relay Switch"


//Garage Door Pins 
#define PIN_DOORCONTROL_CONTACT_1 D1  //SmartThings Capabilty "Door Control" - the Contact Sensor (reed switch)
#define PIN_DOORCONTROL_RELAY_1   D2  //SmartThings Capabilty "Door Control" - the relay output


//******************************************************************************************
//ESP8266 WiFi Information
//******************************************************************************************
String str_ssid     = "yourSSIDhere";                           //  <---You must edit this line!
String str_password = "yourWiFiPasswordhere";                   //  <---You must edit this line!
IPAddress ip(192, 168, 1, 227);       //Device IP Address       //  <---You must edit this line!
IPAddress gateway(192, 168, 1, 1);    //Router gateway          //  <---You must edit this line!
IPAddress subnet(255, 255, 255, 0);   //LAN subnet mask         //  <---You must edit this line!
IPAddress dnsserver(192, 168, 1, 1);  //DNS server              //  <---You must edit this line!
const unsigned int serverPort = 8090; // port to run the http server on

// Smartthings Hub Information
IPAddress hubIp(192, 168, 1, 149);    // smartthings hub ip     //  <---You must edit this line!
const unsigned int hubPort = 39500;   // smartthings hub port

//******************************************************************************************
//st::Everything::callOnMsgSend() optional callback routine.  This is a sniffer to monitor 
//    data being sent to ST.  This allows a user to act on data changes locally within the 
//    Arduino sktech.
//******************************************************************************************
void callback(const String &msg)
{
//  Serial.print(F("ST_Anything Callback: Sniffed data = "));
//  Serial.println(msg);
  
  //TODO:  Add local logic here to take action when a device's value/state is changed
  
  //Masquerade as the ThingShield to send data to the Arduino, as if from the ST Cloud (uncomment and edit following line)
  //st::receiveSmartString("Put your command here!");  //use same strings that the Device Handler would send
}

//******************************************************************************************
//Arduino Setup() routine
//******************************************************************************************
void setup()
{
  //******************************************************************************************
  //Declare each Device that is attached to the Arduino
  //  Notes: - For each device, there is typically a corresponding "tile" defined in your 
  //           SmartThings Device Hanlder Groovy code, except when using new COMPOSITE Device Handler
  //         - For details on each device's constructor arguments below, please refer to the 
  //           corresponding header (.h) and program (.cpp) files.
  //         - The name assigned to each device (1st argument below) must match the Groovy
  //           Device Handler names.  (Note: "temphumid" below is the exception to this rule
  //           as the DHT sensors produce both "temperature" and "humidity".  Data from that
  //           particular sensor is sent to the ST Hub in two separate updates, one for 
  //           "temperature" and one for "humidity")
  //         - The new Composite Device Handler is comprised of a Parent DH and various Child
  //           DH's.  The names used below MUST not be changed for the Automatic Creation of
  //           child devices to work properly.  Simply increment the number by +1 for each duplicate
  //           device (e.g. contact1, contact2, contact3, etc...)  You can rename the Child Devices
  //           to match your specific use case in the ST Phone Application.
  //******************************************************************************************
  //Polling Sensors
  static st::PS_Water               sensor1(F("water1"), 60, 20, PIN_WATER_1, 200);
  static st::PS_DS18B20_Temperature sensor2(F("temperature1"), 15, 0, PIN_TEMPERATURE_1, false, 10, 1); 
  
  //Interrupt Sensors 
  //static st::IS_Contact             sensor3(F("contact1"), PIN_CONTACT_1, LOW, true);
  static st::IS_DoorControl         sensor3(F("doorControl1"), PIN_DOORCONTROL_CONTACT_1, LOW, true, PIN_DOORCONTROL_RELAY_1, LOW, true, 1000); //configured for Active Low Relay Board
  static st::IS_Button              sensor4(F("button1"), PIN_BUTTON_1, 1000, LOW, true, 500);
  static st::IS_Button              sensor5(F("button2"), PIN_BUTTON_2, 1000, LOW, true, 500);
  static st::IS_Motion              sensor6(F("motion1"), PIN_MOTION_1, HIGH, false);
  static st::IS_Smoke               sensor7(F("smoke1"), PIN_SMOKE_1, HIGH, true, 500);

  //Special sensors/executors (uses portions of both polling and executor classes)
  static st::S_TimedRelay           sensor8(F("relaySwitch1"), PIN_TIMEDRELAY_1, LOW, false, 3000, 0, 1);
  
  //Executors
  static st::EX_Alarm executor1(F("alarm1"), PIN_ALARM_1, LOW, true);
  //static st::EX_Switch executor2(F("switch1"), PIN_SWITCH_1, LOW, true);  //Inverted logic for "Active Low" Relay Board
  
  //*****************************************************************************
  //  Configure debug print output from each main class 
  //  -Note: Set these to "false" if using Hardware Serial on pins 0 & 1
  //         to prevent communication conflicts with the ST Shield communications
  //*****************************************************************************
  st::Everything::debug=true;
  st::Executor::debug=true;
  st::Device::debug=true;
  st::PollingSensor::debug=true;
  st::InterruptSensor::debug=true;

  //*****************************************************************************
  //Initialize the "Everything" Class
  //*****************************************************************************

  //Initialize the optional local callback routine (safe to comment out if not desired)
  st::Everything::callOnMsgSend = callback;
  
  //Create the SmartThings ESP8266WiFi Communications Object
    //STATIC IP Assignment - Recommended
    st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, ip, gateway, subnet, dnsserver, serverPort, hubIp, hubPort, st::receiveSmartString);
 
    //DHCP IP Assigment - Must set your router's DHCP server to provice a static IP address for this device's MAC address
    //st::Everything::SmartThing = new st::SmartThingsESP8266WiFi(str_ssid, str_password, serverPort, hubIp, hubPort, st::receiveSmartString);

  //Run the Everything class' init() routine which establishes WiFi communications with SmartThings Hub
  st::Everything::init();
  
  //*****************************************************************************
  //Add each sensor to the "Everything" Class
  //*****************************************************************************
  st::Everything::addSensor(&sensor1);
  st::Everything::addSensor(&sensor2);
  st::Everything::addSensor(&sensor3);
  st::Everything::addSensor(&sensor4); 
  st::Everything::addSensor(&sensor5); 
  st::Everything::addSensor(&sensor6); 
  st::Everything::addSensor(&sensor7);  
  st::Everything::addSensor(&sensor8);  
      
  //*****************************************************************************
  //Add each executor to the "Everything" Class
  //*****************************************************************************
  st::Everything::addExecutor(&executor1);
  //st::Everything::addExecutor(&executor2);
    
  //*****************************************************************************
  //Initialize each of the devices which were added to the Everything Class
  //*****************************************************************************
  st::Everything::initDevices();
  
}

//******************************************************************************************
//Arduino Loop() routine
//******************************************************************************************
void loop()
{
  //*****************************************************************************
  //Execute the Everything run method which takes care of "Everything"
  //*****************************************************************************
  st::Everything::run();
}
2 Likes

Sweet, thanks! Makes much more sense now! Yes my relay pulls low to trigger. which is an issue since I plan on using this for the garage door and we occasionally have power outages. I have tried with the relay attached an it hangs on boot and also triggers the relays. No good… I plan on adding a Mosfet that on boot will be trigged after a short pause. Still in the works.

Also you have spent a bit of time on this. Do you have a donation page or something?

Chris,

No donation page. I enjoy giving back to the community. Your success is my reward. (Although, I wouldn’t so “no” to new free hardware to integrate into ST_Anything! :slight_smile: If you have a new microcontroller or sensor that you’d like to see integrated, I am willing to listen!)

I am using a 2-channel relay board like the following on from Amazon. Using the exact same code I posted above, I do NOT have any cycling of the relays during an NodeMCU ESP8266 power on or reset cycle. I am powering the relay module with a constant 5V and triggering it with the GPIO pin D2 of the NodeMCU ESP8266. If you’re having issues during power on, I’d recommend trying different NodeMCU ESP8266 GPIO pins for the relay output to see if you can find one that works best for your application

I have done some research (as noted in the ReadMe) regarding the various limitations of the GPIO pins of the NodeMCU ESP8266 based boards (LoLin v3 and Amica boards.) There are definitely GPIO pins you should avoid to prevent spurious state changes during the reset/power on cycle. I believe D1, D2, D5, D6, and D7 are the safest pins to use based on my research and experimental findings. YMMV, of course.

Well thanks again for all your time. This is exactly what ST needs. I have the exact same relay board, I think I actually used a link in one of your other threads to buy it. After looking at the GPIO list I think I might be using D8, which would explain my problem.

My other projects after I get this completed are: ESP8266 with accelerometer on the washer and dryer to notify me when they are done. I have already datalogged both my washer and dryer with an Arduino UNO, next hurdle is I2C with the ESP8266. Other project is DIY motorized curtains.

Yep, D8 is not the best choice for a Active Low Logic relay board.

For my Washer and Dryer, I am using an Aeon Labs 1st Gen Power Meter with a custom Device Handler. I was able to buy a few of these for <$15 each during a sale a few months back.

https://www.amazon.com/Aeon-Labs-AEDSB09104ZWUS-Aeotec-Monitor/dp/B00DIBSKFU/ref=sr_1_1?ie=UTF8&qid=1496335727&sr=8-1&keywords=aeon+power+meter

And here is the custom Device Handler which sends “button pushed” events to CoRE to send my wife and me text messages each time either the washer or dryer is complete. It works very well. I tried using a SmartThings Multisensor’s accelerometer, but it wasn’t reliable. The power meter has been working great for me.

1 Like

:smiley: Dunno about the others in here, but I’d be up for reading a blog post one day about all the quirky automations you’ve got running in your house Dan.

1 Like

Interesting idea, although I really don’t have too many quirky automations actually running. I do still run an Arduino UNO + Thingshield (using very old code still) to act as a Temperature + Humidity, sensor Motion sensor, 4 door sensors, and 2 garage doors controllers. That was the project that started it all. I hope to replace the UNO/Thingshield with a NodeMCU ESP8266 in the near future as the performance is much quicker. I am hoping it is as reliable!

The washer/dryer monitoring system was something others in the community had come up with. I was planning on using an ESP8266 to monitor the power usage of each of these devices, and I had even bought a pair of clamp-on current transformers for the project. But then there was that awesome deal on the Aeon v1 power monitoring z-wave devices. It was too good a deal to pass up, and was nicely and neatly packaged already.

I have considered building a whole home power monitoring system, with each breaker in my panel being monitored independently. I just haven’t found the energy for that project :wink:

The rest of my SmartThings devices are pretty normal - GE Z-Wave switches and dimmers, a few GE Link bulbs, ST Multi sensors and motion sensors here and there throughout the house, a water sensor monitoring the Air Conditioning drip pan, a siren, etc…

I really enjoy putting the puzzle pieces together with respect to the Arduino C++ world and the physical devices, sensors, and actuators. That’s why I am always intrigued by use cases other come up with. Here are some of the things that I’ve added to ST_Anything as user requests:

  • RCSwitch (inexpensive 433MHz RF devices)
  • Adafruit Thermocouple
  • Dallas Semiconductor DS18B20
  • A paddle wheel pulse counter to measure water flow using Arduino Hardware Interrupts
  • A dimmable switch (using Arduino PWM output)

One of my other fun projects was tearing apart a Cree Connected light bulb to get its Zigbee module. I then connected this to an Arduino Nano and am able discern On/Off and 100 dim levels, each of which can be used to execute a routine on the Arduino as the user sees fit. Amazing how the NodeMCU ESP8266 modules are now so much cheaper than the light bulb + arduino hack!

2 Likes

Dan,
Was thinking ahead to the motorized curtains, what would be the best way to go about this?
I would like to pass a value to the ESP8266 (0-100% like a dimmer?) to denote a position. The only two executor classes you have are the Alarm, and Switch, can others be added? Can you point me in the right direction?

There is a dimmer switch class as well. Look in the ST_Anything library folder and you’ll find it. Read the comments at the top of the .h or .cpp file. You will need to tweak it to run the motor.

Note: I do not believe I have created a Child Dimmer Switch Device Handler yet… if not, I should be able to create one this weekend.

1 Like

Hey Dan have you looked into the MQ2 Smoke, Gas, & CO2 sensor?

I’ll send you one for testing if needed