Here's my serial monitor from the Arduino IDE at bootup:
SmartThingsESP8266WiFI: Intialized
Disabling ESP8266 WiFi Access Point
ArduinoOTA Ready
Everything: init ended
Everything: Free RAM = 44304
Everything: adding sensor named motion1
Everything: Free RAM = 44304
Everything: adding sensor named motion2
Everything: Free RAM = 44304
Everything: adding sensor named contact1
Everything: Free RAM = 44304
Everything: adding executor named switch1
Everything: Free RAM = 44304
Everything: initDevices started
Everything: Free RAM = 44304
IS_Motion: 30 second Motion Sensor Calibration Started...
IS_Motion: 30 second Motion Sensor Calibration Started...
Everything: Sending: switch1 off
Everything: initDevices ended
Everything: Free RAM = 44408
Everything: Sending: contact1 open
IS_Motion: Motion Sensor Calibration Finished
IS_Motion: Motion Sensor Calibration Finished
Everything: Sending: motion1 active
Everything: Sending: motion2 active
Everything: Sending: motion2 inactive
Everything: Sending: motion1 inactive
Everything: Free Ram = 44408
This is with no sensors even hooked up. And when I hook them up and reboot the board, when I can't have the monitor hooked up, the lights that repsond to those two motion sensors turn on.
// 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 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 <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
//*************************************************************************************************
//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_MOTION_1 D5
#define PIN_MOTION_2 D6
#define PIN_CONTACT_1 D1
#define PIN_SWITCH_1 D2
//******************************************************************************************
//ESP8266 WiFi Information
//******************************************************************************************
String str_ssid = "Caslerville"; // <---You must edit this line!
String str_password = "toomanysecrets"; // <---You must edit this line!
IPAddress ip(192, 168, 1, 108); //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 / Hubitat Hub TCP/IP Address
IPAddress hubIp(192, 168, 1, 12); // smartthings/hubitat hub ip // <---You must edit this line!
// SmartThings / Hubitat Hub TCP/IP Address: UNCOMMENT line that corresponds to your hub, COMMENT the other
//const unsigned int hubPort = 39500; // smartthings hub port
const unsigned int hubPort = 39501; // hubitat 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);
//if (msg == "contact1 open") {st::receiveSmartString("switch1 on");}
//if (msg == "contact1 closed") {st::receiveSmartString("switch1 off");}
}
//******************************************************************************************
//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
//Interrupt Sensors
static st::IS_Motion sensor1(F("motion1"), PIN_MOTION_1, HIGH, false, 500);
static st::IS_Motion sensor2(F("motion2"), PIN_MOTION_2, HIGH, false, 500);
static st::IS_Contact sensor3(F("contact1"), PIN_CONTACT_1, LOW, true, 1000);
//Executors
static st::EX_Switch executor1(F("switch1"), PIN_SWITCH_1, LOW, false);
//*****************************************************************************
// 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);
//*****************************************************************************
//Add each executor to the "Everything" Class
//*****************************************************************************
st::Everything::addExecutor(&executor1);
//*****************************************************************************
//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();
}
And there's my sketch.
And this is the log from Hubitat when I just did the exact same thing you just did:
[dev:183] 2018-10-26 23:10:47.762 debug parse(motion active) called
How are your sensors wired? For a HIGH interupt or LOW? Could it be because the pin is floating for that period of time? The sensors I have are HIGH so I can't use the internal pull-up, cause it will always read active, right? The sensors are simple HC-SR501's.
They output 3.3v on active.