Yup I have the included library. I figured out that I didnât declare the gpio pin 2 in the define portion. After doing that I got it compiled.
//******************************************************************************************
// File: ST_Anything_Multiples_EthernetW5100.ino
// Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)
//
// Edited by Ed Lentz and used in the Lentz Home
// 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.
//
//******************************************************************************************
// 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_DS18B20_Temperature.h> //Implements a Polling Sesnor (PS) to measure Temperature via DS18B20 libraries
#include <PS_AdafruitBME280_TempHumidPress.h> //Implements a Polling Sensor (PS) to measure Temperature, humidity, and Pressure using BME280 via I2C
//#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_Contact.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 <S_TimedRelay.h> //Implements a Sensor to control a digital output pin with timing/cycle repeat capabilities
//**********************************************************************************************************
//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"
//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_CONTACT_1 38 //SmartThings Capability "Contact Sensor"
#define PIN_CONTACT_2 39 //SmartThings Capability "Contact Sensor"
#define PIN_CONTACT_3 40 //SmartThings Capability "Contact Sensor"
#define PIN_CONTACT_4 41 //SmartThings Capability "Contact Sensor"
#define PIN_CONTACT_5 42 //SmartThings Capability "Contact Sensor"
#define PIN_CONTACT_6 43 //SmartThings Capability "Contact Sensor"
//Relay Outputs
#define PIN_SWITCH_1 22 //SmartThings Capability "Relay 1--Veg Lites"
#define PIN_SWITCH_2 23 //SmartThings Capability "Relay 2--Flower Lites"
#define PIN_SWITCH_3 24 //SmartThings Capability "Relay 3--Pool Pump"
#define PIN_SWITCH_4 25 //SmartThings Capability "Relay 4--Solar Valve"
#define PIN_SWITCH_5 26 //SmartThings Capability "Relay 5--Water Valve"
#define PIN_SWITCH_6 27 //SmartThings Capability "Relay 6"
#define PIN_SWITCH_7 28 //SmartThings Capability "Relay 7"
#define PIN_SWITCH_8 29 //SmartThings Capability "Relay 8"
#define PIN_SWITCH_9 30 //SmartThings Capability "Relay 9"
#define PIN_SWITCH_10 31 //SmartThings Capability "Relay 10"
#define PIN_SWITCH_11 32 //SmartThings Capability "Relay 11"
#define PIN_SWITCH_12 33 //SmartThings Capability "Relay 12"
#define PIN_SWITCH_13 34 //SmartThings Capability "Relay 13"
#define PIN_SWITCH_14 35 //SmartThings Capability "Relay 14"
//Garage Door Pins
#define PIN_DOORCONTROL_CONTACT_1 44 //SmartThings Capability "Door Sensor North Door"
#define PIN_DOORCONTROL_RELAY_1 36 //SmartThings Capability "Door Control North Door"
#define PIN_DOORCONTROL_CONTACT_2 45 //SmartThings Capability "Door Sensor South Door"
#define PIN_DOORCONTROL_RELAY_2 37 //SmartThings Capability "Door Control South Door"
#define PIN_TEMPERATURE_1 2//SmartThings Capabilty âTemperature Measurementâ (Dallas Semiconductor DS18B20)
//******************************************************************************************
//W5100 Ethernet Shield Information
//******************************************************************************************
byte mac[] = {0x06,0x02,0x03,0x04,0x05,0x06}; //MAC address, leave first octet 0x06, change others to be unique // <---You must edit this line!
IPAddress ip(192, 168, 1, 50); //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 / Hubitat Hub TCP/IP Address
IPAddress hubIp(192, 168, 1, 6); // 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
//******************************************************************************************
//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 would 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_DS18B20_Temperature sensor1(F("temperature"), 20, 5, PIN_TEMPERATURE_1, false, 10, 4);
//Interrupt Sensors
static st::IS_Contact sensor2(F("contact1"), PIN_CONTACT_1, LOW, true, 500);
static st::IS_Contact sensor3(F("contact2"), PIN_CONTACT_2, LOW, true, 500);
static st::IS_DoorControl sensor4(F("doorControl1"), PIN_DOORCONTROL_CONTACT_1, LOW, true, PIN_DOORCONTROL_RELAY_1, LOW, true, 1000);
static st::IS_DoorControl sensor5(F("doorControl2"), PIN_DOORCONTROL_CONTACT_2, LOW, true, PIN_DOORCONTROL_RELAY_2, LOW, true, 1000);
//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_Switch executor3(F("switch3"), PIN_SWITCH_3, LOW, true);
static st::EX_Switch executor4(F("switch4"), PIN_SWITCH_4, LOW, true);
static st::EX_Switch executor5(F("switch5"), PIN_SWITCH_5, LOW, true);
static st::EX_Switch executor6(F("switch6"), PIN_SWITCH_6, LOW, true);
static st::EX_Switch executor7(F("switch7"), PIN_SWITCH_7, LOW, true);
static st::EX_Switch executor8(F("switch8"), PIN_SWITCH_8, LOW, true);
static st::EX_Switch executor9(F("switch9"), PIN_SWITCH_9, LOW, true);
static st::EX_Switch executor10(F("switch10"), PIN_SWITCH_10, LOW, true);
static st::EX_Switch executor11(F("switch11"), PIN_SWITCH_11, LOW, true);
static st::EX_Switch executor12(F("switch12"), PIN_SWITCH_12, LOW, true);
static st::EX_Switch executor13(F("switch13"), PIN_SWITCH_13, LOW, true);
static st::EX_Switch executor14(F("switch14"), PIN_SWITCH_14, LOW, true);
//*****************************************************************************
// 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);
//*****************************************************************************
//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);
st::Everything::addExecutor(&executor7);
st::Everything::addExecutor(&executor8);
st::Everything::addExecutor(&executor9);
st::Everything::addExecutor(&executor10);
st::Everything::addExecutor(&executor11);
st::Everything::addExecutor(&executor12);
st::Everything::addExecutor(&executor13);
st::Everything::addExecutor(&executor14);
//*****************************************************************************
//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 it is I might still tonight get it all hooked up
Thanks alot!