Thingshield replacement solution for about $15 - can connect smartthings to arduino again over zigbee!

If you recall the old Thingshield, it was an arduino shield that let you connect your arduino project to smartthings, over zigbee. It makes for endless possibilities, allowing you to create any zigbee device you like, very simply. Unfortunately, smartthings stopped making the Thingshield a few years ago.

I believe I now have a replacement, called “Mona Lisa”, based on the cc2530 zigbee chip from TI. It can pass 16 character strings to/from a smartthings device handler to/from the cc2530 device, which then passes the strings to/from a simple serial port that you can connect to 2 pins on your arduino (or anything else, like even a computer with a usb -serial adapter). That’s basically all the Thingshield did.

On top of that, it can also have some functionality without being attached to an arduino (or any other device). It has four 3.3V digital outputs you could use to control other things, and four 12-bit analog inputs you can use to sense things. It’s also a zigbee router, to expand the reach of your network (with an optional external antenna too).

Here’s what it looks like at the moment. The import bit is all on that little daughter board. I’ll be making a different carrier board that’s smaller and fits an arduino (and without bodge wires :)).

And here’s what the device handler looks like. And the code for it.

Please let me know your thoughts!
And PM me if you’re interested in beta-testing one of these, for just a $15 donation.

11 Likes

Andy,

Nice work! Glad to see someone is working on a Zigbee solution for the Maker Community.

One thing you may want to look into… Instead of using a bunch of custom commands/attributes to implement the multiple Switch and Voltage Sensor devices, take a look at using a Composite Device design in your DTH. This will result in one Parent device, and multiple Child Devices. This allows each child device to implement the standard Switch capability, for example, thereby allowing all SmartApps to easily use each one without any custom code. Just an idea! :wink:

6 Likes

Here is what the custom arduino shield board looks like, to connect the cc2530 module to an arduino uno.


Again, PM me if you’re interested in trying one out. I am having 10 boards made this round, and they’ll be available next week.

1 Like

The real thing!


I have 5 more available to test now… Just PM me.

2 Likes

Very nice! I am eager to get my hands on one!

1 Like

Documentation is evolving here…

2 Likes

There is now an eBay listing for it… Plus there’s a driver for Hubitat available now.

1 Like

Just grabbed one. Looking forward to banging on this thing…

I want one please?
Have a project that would suit it well.
What’s next?

Grab one from eBay…

1 Like

I’ve been looking everywhere to find something that will work with the new smartthings app and not the classic. Will the new MonaLisa work?

It still works for me, at least the on/off functionality. I’m not sure how to write custom drivers / interfaces for the new app.

@drandyhaas I am in need of some help. I like Mona Lisa but still learning ow to use it.
I am using the example sketch from the guide but only with habitat / Zigbee pairing.
I can connect to Hubitat and control the LEDs with On/Of1-4 but having trouble to understand what pins correspond to the digital output e.g. LEDs and also how to write the sketch so that I can catch the input from the digital input and then based on this set the servo in a specific position.
Please check if you can the sample code below and advise. I get form the sketch that I can use PIN 5 and this is where my service control wire is but I am missing something in the logic to capture the digital On and then send command to servo motor to move through the executor

//******************************************************************************************

// File: ST_Anything_Servos_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_Servos implements the following ST Capabilities as a demo of what is possible with a single NodeMCU ESP8266
// - 2 x Servo Motor devices (using PWM output) - these utilize the “Switch Level” Capability
//
// Change History:
//
// Date Who What
// ---- — ----
// 2018-06-24 Dan Ogorchock Original Creation
//
//******************************************************************************************
//******************************************************************************************
// 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 <EX_Servo.h> //Implements Executor (EX)as an Switch Level capability via a PWM output to a servo motor

//*************************************************************************************************
//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_SERVO_1 D1 //SmartThings Capabilty “Switch Level”
//#define PIN_SERVO_2 D2 //SmartThings Capabilty “Switch Level”

//******************************************************************************************
//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 / Hubitat Hub TCP/IP Address
//IPAddress hubIp(192,168,86,28/); // 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);

//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 Handler 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. See the ReadMe for specifics!
// - 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. servo1, servo2, servo3, etc…) You can rename the Child Devices
// to match your specific use case in the ST Phone Application.
//******************************************************************************************
//Polling Sensors

//Interrupt Sensors

//Special sensors/executors (uses portions of both polling and executor classes)

//Executors
static st::EX_Servo executor1(F(“servo1”), PIN_SERVO_1, 90); //last argument is the starting angle for the servo (0-180)
//static st::EX_Servo executor2(F(“servo2”), PIN_SERVO_2, 90); //last argument is the starting angle for the servo (0-180)

//*****************************************************************************
// 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
//*****************************************************************************

//*****************************************************************************
//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();
}

Hi,
Happy to help.
Did you look at the MonaLisa guide (link is in this thread)?
There is a link in there to my sample arduino sketch…


The sketch you gave above is based on someone else’s code and hard for me to understand.
In my sketch, you’ll get a command printed out each time a digital input changes.
Please let me know if you need any more help!
2 Likes

The sketch you posted above does not work with @drandyhaas‘s MonaLisa shield. It is an ST_Anything sketch that relies on the ST_Anything Arduino libraries.

1 Like

thank you for the fast response @drandyhaas - I thought I got this from the Mona Lisa guide but I will check the one you pointed me to

thank you very much for the fast response @ogiewon - your contributions to the community are endless. I thought that having Hubitat options that I un-commented in there will work fine with Hubitat. I was able to use this pasted sketch to setup the device on Hubitat side and can see that I can control the 4 LED Digital input so this led me to believe that this is a good sketch. I will check what @drandyhaas recommended

Hey does this still work on SmartThings and is one available? I can’t get my ThingShield to connect to my SmartThings hub.

What Zigbee channel is your ST hub using? Try Zigbee channel 20 via the ST IDE. Higher number Zigbee channels may be problematic with older ST devices like the ThingShield.

It’s still available… Search for “MonaLisa ZigBee” on ebay.
It still connects to ST, bit default functionality is limited to on/off for the “tile” now with the new app. Boooo. Hubitat is much better!
You can still access all the functions via ST if you work on the device driver a bit, or write a new tile compatible with the new app…

1 Like