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

It's this one I'm using:

I have tried the Arduino ethernet tool and it doesn't get anything at all from it using the DHCPAddressPrinter, no IP, no MAC and it's a generic board so nothing on it, no instructions etc. The LEDs are flashing indicating it is seeing network traffic, it's just not doing anything.

So my thinking is that it's faulty in some way.

K.

It's a known issue with that shield that I was unaware of.

Official Adruino one now ordered.

K.

Got the genuine Arduino board and it's way better, in case anyone else thinks about saving a few quid or whatever, just get the genuine one.

So I now have an IP, whoo hoo.

But on the MAC address, on the board it's A8:61:0A:AE:74:B4 which is a different format to that used in the sketch, do I just use it as it is shown on the sticker of the board in the sketch? Comma separated as per the example.

K.

Hold that thought... restarted and all working fine it appears, child devices all created without issue! :slight_smile:

K.

Sorry for this off topic question, but I believe Iā€™ve got the right audience in this thread.

Iā€™m looking for a Zigbee alternative to Arduino, ESP32 and ESP8266. I only use my devices for controlling relays or detecting changes to circuits controlled by other ā€œrelaysā€ such as motion sensor or door contact type of circuits.

Replacing the relays is easy, but is there anything available to replace the ā€œlistening to a circuitā€ function? I donā€™t even know what such a device would be called so I have no idea what to search for.

Yes, this is a little off topic, so please continue this in a new thread if needed. :wink:

I will try to provide you with a couple of quick answers to help get you started.

Here is one possible off-the-shelf solution if what you need are Zigbee relays.

https://www.amazon.com/MHCOZY-Adjustable-Self-Lock-Momentary-Interlock/dp/B091GS6J5W/ref=sr_1_2_sspa?keywords=zigbee+relay&qid=1656801675&sr=8-2-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExUFUzWUs2UUFBMkJBJmVuY3J5cHRlZElkPUEwNzQ0ODA0Qkg1S0xONE9BVUlNJmVuY3J5cHRlZEFkSWQ9QTA2Njg0MzIyVUNETEkwV1hMRUtIJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==

If youā€™re looking for more of a DIY solution, take a look at the Mona Lisa from @haas. It has some digital inputs you could use to monitor motion and contact sensors. I wrote a Hubitat driver for it that you can find in my GitHub repo.

Another DIYish Zigbee solution is @iharyadiā€™s boards.

Hope this helps get you started!

Thanks Dan. I now know what to look/ask for, so Iā€™ll create a new topic.

1 Like

I made this to integrate with my alarm system using the 'on-board' outputs that it has. The outputs deliver 12vdc so I bought a low current relay board to make them dry outputs and wired them into an esp32 using @ogiewon 's awesome Hubduino :grin:

I appreciate it could be neater but it's functional.

This allows me to use the existing 'wired' intruder alarm PIR sensors / door contacts and bring them in to Hubitat to trigger rules etc for lighting/alerts. It was a very cost effective project, the relay board was Ā£26, the ESP32 was Ā£7 and the rest was liberated from ahem work.

Cheers again Dan for your efforts with Hubduino

5 Likes

Sorry, it's been a while since I started a new project, I see in the posts that people have used the HC-SR04 Ultrasonic sensor but I haven't found a sample sketch for it can someone point me in the right direction?

Thanks.

Take a look at this sketch. I know it says it is for an ESP01, but that is just an ESP8266 variant. In any event, you should be able to at least use the Ultrasonic device declaration as a starting point for whatever microcontroller you'd like to use.

1 Like

I see there is a PS_Illuminance.h/cpp any chance of you making a PS_Color.h/cpp for the TCS34725 or give me some pointers?
A friend is looking to detect green and red leds

Thanks much !!
Tim

Oh wait...i see ST_Anything_AdafruitTCS34725_Illum_Color

1 Like

Trying to determine the local network address of my Hubduino ESP32. The local network address that shows up in my Hubduino device page, is not one of the network addresses that my router has currently assigned. (I assume this was the case sometime in the past, but my router has assigned it a new address). Regardless my Hubduino works fine. Is there any way to determine what the current ip address of the ESP32 board is and/or its MAC address? Thanks.

By default, the user configures the Arduino Sketch with whatever TCP/IP address theyā€™d like for their home network. It is defined in the actual code, unless the user modifies the code to use a reserved DHCP address instead of a static IP address.

Also, on the Hubitat side the user is required to fill in the IP address of the HubDuino microcontroller. Thus, if it is working, it should be visible in the settings section of the HubDuino Parent Device on the hub.

Lastly, one can connect the Arduino IDE to the microcontroller via a USB cable, open up the Arduino IDEā€™s serial monitor window, and then restart the microcontroller. Youā€™ll see some debug lines printed out with the network information.

1 Like

Thanks for the quick reply. I actually think my router is damaged. I had a lightning strike a few months ago and the router has been odd ever sense. The IP address I have filled in on the HubDuino Parent Device is not listed in my router's list of connected clients. But I can tell my Hubitat is connected via wifi to the ESP32 since it is getting the data. The ESP32 is probably connected to my router with the IP address shown in HubDuino, just my router is so messed up it doesn't show it.

Anyway I am done with Modems/Routers/Wifi all in one devices from your ISP. I just pickup an TP-Link Omada switch, router, access point, and controller. Just currently trying to figure out everything I have connected to my existing network, before making the switch.

Thanks again for the quick reply.

1 Like

I've used ST_Anything/Hubduino lots on ESP8266 WemosD1 devices, but for my latest project, I'm looking at using another board I have - it's a Mega 2560 clone, with an onboard ESP8266, which seems to be referred to as a "WeMOS Mega + WiFi R3".
I want the ESP8266 to do the wifi, and the Mega to run Hubduino, to create four servo instances.
I could possibly just use a Wemos D1 mini, but I don't think it can address four servos.
This combined board has the power onboard to run 4 servos from a 12v supply, and I've already done the wiring for it.
However, I'm not a great coder, and I'm having difficulty seeing how to adapt the code samples to work on the Mega, using the ESP8266 for connectivity.
The code I've used in the Mega to connect to the wifi and set up as a demo works, the setup portion of this is as follows:

#include <WiFiEspAT.h>

WiFiServer server(80);

const int ledpin = 13;

void setup() {

 pinMode(ledpin, OUTPUT);
 Serial.begin(115200);
// while (!Serial);
 Serial.println("Starting up......");  
 Serial3.begin(115200);
 WiFi.init(Serial3);

 if (WiFi.status() == WL_NO_MODULE) {
   Serial.println("Communication with WiFi module failed!");
   // don't continue
   while (true);
 }

 WiFi.begin("SSID", "password");
 Serial.println("Waiting for connection to WiFi");
 while (WiFi.status() != WL_CONNECTED) {
   delay(1000);
   Serial.print('.');
 }
 Serial.println();

 server.begin();
 digitalWrite(ledpin,HIGH);

 IPAddress ip = WiFi.localIP();
 Serial.println();
 Serial.println("Connected to WiFi network.");
 Serial.print("To access the server, enter \"http://");
 Serial.print(ip);
 Serial.println("/\" in web browser.");
}

@ogiewon or anyone else, any pointers as to how to modify an example (possibly "ST_Anything_Multiples_EthernetW5x00_MEGA.ino") would be great. Alternatively just tell me to use two WemosD1 Minis, each driving two servos...

Thanks!

James

Bad newsā€¦. That board is actually both an Arduino Mega and an ESP8266, and each must be programmed independently. HubDuino is not designed for this type of configuration.

Iā€™d recommend using an ESP8266 or an ESP32. You might be able to run all 4 servos on a single microcontroller. Just be sure to supply power to the servos directly from the power supply, not from the microcontroller board. Obviously the PWM signal must come from the microcontroller board, and the ground wire of the power supply for the servos and the ground of the microcontroller must be tied together to share a common reference voltage.

Insufficient power is the number one problem when users try to supply the servo motor with power from the microcontroller board. It often works for one small servo, maybe two, but certainly not four.

Thanks!
I'm glad I didn't spend too much time trying!
I'll go with a wemos mini d1, and if I need to, use two.
I can common the grounds, and a separate 5v supply for the servos, and if I need to, use a level shifter to move the PWM from 3.3v up to 5v

1 Like

Hi all. I'm currently using Hubduino for a few things around the house, including monitoring my swimming pool chemical supply levels and temperature. I've just purchased an Arduino compatible hydraulic pressure sensor from Aliexpress

I'd like to replace one of my filter pressure gauges with this sensor and monitor my filter pressure. I could then use a rule to warn of a dirty filter.
It's been some time since I set up the other devices and I'm pretty rusty on Hubduino setup. Can someone suggest a good place to start my research? I believe the sensor produces varying voltage, based on pressure. I could create a voltage measuring device but I would need a way to then convert that into a pressure scale.

I would recommend starting with a PS_Voltage device.

Here is the info

//******************************************************************************************
//  File: PS_Voltage.h
//  Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)
//
//  Summary:  PS_Voltage is a class which implements the SmartThings "Voltage Measurement" device capability.
//			  It inherits from the st::PollingSensor class.  The current version uses an analog input to measure the 
//			  voltage on an anlog input pin and then scale it to engineering units.
//
//			  The last four arguments of the constructor are used as arguments to an Arduino map() function which 
//			  is used to scale the analog input readings (e.g. 0 to 1024) to Engineering Units before sending to SmartThings. 
//
//			  Create an instance of this class in your sketch's global variable section
//			  For Example:  st::PS_Voltage sensor1(F("voltage1"), 120, 0, PIN_VOLTAGE, 0, 1023, 0.0, 5.0);
//
//			  st::PS_Voltage() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name
//				- long interval - REQUIRED - the polling interval in seconds
//				- long offset - REQUIRED - the polling interval offset in seconds - used to prevent all polling sensors from executing at the same time
//				- byte pin - REQUIRED - the Arduino Pin to be used as an analog input
//				- double s_l - OPTIONAL - first argument of Arduino map(s_l,s_h,m_l,m_h) function to scale the output - minimum raw AI value
//				- double s_h - OPTIONAL - second argument of Arduino map(s_l,s_h,m_l,m_h) function to scale the output - maximum raw AI value
//				- double m_l - OPTIONAL - third argument of Arduino map(s_l,s_h,m_l,m_h) function to scale the output - Engineering Unit Min (or Max if inverting)
//				- double m_h - OPTIONAL - fourth argument of Arduino map(s_l,s_h,m_l,m_h) function to scale the output - Engineering Unit Max (or Min if inverting)
//				- byte numSamples - OPTIONAL - defaults to 1, number of analog readings to average per scheduled reading of the analog input
//				- byte filterConstant - OPTIONAL - Value from 5% to 100% to determine how much filtering/averaging is performed 100 = none (default), 5 = maximum
//
//            Filtering/Averaging
//
//				Filtering the value sent to ST is performed per the following equation
//
//				filteredValue = (filterConstant/100 * currentValue) + ((1 - filterConstant/100) * filteredValue) 
//
//----------------------------------------------------------------------------------------------------------------------------------------------