[RELEASE] ST_Anything v2.9.7 - Arduino/ESP8266/ESP32 to ST via ThingShield, Ethernet, or WiFi

This is great to see! I plan to start using this when I get finished with my current project - controlling some RGBW led strings with ST. Hope your using the Arudino IDE to program the ESP8266, but I guess that I will see.
Thanks again - Been using the original ThingShield to control my Garage Doors since the beginning. Now my GD open automatically when I return home from work.

Will it be able to run both this and mysensors gateway on the same Arduino? In that way we could expand our systems both easy and cheap

Yes, everything is done via the Arduino IDE. I built everything using v1.8.1.

I have been wanting to add some RGB Lighting Support as I have a 5m strip of NeoPixels laying around. Should be a simple matter of adding another ST_Anything device sub-class, possibly of the EX_Switch class. Should be fun! I am hoping the ESP8266 is compatible with the NeoPixels. I know an Arduino UNO/MINI/MEGA works with them.

While I have looked at MySensors in the past, I have not looked at trying to combine ST_Anything with MySensors. Seems like trying to squeeze two Master Controllers into the same Arduino. Sounds complicated to me, but maybe it would be simpler than I am thinking.

Thanks for the reply.
I believe that the ESP8266 can control the NeoPixels as it is a digital RGB that can be controlled by just 2 digital pins. (Info is located at: https://learn.adafruit.com/digital-led-strip where they use a Arduino.) I am controlling an Analog RGB, separate input for each color, using a SmartLife H801 controller which is ESP8266 based. (See [RELEASE] SmartLife (H801) RGBW LED Strip Wifi Controller & Bulb for reference.)
I wanted to buy a 1M RGBW but they are only available in digital, so I have been stuck. If you get NeoPixels working then this would add another option for the community, and of course fix my problem. Also, it would work out pretty well as the other project only works for Analog LED’s and your would work for the Digital ones.
First I gotta get my ESP working with your new Anything v2.

2 Likes

I have added support for using the inexpensive ESP-01 WiFi module in conjunction with an Arduino MEGA 2560 to the SmartThings v2.1 library.

I have also added a new example to ST_Anything that demonstrates the usage of this new hardware comnination. Please see the new ST_Anything_WiFiEsp.ino sketch.

I just added support for running ST_Anything directly on the tiny ESP-01 module. The ESP-01 is normally used to add WiFi capabilities to an Arduino. However, it is quite capable all by itself. It only has 2 GPIO digital pins, but often this is all that is necessary.

New ESP-01 standalone example sketches can be found in my github repository at

WOW WOW WOW…and THANK YOU! This is beyond cool and worked like a charm on the first shot via your instrux and code. I loaded it onto an ESP826612E (NodeMCU V0.9 I have HUUUGE plans for using this goodness on all kinda ‘Things’. Once again, Thank you VERY MUCH and have a most wonderful weekend!

1 Like

Glad to hear it’s working for you. Please let me know if you have any suggestions for improvements.

Any chance for more of a how-to writeup? Like This is how you add the library, this is how you add the sketch, etc.
I have two ESP8266’s on order and I want to get ready… Already have the Mega 2560.
Thanks for your work on this!

Never mind - I just found your writeup. Looks comprehensive even enough for me!

1 Like

Have you read the two ReadMe’s already in my Github Repository? They are linked in the first post. If not, that’s a good place to start. I detail the exact steps on what to copy where on your system.

Also, there are a multitude of guides already online on how to use the Arduino IDE, including the use of libraries.

Note: Use the “Manual Installation” instructions
https://www.arduino.cc/en/Guide/Libraries

And for using an ESP8266 with the Arduino IDE


or
https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon

4 Likes

Thanks Dan!

Has anyone found an appropriate Arduino breadboard shield to use with the ESP8266?
A full size breadboard won’t fly…

1 Like

I ordered a few of these for my NodeMCU boards and they work quite nicely.

2 Likes

Thanks - I ordered two. Adafruit also has an ESP8266 board. Ordered one of those.
At least these things are cheap enough to play with!

Hi @ogiewon,

Complete noob here but I can see you’re a bit of a guru when in comes to ST anything. I’ve been getting my head around Smartthings a bit but when it comes to Arduino I know nothing. However, I’m a fast learner.

I’m working on a residential construction project so there is the potential for some paid consultation if you are interested.

There are 25 blinds in the house to be bought, these will more than likely be from China with 433Mhz multi channel remote controls (because they’re cheap). I’ve tested one with a Aeon micro motor controller and got it up and running on ST but we want to be able to control the blinds from the room without the use of the phone. Due to my limitations with coding etc I’m thinking of using the dry contacts on the motor controller to put an up down stop switch in each window. But by the time we buy 25 motor controllers and 25 switches that wont look out of place the cost is starting to add up.

What could you recommend for getting the up down and stop functions on ST so that we could use the original 433 remotes in each room? Bearing in mind my limitations and the fact that this is not my home and if something goes wrong the owner would need to get some sort of support.

I appreciate your help with this and I look forward to hearing from you.
Regards,
Jack

Sorry, but I have absolutely no time nor desire to support a “customer” with this type of integration. It is much more geared toward the home hobbyist. If I were you, I would get the customer to buy some sort of off-the-shelf ready-to-run solution for their blinds, especially if you have little experience with Arduino/ESP8266/SmartThings. While it definitely works, it is not 100% reliable due to the cloud-based architecture of SmartThings.

That being said, if you really want to roll-your-own solution, I did do some 433MHz integration a few years back using my ST_Anything library and a RCSwitch library for the Arduino. It was a fun little project, but not sure how many folks actually found it useful. I am not planning on updating the example sketch and groovy device handler for the new v2.x release, so it currently works with the old ThingShield. It wouldn’t be all that hard for you to figure out how to use it though, with the newer Ethernet based v2.x libraries. To download it, you’d need to grab the v1.6 release of ST_Anything from GitHub, as I did not include it in v2.x.

Not a problem, I realise this isn’t exactly how ST was designed to be used I’m just weighing up all of my options. Thanks for the input, I’ll have a look into it and see how I get on!

Hi! You had mentioned a new ST _Anything w/shield over on a different thread when I was trying to find the ST shield hardware, and so I am trying to get it up and running but am having some difficulties. I’ve managed to get all the wiring done up right, and I believe I have things on the Arduino Mega/ST Shield configured correctly (one quirk i’ll describe below) - but when I try to use the device handler to have things update in the ST app UI, they all just permanently list as ‘open’ and never update.

Here’s a paste-bin of the Arduino Mega booting up and loading the sketch: http://pastebin.com/kyqEqBSK

All the devices will print to the serial out as open/close just fine - except the GarageDoor sensor, which as soon as it lists as ‘open’ starts flapping open/closed constantly until it gets closed again. It was behaving this way when there were no wires plugged into the board so I’m not sure what’s up there. It will also occasionally spontaneously reboot.

Anyway - here’s the code actually loaded on the Mega: http://pastebin.com/TzkKX202
Sometimes it verifies and compiles without complaint, other times collect2.exe errors out after the ld command - seems like a behavioral bug with using tmp files? In any case, the code seems to work but not sure if the problem is here or in the device handler.

Here’s the device handler code: http://pastebin.com/0aAMcVmk
Again, seems like it SHOULD work but there is obviously something not quite right because they all default to ‘open’ and never update.

This is my first arduino project so I’m excited but I also have to ask a silly question - I’ve been leaving the Mega plugged into my laptop while I try and test the App side of things - do I need to detach it and just run it on basic power in order to fully test it? I hadn’t thought so since the ST shield was detected by my hub while the Mega was still attached to my laptop… but just gotta ask.

Attention to details was all that was wrong with your sketch and device handler.

Every sensor object you created in the Arduino sketch must have an EXACT, CASE SENSITIVE corresponding tile for in the Device Handler. You had spelling differences, case differences, and even whole word differences. They must match exactly.

Also, you cannot use pin 14 for the garageDoor input. Pins 14 and 15 must be jumpered to pins 2 and 3 respectively for the communications to work between the Arduino MEGA and the ThingShield. I moved your garagDoor input to pin 22. If I were using a MEGA for my project, I would start my digital inputs pins at pin 22 and go up to pin 53. Easier to avoid the pins that are on the shield that way.

Here is the updated sketch and device handler

//******************************************************************************************
//  File: ST_Anything_Doors_ThingShield.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 + SmartThings 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 SmartThings Shield.
//
//            ST_Anything_Doors implements the following:
//              - 2 x Door Control devices (used as Garage Doors)
//              - 4 x Contact Sensor devices (used to monitor magnetic door sensors)
//              - 1 x Motion device (used to detect motion in the garage)
//              - 1 x Temperature/Humidity device (unsed to monitor temp & humidity in the garage)
//
//            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.  The SmartThings library was also modified to
//            include support for using Hardware Serial port(s) on the UNO, MEGA, and Leonardo.
//            During testing, it was determined that the Hardware Serial ports provide much
//            better performance and reliability versus the SoftwareSerial library.  Also, the
//            MEGA 2560's 8K of SRAM is well worth the few extra dollars to save your sanity
//            versus always running out of SRAM on the UNO R3.  The MEGA 2560 also has 4 Hardware
//            serial ports (i.e. UARTS) which makes it very easy to use Hardware Serial instead
//            of SoftwareSerial, while still being able to see debug data on the USB serial
//            console port (pins 0 & 1).
//
//            Note: We did not have a Leonardo for testing, but did fully test on UNO R3 and
//            MEGA 2560 using both SoftwareSerial and Hardware Serial communications to the
//            Thing Shield.
//
//  Change History:
//
//    Date        Who            What
//    ----        ---            ----
//    2015-01-03  Dan & Daniel   Original Creation
//    2015-01-07  Dan Ogorchock  Modified for Door Monitoring and Garage Door Control
//    2015-03-28  Dan Ogorchock  Removed RCSwitch #include now that the libraries are split up
//    2015-03-31  Daniel O.      Memory optimizations utilizing progmem
//    2017-02-12  Dan Ogorchock  Revised to use the new SMartThings v2.0 library
//
//******************************************************************************************
 
//******************************************************************************************
// SmartThings Library for Arduino Shield
//******************************************************************************************
#include <SmartThingsThingShield.h>    //Library to provide API to the SmartThings 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 <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_TemperatureHumidity.h>  //Implements a Polling Sensor (PS) to measure Temperature and Humidity via DHT library
#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_DoorControl.h> //Implements an Interrupt Sensor (IS) and Executor to monitor the status of a digital input pin and control a digital output pin
 
//******************************************************************************************
//Define which Arduino Pins will be used for each device
//  Notes: -Serial Communications Pins are defined in Constants.h (avoid pins 0,1,2,3
//          for inputs and output devices below as they may be used for communications)
//         -Always avoid Pin 6 as it is reserved by the SmartThings Shield
//
//******************************************************************************************
//"RESERVED" pins for SmartThings ThingShield - best to avoid
#define PIN_O_RESERVED               0  //reserved by ThingShield for Serial communications OR USB Serial Monitor
#define PIN_1_RESERVED               1  //reserved by ThingShield for Serial communications OR USB Serial Monitor
#define PIN_2_RESERVED               2  //reserved by ThingShield for Serial communications
#define PIN_3_RESERVED               3  //reserved by ThingShield for Serial communications
#define PIN_6_RESERVED               6  //reserved by ThingShield (possible future use?)
 
//Motion and Temperature/Humidity Pins (Note: using Analog pins as Digital inputs)
#define PIN_MOTION                   A0
#define PIN_TEMPERATUREHUMIDITY      A1
 
#define PIN_CONTACT_FRONT_DBL_DOOR   5
#define PIN_CONTACT_DINING_RM_WNDW   7
#define PIN_CONTACT_LVNG_PATIO_DOOR  8
#define PIN_CONTACT_KTCH_NOOK_WNDW   9
#define PIN_CONTACT_SUN_ROOM_DOOR    10
#define PIN_CONTACT_SUN_ROOM_WNDW    11
#define PIN_CONTACT_BEDROOM1_WNDW    12
#define PIN_CONTACT_BEDROOM2_WNDW    13
#define PIN_CONTACT_GARAGE_DOOR      22
 
 
//If using SoftwareSerial (e.g. Arduino UNO), must define pins for transmit and receive
#define pinRX 3
#define pinTX 2
 
//******************************************************************************************
//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 DeviceType Groovy code
  //         - 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
  //           DeviceType Tile name.  (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 Shield in two separate updates, one for
  //           "temperature" and one for "humidity")
  //******************************************************************************************
  //Polling Sensors
  //static st::PS_TemperatureHumidity sensor1(F("temphumid"), 120, 10, PIN_TEMPERATUREHUMIDITY, st::PS_TemperatureHumidity::DHT22);
 
  //Interrupt Sensors
  //static st::IS_Motion sensor2(F("motion"), PIN_MOTION, HIGH, false);
  //static st::IS_DoorControl sensor3(F("leftDoor"), PIN_CONTACT_LEFTGARAGE_DOOR, LOW, true, PIN_RELAY_LEFTGARAGE_DOOR, LOW, true, 1000);
  //static st::IS_DoorControl sensor4(F("rightDoor"), PIN_CONTACT_RIGHTGARAGE_DOOR, LOW, true, PIN_RELAY_RIGHTGARAGE_DOOR, LOW, true, 1000);
 
  static st::IS_Contact sensor1(F("frontDoubleDoors"), PIN_CONTACT_FRONT_DBL_DOOR, LOW, true);
  static st::IS_Contact sensor2(F("diningRoomWindows"), PIN_CONTACT_DINING_RM_WNDW, LOW, true);
  static st::IS_Contact sensor3(F("livingRoomPatioDoor"), PIN_CONTACT_LVNG_PATIO_DOOR, LOW, true);
  static st::IS_Contact sensor4(F("kitchenNookWindows"), PIN_CONTACT_KTCH_NOOK_WNDW, LOW, true);
  static st::IS_Contact sensor5(F("sunroomPatioDoor"), PIN_CONTACT_SUN_ROOM_DOOR, LOW, true);
  static st::IS_Contact sensor6(F("sunroomWindows"), PIN_CONTACT_SUN_ROOM_WNDW, LOW, true);
  static st::IS_Contact sensor7(F("bedroom1Windows"), PIN_CONTACT_BEDROOM1_WNDW, LOW, true);
  static st::IS_Contact sensor8(F("bedroom2Windows"), PIN_CONTACT_BEDROOM2_WNDW, LOW, true);
  static st::IS_Contact sensor9(F("garageDoor"), PIN_CONTACT_GARAGE_DOOR, LOW, true);
 
  //Executors
  //static st::EX_Switch executor1(F("sampleEX"), PIN_sampleEX, LOW, true);
 
 
  //*****************************************************************************
  //  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 Thingshield Communications Object based on Arduino Model
#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) || defined(ARDUINO_AVR_MINI)   //Arduino UNO, NANO, MINI
  st::Everything::SmartThing = new st::SmartThingsThingShield(pinRX, pinTX, st::receiveSmartString);      //Use Software Serial
#elif defined(ARDUINO_AVR_LEONARDO)  //Arduino Leonardo
  st::Everything::SmartThing = new st::SmartThingsThingShield(&Serial1, st::receiveSmartString);  //Use Hardware Serial
#elif defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560)  //Arduino MEGA 1280 or 2560
  st::Everything::SmartThing = new st::SmartThingsThingShield(&Serial3, st::receiveSmartString);  //Use Hardware Serial
#else
  //assume user is using an UNO for the unknown case
  st::Everything::SmartThing = new st::SmartThingsThingShield(pinRX, pinTX, st::receiveSmartString);               //Software Serial
#endif
 
  //Run the Everything class' init() routine which establishes communications with SmartThings
  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);
 
  //*****************************************************************************
  //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();
}

Device Handler

/**
 *  ST_Anything_Doors Device Type - ST_Anything_Doors.device.groovy
 *
 *  Copyright 2015 Daniel Ogorchock
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *  Change History:
 *
 *    Date        Who            What
 *    ----        ---            ----
 *    2015-01-10  Dan Ogorchock  Original Creation
 *
 *
 */
 
metadata {
    definition (name: "ST_Anything_Doors_KriegTiger", namespace: "ogiewon", author: "Daniel Ogorchock") {
        capability "Sensor"
        capability "Contact Sensor"

        attribute "frontDoubleDoors", "string"
        attribute "diningRoomWindows", "string"
        attribute "livingRoomPatioDoor", "string"
        attribute "kitchenNookWindows", "string"
        attribute "sunroomPatioDoor", "string"
        attribute "sunroomWindows", "string"        
        attribute "bedroom1Windows", "string"
        attribute "bedroom2Windows", "string"
        attribute "garageDoor", "string"
    }
 
    simulator {

    }
   
    // tile definitions
    tiles {
        standardTile("frontDoubleDoors", "device.frontDoubleDoors", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("livingRoomPatioDoor", "device.livingRoomPatioDoor", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("sunroomPatioDoor", "device.sunroomPatioDoor", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("diningRoomWindows", "device.diningRoomWindows", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("kitchenNookWindows", "device.kitchenNookWindows", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("sunroomWindows", "device.sunroomWindows", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("bedroom1Windows", "device.bedroom1Windows", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("bedroom2Windows", "device.bedroom2Windows", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
        standardTile("garageDoor", "device.garageDoor", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
            state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#ffa81e")
            state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#79b821")
        }
       
        main (["frontDoubleDoors"])
        details(["frontDoubleDoors","livingRoomPatioDoor","sunroomPatioDoor","diningRoomWindows","kitchenNookWindows","sunroomWindows","bedroom1Windows","bedroom2Windows","garageDoor"])
    }
}
 
//Map parse(String description) {
def parse(String description) {
    def msg = zigbee.parse(description)?.text
    log.debug "Parse got '${msg}'"
 
    def parts = msg.split(" ")
    def name  = parts.length>0?parts[0].trim():null
    def value = parts.length>1?parts[1].trim():null
 
    name = value != "ping" ? name : null
 
    def result = createEvent(name: name, value: value)
 
    log.debug result
 
    return result
}
2 Likes

Ahh, thanks! The example I was following had consistency in the files themselves but not across code (arduino -> device handler -> etc). I will update it asap. :]

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.