[Release] HubDuino v1.1.9 - Hubitat to Arduino / ESP8266 / ESP32 / ThingShield Integration (ST_Anything)

In one of my boards I'm using the BME280 sensor to monitor THP and I've modified the sketch to update every 5 minutes (300 instead of 60)

static st::PS_AdafruitBME280_TempHumidPress sensor2(F("BME280_1"), 300, 0, "temperature1", "humidity1", "pressure1", true, 100, 0x76);

but it still pulled at random interval, why is that?

You’re looking at Hubitat “Events” which are deduplicated automatically. Thus, if the value is unchanged, a new update from the microcontroller will not result in a new Event on the Hubitat side.

1 Like

I'm testing the BME280 and a MQ7 on a ESP32 board (DEVKIT v1), to make it compile I had to comment #include <Adafruit_Sensor.h> in Adafruit_BME280.h, otherwise I'm getting

\Arduino\libraries\Adafruit_Unified_Sensor/Adafruit_Sensor.h:194:3: error: conflicting declaration 'typedef struct sensor_t sensor_t'
 } sensor_t;

Is it ok to do it or it will mess with other sensors?

Also by checking the serial monitor, with ESP32 I get many Post request timed out , which is not the case with ESP8266.

It is probably fine... I am wondering if you're using some newer version of the Adafruit libraries versus what I have in my GitHub repo? That might explain it. To be honest, it has been months since I have compiled any ST_Anything Arduino code. :thinking:

That would indicate that your Hubitat hub is either not online and accepting the Post requests from the microcontroller... OR ... that you have the wrong Hubitat Hub TCP/IP address and/or Port in your Arduino Sketch.

1 Like

That was the first thing I checked. I'm using the original libraries of the repo.

Exactly, I forgot that I was on a test board

1 Like

I'm having the same problem reported by @kuzenkohome a while back, the humidity sensor of a BME280 stop to update (temp and pressure works fine) with error:

java.lang.NumberFormatException: For input string: "nan" on line 60 (method parse)

rebooting the esp restore the updating. In my case it happens every 4/6 days. I've changed the BME280 two times but the problem it's still there. Is there anything else I can check?


I just saw this topic

@kuzenkohome commenting out this section in Adafruit library code solved the problem?

/*!
 *  @brief  Returns the humidity from the sensor
 *  @returns the humidity value read from the device
 */
float Adafruit_BME280::readHumidity(void) {
  readTemperature(); // must be done first to get t_fine

  int32_t adc_H = read16(BME280_REGISTER_HUMIDDATA);
  if (adc_H == 0x8000) // value in case humidity measurement was disabled
    return NAN;

I am trying to re-incarnate my Hubduino RFID Reader project based on RC522 chip.
The entire updated project will have:

  • one contact sensor (door open/close status);
  • two relays (control for OpenSesami door operator);
  • RGB LED Stip (status on what is going on);
  • RFID Reader (door access with RFID Tags);

New (updated) project is created step-by-step.
In a past I already created working and debugged Hubduino (Arduino) RFID Reader Sketch.
This should not be a problem to add it to a new project.

The target board is ESP-WRCOM-32 module.
Sketch (there is no RFID portion yet) compiles without any warning/errors.
All Child Devices created on the HE side and seems to be functional.
Sensor and Relay related portion is working just fine.
But I cannot make RGB LED portion working.
Output pins, defined for the controlling RGB channels (default are A0, A3, A6) on a scope
looks floating. By default these are Analog IO Pins. Somewhere they must be re-defined as
a Digital Outputs but I cannot find a correct place were is is done.
@ogiewon could you please advice what I am missing.

Just in case here is a Sketch in a current state (no RFID Code yet):


//******************************************************************************************
// File: ST_Anything_Relays_ESP8266.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_Relays_ESP8266 implements the following ST Capabilities as a demo of what is possible with a single NodeMCU ESP8266
//            - 3 x Relay Switch devices
//
//
// 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-17  Dan Ogorchock  New example showing use of Multiple device of same ST Capability
//                               used with new Parent/Child Device Handlers (i.e. Composite DH)
//    2017-05-25  Dan Ogorchock  Revised example sketch, taking into account limitations of NodeMCU GPIO pins
//    2017-11-27  Kai Lenk       Modified to 3 relaySwitch
//    2017-11-29  Dan Ogorchock  Revisions to make sure works for Kai Lenk
//    2018-02-09  Dan Ogorchock  Added support for Hubitat Elevation Hub
//
//******************************************************************************************
//******************************************************************************************
// SmartThings Library for ESP32WiFi
//******************************************************************************************
#include <SmartThingsESP32WiFi.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 <IS_Contact.h>        //Implements an Interrupt Sensor (IS) to monitor the status of a digital input pin
#include <EX_Switch.h>         //Implements an Executor (EX) via a digital output to a relay 
#include <EX_RGB_Dim.h>        //Implements an Executor (EX) for a RGB LED or strip with PWM using 3 digital output pins

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

// WiFi Credentials
#include "credentials.h"

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

// ESP32 WDOOM IO Pins
#define IN1             14

#define OUT1            25
#define OUT2            26

#define PIN_RGB1_Red    A0  //(GPIO 36) SmartThings Capability "Color Control"
#define PIN_RGB1_Green  A3  //(GPIO 39) SmartThings Capability "Color Control"
#define PIN_RGB1_Blue   A6  //(GPIO 34) SmartThings Capability "Color Control"

//******************************************************************************************
//Define which Arduino Pins will be used for each device
//******************************************************************************************

#define PIN_CONTACT_1      IN1  //Hubitat Capabilities - DIO Pin (Normally Open!)

#define PIN_RELAY_1        OUT1 //SmartThings Capability "Relay Switch"
#define PIN_RELAY_2        OUT2 //SmartThings Capability "Relay Switch"

//******************************************************************************************
//ESP832 WiFi Information
//******************************************************************************************

// Set your WiFi details so the board can connect to the WiFi and Internet

// Get Credentials from the credentials.h file
const char* str_ssid     = mySSID;
const char* str_password = myPASSWORD;

IPAddress ip        (192, 168,  20, 151);  // Device IP Address       //  <---You must edit this line!
IPAddress gateway   (192, 168,  20,   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,  20,   1);  // DNS Server              //  <---You must edit this line!
const unsigned int  serverPort = 8090;     // Port to run the HTTP Server on

// Hubitat Hub TCP/IP Address
IPAddress hubIp     (192, 168, 20,   90);  // Hubitat Hub IP          //  <---You must edit this line!

// Hubitat Hub TCP/IP Address
const unsigned int hubPort = 39501;        // Hubitat Nub 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 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
  // Name, IO Pin, Initial State, Internal Pullup, Number of Loop Counts 
  static st::IS_Contact sensor1(F("contact1"), PIN_CONTACT_1, LOW, false, 500);

  //EX_Switch arguments(Name, Pin, Initial State, Invert Logic) change last 2 args as needed for your application 
  static st::EX_Switch executor1(F("switch1"), PIN_RELAY_1,      HIGH, true);
  static st::EX_Switch executor2(F("switch2"), PIN_RELAY_2,      HIGH, true);

  // RGB Dimmer
  static st::EX_RGB_Dim executor3(F("rgbSwitch1"), PIN_RGB1_Red, PIN_RGB1_Green, PIN_RGB1_Blue, true, 0, 1, 2); // channels (0,1,2) must be unique per ESP32
 
  //*****************************************************************************
  //  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 ESP32WiFi Communications Object
    //STATIC IP Assignment - Recommended
    st::Everything::SmartThing = new st::SmartThingsESP32WiFi(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);
  
  //*****************************************************************************
  //Add each executor to the "Everything" Class
  //*****************************************************************************
  st::Everything::addExecutor(&executor1);
  st::Everything::addExecutor(&executor2);
  st::Everything::addExecutor(&executor3);
  
  //*****************************************************************************
  //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();
}

The pins you've chosen are INPUT only pins... :wink:

See ESP32 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials for a good guide on which pins are best to use. I would stick with the following pins for the best flexibility.

First off all - BIG Thank you for the very quick response.
Than was it!
But ... I used an example sketch for the reference.
These AX pins are defined in the example sketch "ST_Anything_RGB_ESP32WiFi.ino".
I was a bit surprised to see Analog Inputs to be used as Digital Outputs.

I have one more question to you.
Where will be a right place to invert output polarity?
Right now output is set to HIGH when channel is OFF but I need these opposite
because FET Transistors will be used to control LEDs.
And at 100% output still produces a very short pulse instead of being set to LOW
(with current polarity option). This is not a bid deal but could it be (better to be) corrected?
If "yes" please advice what to modify?

OK,
I changed Common Anode settings to false and this took care of both problems.
Now PWM polarity is positive and levels are solid LOW at 0% level and solid HIGH at 100%.
I am all set.

1 Like

Yea, I see that now. Thank you for pointing that out. I did not create this particular example sketch. It was contributed by a SmartThings Community member 6 years ago. Looks like you're the first person to try it since then! :wink:

// 2017-10-08 Allan (vseven) Modified for a RGB LED (single LED or LED strip)

I have fixed the pin assignments in that example sketch. Thanks!

Interesting. But it is what it is. This is exactly what I need for my updated RFID project.
Single Hubduino device will replace battery powered door sensor, Zigbee RGB Controller,
Zigbee Dual Relay and will add RFID Reader capability.

Thank you.
I am sorry to bother you but I was lazy to check pins compatibility docs.
This will remove a confusion for the future potential users (if any will try this).

Vs many ZWave/Zigbee RGB(W) controllers (I did try many but did not like them) this
DIY Hubduino RGB Controller and related HE Driver is far more flexible and intuitive to use.

1 Like

Complex DIY Hubduino project for automating Front Door is complete, debugged and integrated
with HE. This custom controller will replace Door Sensor, 2 Dry Contact Relays, RGB LED Strip
Controller and will add NFC RFID Card Reader support. Smart Phone with NFC (basically any
modern phone) can be used as RFID Tag.
@ogiewon
I still need couple minor improvements (these are not a show stoppers).

  1. In the Child RGB Driver "Set Color" button is not doing anything. It will be nice to have it
    working. I will try to fix it myself but I am not a SW guru and may not find a solution.
  2. Since I am not a SW guru all RFID reader related code simple added at the end of the
    void loop(). Everything is working just fine but I am sure, it must be better way to add
    new features to the Hubduino.
    So, only if you have few spare minutes could you help me with these two issues?

Here is a final (I think) sketch code:

//******************************************************************************************
//
// File: ST_Anything_Relays_ESP8266.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_Relays_ESP8266 implements the following ST Capabilities as a demo of what is possible with a single NodeMCU ESP8266
//            - 3 x Relay Switch devices
//
//
// 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-17  Dan Ogorchock  New example showing use of Multiple device of same ST Capability
//                               used with new Parent/Child Device Handlers (i.e. Composite DH)
//    2017-05-25  Dan Ogorchock  Revised example sketch, taking into account limitations of NodeMCU GPIO pins
//    2017-11-27  Kai Lenk       Modified to 3 relaySwitch
//    2017-11-29  Dan Ogorchock  Revisions to make sure works for Kai Lenk
//    2018-02-09  Dan Ogorchock  Added support for Hubitat Elevation Hub
//
//******************************************************************************************
//******************************************************************************************
// SmartThings Library for ESP32WiFi
//******************************************************************************************
#include <SmartThingsESP32WiFi.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 <IS_Button.h>         //Implements an Interrupt Sensor (IS) to monitor the status of a digital input pin for button presses
#include <IS_Contact.h>        //Implements an Interrupt Sensor (IS) to monitor the status of a digital input pin
#include <EX_Switch.h>         //Implements an Executor (EX) via a digital output to a relay 
#include <EX_RGB_Dim.h>        //Implements an Executor (EX) for a RGB LED or strip with PWM using 3 digital output pins

#include <Everything.h>        //Master Brain of ST_Anything library that ties everything together and performs ST Shield communications

// For the RC522 RFID Reader
#include <SPI.h>
#include <MFRC522.h>

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

// WiFi Credentials
#include "credentials.h"

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

// ESP32 WDOOM IO Pins

// Contact Sensor
#define IN_SENSOR_1     14

// Dry Contact Relay
#define OUT_RELAY_1     16
#define OUT_RELAY_2     17

// RGB LEDs
#define OUT_RGB1_Red    25
#define OUT_RGB1_Green  26
#define OUT_RGB1_Blue   27

// CR522 RFID Reader
#define SS_PIN          5
#define RST_PIN         21

// All standard ESP32 SPI Pins are used in addition
// MOSI GPIO23
// MISO GPIO19
// CLK  GPIO18

// Instantiate RC522 RFID Reader
MFRC522 rfid(SS_PIN, RST_PIN);

//******************************************************************************************
//Define which Arduino Pins will be used for each device
//******************************************************************************************

#define PIN_CONTACT_1      IN_SENSOR_1      //Hubitat Capabilities - DIO Pin (Normally Open!)

#define PIN_RELAY_1        OUT_RELAY_1      //SmartThings Capability "Relay Switch"
#define PIN_RELAY_2        OUT_RELAY_2      //SmartThings Capability "Relay Switch"

#define PIN_RGB1_Red       OUT_RGB1_Red
#define PIN_RGB1_Green     OUT_RGB1_Green
#define PIN_RGB1_Blue      OUT_RGB1_Blue

//******************************************************************************************
//ESP832 WiFi Information
//******************************************************************************************

// Set your WiFi details so the board can connect to the WiFi and Internet

// Get Credentials from the credentials.h file
const char* str_ssid     = mySSID;
const char* str_password = myPASSWORD;

IPAddress ip        (192, 168,  20, 151);  // Device IP Address       //  <---You must edit this line!
IPAddress gateway   (192, 168,  20,   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,  20,   1);  // DNS Server              //  <---You must edit this line!
const unsigned int  serverPort = 8090;     // Port to run the HTTP Server on

// Hubitat Hub TCP/IP Address
IPAddress hubIp     (192, 168, 20,   90);  // Hubitat Hub IP          //  <---You must edit this line!

// Hubitat Hub TCP/IP Address
const unsigned int hubPort = 39501;        // Hubitat Nub 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
}

//-------------------------------------------------------------------------------

// Variables for integration with Hubitat
String str_Card_ID;
String msg_Card_ID;
unsigned int cardCode;

//******************************************************************************************
//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
  // Name, IO Pin, Initial State, Internal Pullup, Number of Loop Counts 
  static st::IS_Contact sensor1(F("contact1"), PIN_CONTACT_1, LOW, true, 20);

  //EX_Switch arguments(Name, Pin, Initial State, Invert Logic) change last 2 args as needed for your application 
  static st::EX_Switch executor1(F("switch1"), PIN_RELAY_1, LOW, true);
  static st::EX_Switch executor2(F("switch2"), PIN_RELAY_2, LOW, true);

  // RGB Dimmer
  static st::EX_RGB_Dim executor3(F("rgbSwitch1"), PIN_RGB1_Red, PIN_RGB1_Green, PIN_RGB1_Blue, false, 0, 1, 2); // channels (0,1,2) must be unique per ESP32
 
  //*****************************************************************************
  //  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 ESP32WiFi Communications Object
    //STATIC IP Assignment - Recommended
    st::Everything::SmartThing = new st::SmartThingsESP32WiFi(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);
  
  //*****************************************************************************
  //Add each executor to the "Everything" Class
  //*****************************************************************************
  st::Everything::addExecutor(&executor1);
  st::Everything::addExecutor(&executor2);
  st::Everything::addExecutor(&executor3);
  
  //*****************************************************************************
  //Initialize each of the devices which were added to the Everything Class
  //*****************************************************************************
  st::Everything::initDevices();

  // Fot the RC522 RFID Reader
  Serial.begin(115200);  // Serial Port Baud Rate
  SPI.begin();           // Init SPI bus
  rfid.PCD_Init();       // Init MFRC522

  Serial.println("Tap an RFID/NFC tag on the RFID-RC522 reader");
}

//*******************************************************************************
//Arduino Loop() routine
//*******************************************************************************

void loop()
{
  //*****************************************************************************
  //Execute the Everything run method which takes care of "Everything"
  //*****************************************************************************

  st::Everything::run();

  //*****************************************************************************
  //Read RFID Tag
  //*****************************************************************************

  if (rfid.PICC_IsNewCardPresent()) // New Tag is available
  {  
    if (rfid.PICC_ReadCardSerial()) // NUID has been readed
    {
      MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
      Serial.print("RFID/NFC Tag Type: ");
      Serial.println(rfid.PICC_GetTypeName(piccType));

      // print UID in Serial Monitor in the hex format
      Serial.print("UID:");
      for (int i = 0; i < rfid.uid.size; i++)
      {
        Serial.print(rfid.uid.uidByte[i] < 0x10 ? " 0" : " ");
        Serial.print(rfid.uid.uidByte[i], HEX);
      }
      Serial.println();

      // Reset cardCode
      cardCode = 0;

      // Combine Bytes into single Word
      // Only last 4 Bytes (32 Bits) will be used as a Card ID Code
      for (int i = 0; i < rfid.uid.size; i++)
      {
        cardCode = ((cardCode << 8) + rfid.uid.uidByte[i]);
      }

      rfid.PICC_HaltA();      // halt PICC
      rfid.PCD_StopCrypto1(); // stop encryption on PCD

      // Send a Valid Card ID to Hubitat 
      str_Card_ID = String(cardCode, DEC);
      msg_Card_ID = "voltage1 " + str_Card_ID;
      st::Everything::sendSmartString(msg_Card_ID);

      // Send Trigger Event to the Hubitat
      st::Everything::sendSmartString("button1 pushed");
    }
  }
  //*****************************************************************************
}

Here is an error from RGB Child:

UPDATE
RGB Child Component is not working as expected.
On, Off, All preset colors buttons are working just fine.
Set Color, Set Saturation and Set Hue buttons are not working and producing Java Errors:

There is no way I can fix this myself (not enough programming skills).
Ideally I would like to see a Button for the direct RGB settings say, in hex format 0xRRGGBB
I am sure, this could be added relatively easy.

@ogiewon
For passing 32-bit RFID code per yours suggestion long time ago I am using
"child-voltage-sensor.groovy" child device driver. Messages from Hubdiono on Serial Port
always showing a correct RFID number passed to the HE. However (and somehow this depend
on actual integer value) Voltage is not updating and stuck with old value. This happens when
Number of Decimal Places is set to 0. If it is not 0 than everything is correct however dealing with
this floating numbers becomes tricky. Looking at "child-voltage-sensor.groovy" code I cannot
even imagine how it may fail if number of decimal places is set to 0.
What I am missing here?
Is it any better (more native and elegant) way to pass 32-bit (actually 64-bit will be even better
because some RFID tags are sending 7 or even 10 bytes, but sure, 32-bit (4 bytes) is OK) value
to the HE whatever child driver?

Just take the Child Voltage driver, make a copy of it, and give it a new name. Then modify the code however you see fit. Then, change the driver type of your existing RFID child device to use the new one. This gives you the flexibility to mess around with the code as much as you’d like, without impacting any of your other Child Voltage devices.

Well, I am thinking hard to take this approach. But I have one BIG obstacle - my SW experience
with all these modern/new languages like Groovy is "one way ticket". I.e. I can more or less clearly
understand whatever already written but when it time to modify something, ops - I don't know
what functions are already exist, which parameters to use, etc, etc, ... etc.
Very good example is this "voltage child device". I looked at this code for hours and could not
understand why it failing the way I am observing. To my eyes it should work just fine but it
does not. So, how can I modify this code if the existing one looks good?
Plus I cannot clearly understand how to debug something in the HE environment.
It seems like the only debugging option is to stick logs left and right.

There is not much code in the Child Voltage driver. Simply enable the logging so you can see exactly what is sent from the microcontroller and is being “parsed” by the driver.

You will then see this section of code

if (name && value) {
54
        if (numDecimalPlaces == null) {
55
            device.updateSetting("numDecimalPlaces", [value: "1", type: "enum"])
56
        }
57
        
58
        if (numDecimalPlaces == "0") {
59
            int tmpValue = Float.parseFloat(value)
60
            sendEvent(name: name, value: tmpValue, unit: "V")
61
        }
62
        else {
63
            float tmpValue = Float.parseFloat(value)
64
            tmpValue = tmpValue.round(numDecimalPlaces.toInteger())
65
            sendEvent(name: name, value: tmpValue, unit: "V")
66
        }
67
    }
68
    else {
69
        log.error "Missing either name or value.  Cannot parse!"
70
    }

My guess is that the RFID “value” is not an actual floating point number, correct? If so, then simply eliminate the code that deals with converting the ‘value’ into a float, and the associated rounding.

Groovy is pretty simple. And 5he above code is pretty easy to read, IMHO. Give it a shot. You’ll probably surprise yourself with how easy it is to make simple changes.

Your code will probably just need

sendEvent(name: name, value: value)

Which eliminates all of the decimal place rounding code.

What does the RFID “value” look like? Provide an example.

RFID is a byte array with usually 4 bytes, some tags will send 7 bytes and even 10 bytes is possible.
Here is screen shot prom hubduino serial terminal:

image
UID: is a RFID Code from reader.
First two UIDs are from regularMUFAIR tags.
Third one is from my Android Phone.
These are 4 bytes (32-bit) unsinged integers.
Last two are from advanced MIFARE Tags (the same tag scanned twice) and its code is
7 bytes long. There are even tags with 10 bytes code.
From the Hubduino I am sending only last 4 bytes of whatever RFID code is.
First - 4 bytes should be more than enough and second - I don't want to deal with
lolg long (ie. 64-bit) integers on the Hubduino/Arduino side.
Bottom line - Hubduino always sends a correct 32-bit unsinged integer to the HE.
And yes, all what I need is to get this integer to the RM Rule whichever way is more
appropriate.
I will try to modify voltage child driver according to yours suggestions and see
what happens. But I am really surprised to see the existing child voltage driver
very strange behavior. Somehow it fails to pass/get current value and shows older
(but not lates older) value. From the driver code I don't see how this even possible.

OK, from the existing driver I removed everything but left the suggested line of code.
So far so good. Everything seems to be working as expected. I need more testing
because at the begging the original driver worked just fine but suddenly started his
very strange behavior without any apparent reasons. Let me see how stable this
stripped version will go.