[DEPRECATED] ST_Anything - Arduino/ESP8266/ESP32

I tried one more debug concept. I went into the EX_Switch_Dim.cpp and inserted a Serial.print right at the top of the method for beSmart.

Here it is for you to examine:
void EX_Switch_Dim::beSmart(const String &str)
{
Serial.print(F("EX_Switch_Dim Got Here")); // <------ paul put this here
String s=str.substring(str.indexOf(' ')+1);
if (st::Executor::debug) {
Serial.print(F("EX_Switch_Dim::beSmart s = "));
Serial.println(s);
}
if(s==F("on"))
{
m_bCurrentState=HIGH;
}
...

I think this should send a note to the serial monitor whenever beSmart gets called. I never seems to get triggered. Hmmmm.

Had to do a factory reset of my router couple days ago and all 5 of my esp8266 devices running ST_Anything SmartThingsESP8266WiFi.h quit communicating. They dont even show up on the routers wi-fi list. All my regular devices reconnected work fine and show up on the router wifi list, laptop, phone, cameras, etc… Been 2 days now and still nothing, tried a router reboot, a hub reboot, power cycling the esp devices… Did not change the sketch or library/board manger revisions. Any ideas? They were fine before the router reset. Got some wemos minis and feather Huzzah boards.

Wow, spent some time to catch up on this thread and saw one post where Dan said check your ST hub IP address, sure enough after the reset I needed to re-assign my hubs static IP. Fixed those dead devices! Been almost 2 years since I set up that IP so forgot, awesome. However my 2 device running Mega;s with esp01’s on HW serial are still down.

1 Like

@ogiewon Hey Dan how are you?? Time for another project :slight_smile: … I have an equipment “rack” in my home theater that i want to monitor for temperature as it runs hot. I also have a couple of 110v computer looking fans connected to a ihome smart plug so i was thinking about using something like this
https://www.amazon.com/gp/product/B07L6CYFT9/ref=ox_sc_act_title_2?smid=A1VTL661FOEJB1&psc=1
to monitor for temperature than use webcore to turn on and off the smart plug depending on the temperature values assigned
Can you help me out on how i can flash this esp01 with ST-Anything so i can monitor for temperature please??

Thank you
Denis

Correct, that should work as you expect.

What makes no sense to me is that you can click REFRESH on the Parent Device in the ST Classic App on your mobile phone, and that works - correct? But clicking ON/OFF on the child device does not - correct?

If you run the ST_Anything_Multiples_W5100 (or W5500 depending on your shield type) example sketch, does it work or not? For the simple Switch (no dimmer) devices.

Denis,

Flashing the ESP-01 is a bit of a challenge. You’ll need to find a guide on the web that walks you through this process. Build your programming circuit and get that working with normal example Arduino sketches before you attempt anything to do with ST_Anything. I tried recently to get an ESP-01 working to help test an issue another user was having - I was NOT successful and I simply gave up after a few days of fighting with it.

If it was me, I wouldn’t bother with an ESP-01 these days. There are so many other boards out there that make programming simple with on-board USB. The Wemos D1’s seem popular, and they offer an array of shields that stack on them. I also like the fact that boards with an on-board usb connection can be powered via that same connection when deployed.

If you want a really cool, ready to run Zigbee device, that does temperature, humidity, barometric pressure, and illuminance - take a look at @iharyadi’s Environment Sensors. I have three of them and they work great!

Yes… the simple switch works just fine. Only the dim switches are misbehaved.

OK, that helps quite a bit. I’ll set up a lab system this weekend and will attempt to reproduce the issue.

Hey Dan thank you for your prompt reply as always.
I already have one of those esp-01 and DHT22 sensors and they look very well built

I have modified one of these


and used it to flash many esp-01 boards including one above we did together [RELEASE] ST_Anything v2.9.2 - Arduino/ESP8266/ESP32 to ST via ThingShield, Ethernet, or WiFi
that had the serial communication with the relay that works like a charm with you ST_Anything. Also the esp-is going to be just feet away from the router in the same room so the wifi coverage is not an issue.
If you don’t mind lets just give it a try to get a ST_anything sketch uploaded to it that will get 2 values one for temperature and one for humidity and see how it works!!

Thanks again
Denis

I don’t mind at all. Just start with the example ESP01 sketch and modify it to add a DHT22 device instead of whatever is there currently. That’s all thee is to it.

You can find the syntax for the DHT22 PS_TemperatureHumdity device in the Arduino W5100 example sketch.

Paul,

So, I just fired up an Arduino MEGA + W5100 shield running the following sketch. Everything is working perfectly as far as two-way communications between all six switch-type devices and the SmartThings cloud/classic mobile app on my phone.

The one issue I am having is the nagging duplicate child device issue. For this test, I simply ignored the duplicate and used whichever child device actually works (one will work completely, the other will not.) Do not delete the duplicate child devices as that messes up everything, which should be very evident in your Live Logging display in the ST Web IDE.

I was able to turn On and Off the 2 dimmerSwitch devices, and adjust their dimmer levels.

Here’s the sketch if you’d like to give it a try. Be sure to tweak the networking section’s IP addresses.

//******************************************************************************************
//  File: ST_Anything_Multiples_EthernetW5100.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 Arduino + Ethernet W5100 Shield 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 Ethernet W5100 Shield.
//
//            ST_Anything_Multiples implements the following ST Capabilities in multiples of 2 as a demo of what is possible with a single Arduino
//              - 2 x Door Control devices (used typically for Garage Doors - input pin (contact sensor) and output pin (relay switch)
//              - 2 x Contact Sensor devices (used to monitor magnetic door sensors)
//              - 2 x Switch devices (used to turn on a digital output (e.g. LED, relay, etc...)
//              - 2 x Water Sensor devices (using an analog input pin to measure voltage from a water detector board)
//              - 2 x Illuminance Measurement devices (using a photoresitor attached to ananlog input)
//              - 2 x Voltage Measurement devices (using a photoresitor attached to ananlog input)
//              - 2 x Smoke Detector devices (using simple digital input)
//              - 2 x Carbon Monoxide Detector devices (using simple digital input)
//              - 2 x Motion devices (used to detect motion)
//              - 2 x Temperature Measurement devices (Temperature from DHT22 device)
//              - 2 x Humidity Measurement devices (Humidity from DHT22 device)
//              - 2 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"
//              - 2 x Alarm devices - 1 siren only, 1 siren and strobe (using simple digital outputs)
//              - 2 x Dimmer Switch devices - uses 2 digital outputs, one for on/off and one for pwm level
//              - 2 x MQ-2 Smoke Detector devices (using simple analog input compared to user defined limit)
//
//            During the development of this re-usable library, it became apparent that the 
//            Arduino UNO R3's very limited 2K of SRAM was very limiting in the number of 
//            devices that could be implemented simultaneously.  A tremendous amount of effort
//            has gone into reducing the SRAM usage, including siginificant improvements to
//            the SmartThings Arduino library.
//
//            Note: This sketch was fully tested on an Arduino MEGA 2560 using the Ethernet W5100 Shield.
//    
//  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-16  Dan Ogorchock  New sketch to demonstrate multiple SmartThings Capabilties of each type
//    2017-04-22  Dan Ogorchock  Added Voltage, Carbon Monoxide, and Alarm with Strobe
//    2017-07-04  Dan Ogorchock  Added MQ-2 based Smoke Detection
//
//******************************************************************************************
//******************************************************************************************
// SmartThings Library for Arduino Ethernet W5100 Shield
//******************************************************************************************
#include <SmartThingsEthernetW5100.h>    //Library to provide API to the SmartThings Ethernet W5100 Shield

//******************************************************************************************
// 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 on an analog input pin 
#include <PS_Voltage.h>      //Implements a Polling Sensor (PS) to measure voltage on an analog input pin 
#include <PS_TemperatureHumidity.h>  //Implements a Polling Sensor (PS) to measure Temperature and Humidity via DHT library
#include <PS_Water.h>        //Implements a Polling Sensor (PS) to measure presence of water (i.e. leak detector) on an analog input pin 
#include <PS_MQ2_Smoke.h>    //Implements an Polling Sensor (PS) to monitor the status of an analog input pin from a MQ2 sensor
#include <IS_Motion.h>       //Implements an Interrupt Sensor (IS) to detect motion via a PIR sensor on a digital input pin
#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_CarbonMonoxide.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 capability with Siren and Strobe via digital outputs to relays
#include <S_TimedRelay.h>    //Implements a Sensor to control a digital output pin with timing/cycle repeat capabilities
#include <EX_Switch_Dim.h>   //Implements an Executor (EX) for a switch (on/off) and pwm output (level) uses 2 digital output pins

//**********************************************************************************************************
//Define which Arduino Pins will be used for each device
//  Notes: Arduino communicates with both the W5100 and SD card using the SPI bus (through the ICSP header). 
//         This is on digital pins 10, 11, 12, and 13 on the Uno and pins 50, 51, and 52 on the Mega. 
//         On both boards, pin 10 is used to select the W5100 and pin 4 for the SD card. 
//         These pins cannot be used for general I/O. On the Mega, the hardware SS pin, 53, 
//         is not used to select either the W5100 or the SD card, but it must be kept as an output 
//         or the SPI interface won't work.
//         See https://www.arduino.cc/en/Main/ArduinoEthernetShieldV1 for details on the W5100 Sield
//**********************************************************************************************************
//"RESERVED" pins for W5100 Ethernet Shield - best to avoid
#define PIN_4_RESERVED            4   //reserved by W5100 Shield on both UNO and MEGA
#define PIN_1O_RESERVED           10  //reserved by W5100 Shield on both UNO and MEGA
#define PIN_11_RESERVED           11  //reserved by W5100 Shield on UNO
#define PIN_12_RESERVED           12  //reserved by W5100 Shield on UNO
#define PIN_13_RESERVED           13  //reserved by W5100 Shield on UNO
#define PIN_50_RESERVED           50  //reserved by W5100 Shield on MEGA
#define PIN_51_RESERVED           51  //reserved by W5100 Shield on MEGA
#define PIN_52_RESERVED           52  //reserved by W5100 Shield on MEGA
#define PIN_53_RESERVED           53  //reserved by W5100 Shield on MEGA


//Analog Pins
#define PIN_WATER_1               A0  //SmartThings Capability "Water Sensor"
#define PIN_WATER_2               A1  //SmartThings Capability "Water Sensor"
#define PIN_ILLUMINANCE_1         A2  //SmartThings Capability "Illuminance Measurement"
#define PIN_ILLUMINANCE_2         A3  //SmartThings Capability "Illuminance Measurement"
#define PIN_VOLTAGE_1             A4  //SmartThings Capability "Voltage Measurement"
#define PIN_VOLTAGE_2             A5  //SmartThings Capability "Voltage Measurement"
#define PIN_SMOKE_3               A8  //SmartThings Capability "Smoke Detector"
#define PIN_SMOKE_4               A9  //SmartThings Capability "Smoke Detector"

//Digital Pins
#define PIN_TEMPERATUREHUMIDITY_1 22  //SmartThings Capabilities "Temperature Measurement" and "Relative Humidity Measurement"
#define PIN_TEMPERATUREHUMIDITY_2 23  //SmartThings Capabilities "Temperature Measurement" and "Relative Humidity Measurement"
#define PIN_MOTION_1              24  //SmartThings Capability "Motion Sensor"
#define PIN_MOTION_2              25  //SmartThings Capability "Motion Sensor"
#define PIN_CONTACT_1             26  //SmartThings Capability "Contact Sensor"
#define PIN_CONTACT_2             27  //SmartThings Capability "Contact Sensor"
#define PIN_SWITCH_1              28  //SmartThings Capability "Switch"
#define PIN_SWITCH_2              29  //SmartThings Capability "Switch"
#define PIN_TIMEDRELAY_1          30  //SmartThings Capability "Relay Switch"
#define PIN_TIMEDRELAY_2          31  //SmartThings Capability "Relay Switch"
#define PIN_SMOKE_1               32  //SmartThings Capability "Smoke Detector"
#define PIN_SMOKE_2               33  //SmartThings Capability "Smoke Detector"
#define PIN_ALARM_1               34  //SmartThings Capability "Alarm"
#define PIN_ALARM_2               40  //SmartThings Capability "Alarm"
#define PIN_STROBE_2              41  //SmartThings Capability "Alarm"              
#define PIN_CO_1                  42  //SmartThings Capability "Carbon Monoxide Detector"
#define PIN_CO_2                  43  //SmartThings Capability "Carbon Monoxide Detector"

//Dimmer Switch Pins
#define PIN_DIMMERLEVEL_1         44  //SmartThings Capability "Switch Level"  NOTE: MUST BE A PWM CAPABLE PIN!
#define PIN_DIMMERSWITCH_1        45  //SmartThings Capability "Switch"
#define PIN_DIMMERLEVEL_2         46  //SmartThings Capability "Switch Level"  NOTE: MUST BE A PWM CAPABLE PIN!
#define PIN_DIMMERSWITCH_2        47  //SmartThings Capability "Switch"

//Garage Door Pins 
#define PIN_DOORCONTROL_CONTACT_1 35  //SmartThings Capabilty "Door Control" 
#define PIN_DOORCONTROL_RELAY_1   36  //SmartThings Capabilty "Door Control" 
#define PIN_DOORCONTROL_CONTACT_2 37  //SmartThings Capabilty "Door Control"  
#define PIN_DOORCONTROL_RELAY_2   38  //SmartThings Capabilty "Door Control" 

//Pushbutton Pins
#define PIN_BUTTON1               48  //SmartThings Capabilty Button / Holdable Button
#define PIN_BUTTON2               49  //SmartThings Capabilty Button / Holdable Button

//******************************************************************************************
//W5100 Ethernet Shield Information
//****************************************************************************************** 
byte mac[] = {0x06,0x00,0xB6,0xC8,0x11,0xD2}; //MAC address, leave first octet 0x06, change others to be unique //  <---You must edit this line!
IPAddress ip(192, 168, 1, 226);               //Arduino 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 withotu having to rely on the ST Cloud for time-critical tasks.
//******************************************************************************************
void callback(const String &msg)
{
  //Uncomment if it weould be desirable to using this function
  //Serial.print(F("ST_Anything_Miltiples 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(s) as you see fit)
  //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, 0, PIN_WATER_1, 200);
//  static st::PS_Water               sensor2(F("water2"), 60, 10, PIN_WATER_2, 200);
//  static st::PS_Illuminance         sensor3(F("illuminance1"), 60, 20, PIN_ILLUMINANCE_1, 0, 1023, 0, 1000);
//  static st::PS_Illuminance         sensor4(F("illuminance2"), 60, 30, PIN_ILLUMINANCE_2, 0, 1023, 0, 1000);
//  static st::PS_TemperatureHumidity sensor5(F("temphumid1"), 60, 40, PIN_TEMPERATUREHUMIDITY_1, st::PS_TemperatureHumidity::DHT22,"temperature1","humidity1");
//  static st::PS_TemperatureHumidity sensor6(F("temphumid2"), 60, 50, PIN_TEMPERATUREHUMIDITY_2, st::PS_TemperatureHumidity::DHT22,"temperature2","humidity2");
//  static st::PS_Voltage             sensor7(F("voltage1"), 60, 55, PIN_VOLTAGE_1, 0, 1023, 0, 5000);
//  static st::PS_Voltage             sensor8(F("voltage2"), 60, 57, PIN_VOLTAGE_2, 0, 1023, 0, 5000);
//  static st::PS_MQ2_Smoke           sensor23(F("smoke3"), 10, 3, PIN_SMOKE_3, 300);
//  static st::PS_MQ2_Smoke           sensor24(F("smoke4"), 10, 5, PIN_SMOKE_4, 300);
  
  //Interrupt Sensors 
//  static st::IS_Motion              sensor9(F("motion1"), PIN_MOTION_1, HIGH, false, 500);
//  static st::IS_Motion              sensor10(F("motion2"), PIN_MOTION_2, HIGH, false, 500);
//  static st::IS_Contact             sensor11(F("contact1"), PIN_CONTACT_1, LOW, true, 500);
//  static st::IS_Contact             sensor12(F("contact2"), PIN_CONTACT_2, LOW, true, 500);
//  static st::IS_Smoke               sensor13(F("smoke1"), PIN_SMOKE_1, HIGH, true, 500);
//  static st::IS_Smoke               sensor14(F("smoke2"), PIN_SMOKE_2, HIGH, true, 500);
//  static st::IS_DoorControl         sensor15(F("doorControl1"), PIN_DOORCONTROL_CONTACT_1, LOW, true, PIN_DOORCONTROL_RELAY_1, LOW, true, 1000);
//  static st::IS_DoorControl         sensor16(F("doorControl2"), PIN_DOORCONTROL_CONTACT_2, LOW, true, PIN_DOORCONTROL_RELAY_2, LOW, true, 1000);
//  static st::IS_Button              sensor17(F("button1"), PIN_BUTTON1, 1000, LOW, true, 500);
//  static st::IS_Button              sensor18(F("button2"), PIN_BUTTON2, 1000, LOW, true, 500);
//  static st::IS_CarbonMonoxide      sensor19(F("carbonMonoxide1"), PIN_CO_1, HIGH, true, 500);
//  static st::IS_CarbonMonoxide      sensor20(F("carbonMonoxide2"), PIN_CO_2, HIGH, true, 500);

  //Special sensors/executors (uses portions of both polling and executor classes)
  static st::S_TimedRelay           sensor21(F("relaySwitch1"), PIN_TIMEDRELAY_1, LOW, true, 3000, 0, 1);
  static st::S_TimedRelay           sensor22(F("relaySwitch2"), PIN_TIMEDRELAY_2, LOW, true, 3000, 0, 1);

  //Executors
  static st::EX_Switch              executor1(F("switch1"), PIN_SWITCH_1, LOW, true);
  static st::EX_Switch              executor2(F("switch2"), PIN_SWITCH_2, LOW, true);
//  static st::EX_Alarm               executor3(F("alarm1"), PIN_ALARM_1, LOW, true);
//  static st::EX_Alarm               executor4(F("alarm2"), PIN_ALARM_2, LOW, true, PIN_STROBE_2);
  static st::EX_Switch_Dim          executor5(F("dimmerSwitch1"), PIN_DIMMERSWITCH_1, PIN_DIMMERLEVEL_1, LOW, false);   
  static st::EX_Switch_Dim          executor6(F("dimmerSwitch2"), PIN_DIMMERSWITCH_2, PIN_DIMMERLEVEL_2, LOW, false);    

  //*****************************************************************************
  //  Configure debug print output from each main class 
  //*****************************************************************************
  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 EthernetW5100 Communications Object
    //STATIC IP Assignment - Recommended
    st::Everything::SmartThing = new st::SmartThingsEthernetW5100(mac, 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::SmartThingsEthernetW5100(mac, serverPort, hubIp, hubPort, st::receiveSmartString);

  //Run the Everything class' init() routine which establishes Ethernet communications with the 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);
//  st::Everything::addSensor(&sensor9); 
//  st::Everything::addSensor(&sensor10); 
//  st::Everything::addSensor(&sensor11);
//  st::Everything::addSensor(&sensor12);
//  st::Everything::addSensor(&sensor13);
//  st::Everything::addSensor(&sensor14); 
//  st::Everything::addSensor(&sensor15); 
//  st::Everything::addSensor(&sensor16); 
//  st::Everything::addSensor(&sensor17); 
//  st::Everything::addSensor(&sensor18); 
//  st::Everything::addSensor(&sensor19); 
//  st::Everything::addSensor(&sensor20); 
  st::Everything::addSensor(&sensor21); 
  st::Everything::addSensor(&sensor22); 
//  st::Everything::addSensor(&sensor23);
//  st::Everything::addSensor(&sensor24);
      
  //*****************************************************************************
  //Add each executor to the "Everything" Class
  //*****************************************************************************
  st::Everything::addExecutor(&executor1);
  st::Everything::addExecutor(&executor2);
//  st::Everything::addExecutor(&executor3);
//  st::Everything::addExecutor(&executor4);
  st::Everything::addExecutor(&executor5);
  st::Everything::addExecutor(&executor6);
  
  //*****************************************************************************
  //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();
}

Here is the Arduino Serial Monitor window output while I was changing the devices via my phone’s Class ST App.

01:10:52.810 -> Everything: Sending: dimmerSwitch1 on
01:10:52.949 -> Everything: Sending: dimmerSwitch1 23
01:10:54.682 -> Everything: Free Ram = 6391
01:11:00.192 -> Everything: Received: dimmerSwitch1 off
01:11:00.192 -> EX_Switch_Dim::beSmart s = off
01:11:00.192 -> Everything: Sending: dimmerSwitch1 off
01:11:00.329 -> Everything: Sending: dimmerSwitch1 23
01:11:03.461 -> Everything: Received: dimmerSwitch1 24
01:11:03.461 -> EX_Switch_Dim::beSmart s = 24
01:11:03.461 -> Everything: Sending: dimmerSwitch1 on
01:11:03.565 -> Everything: Sending: dimmerSwitch1 24
01:11:13.807 -> Everything: Received: dimmerSwitch1 off
01:11:13.807 -> EX_Switch_Dim::beSmart s = off
01:11:13.807 -> Everything: Sending: dimmerSwitch1 off
01:11:13.946 -> Everything: Sending: dimmerSwitch1 24
01:11:24.296 -> Everything: Received: dimmerSwitch2 off
01:11:24.296 -> EX_Switch_Dim::beSmart s = off
01:11:24.296 -> Everything: Sending: dimmerSwitch2 off
01:11:24.401 -> Everything: Sending: dimmerSwitch2 0

OK. Well… I’m getting the same behavior here as before. So it must be something local to my setup. If I sort it out, I’ll report it back to you to help future stuck people. Thanks for the extra effort this weekend.

1 Like

Are you sure you’re running all of the latest and greatest Arduino and Groovy code? Just a thought :thinking:

I know that the ESP8266 ESP-12e can work as standalone. But is there any way to use it with Arduino MEGA? I can only see documentation for the ESP-01

Are you trying to use an ESP8266-12e as a WiFi shield for an Arduino MEGA 2560? If yes, then you would have to load the proper firmware on the ESP-12e to make it do so. While technically possible, can you please explain exactly what you’re trying to accomplish? If you need more GPIO than what the ESP8266-12e can support, you may want to look at using an ESP32 based board instead. The only truly stable network connection I have ever had on the Arduino MEGA is to use the W5100 or W5500 Ethernet shields.

Yes I was wondering that I can have access to more GPIOs.

Thanks fro your help!

Go with the ESP32 instead and save yourself the headache. I tried to get an arduino to work with an ESP01 as a WIFI shield and it was nothing but a pain in the butt. The ESP32 has a whole bunch of pins available.

1 Like

I had 2 Mega boards running hardware serial to esp01 boards up for a year without issue. Then after a router reset they never came back up. Converted 1 of them so a esp32 board and the other mega connected to a w5500 ethernet module.

All good now and without the headache of esp01 com to mega. Its a pain to figure out the esp01 serial buad rate and use AT commands to set it. Like was mentioned just go with a esp32 board.

1 Like

Hi,

Hopefully a quick and easy question, can I use the door control but with a toggle switch as the input rather than a momentary? I want to have a switch be in one position to trigger and power on a relay and show the open/closed status just like the standard momentary method which my new actuator doesn’t support.

Hopefully I’ve explained that correctly!

Thanks in advance.
Dan.

I am a little confused by this request. Are you asking for a standard “switch” output? That is, “Door Control Open” means the output stays on, and “Door Control Closed” means the output stays off?

The tricky part is that the current implementation, has a momentary input to toggle the door state, and that results in a momentary digital output. This is per the standard ST Capability design. Of course, this may not meet your requirements.

If you can explain your how your actuator works, we should be able to come up with something.