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

Sort of - i've made some mods to the sensors (omitted some, rearranged some pins etc), and commented out the callback function (was using it, no longer needed) but as far as i can think the ethernet portion is unchanged. A clip of that bit is below. I pulled the shield, same script is coming through.
Edit - it occurs to me that i've not edited that mac address. I'm a layman taking guesses here but is that address linked to the previous board, and hence this new board is unable to take the same address?

The MAC address is associated with the Ethernet Shield, not the Arduino MEGA board.

Some Ethernet Shields come with a MAC address preassigned to them. In that case, you should use that MAC address in the sketch. Older Ethernet Shields do not, and one is forced to assign a private MAC address, which is documented in the ReadMe.

Thanks for this fantastic app! After my first success building ultrasonic sensors in the garage to sense when cars are present (which works great), I'm ready to put an extra ESP8266 12E to work by building a scale for under the water softener salt tank to tell me when I'm running low.

I bought a cheap scale and a HX711 board and commenced soldering. That went fine and using Bogdan Necula's library version (0.7.5)., I can see the output on serial monitor.

The next step is HubDuino. I see there is no HX711 files in the library and I am not a skilled arduino programmer so I spent some time looking at other files in ST_Anything. I feel informed enough to ask two questions.

  1. Is adding support for weigh cells to Hubduino something you are interested in doing? I'm happy to help if it is otherwise, I'll work on a one-off for myself with less functionality.

  2. Would you recommend treating this as a polling sensor? I started working on the library files using the generic polling sensor as a starting point, but wanted to get an expert opinion before I go to far.

Well, it is not something that I have had the need for, yet. If you’d like to take a try at adding support for the HX711 load cell, I’d say go for it!

Yes, I would implement it as a polling sensor. You should be able to simply start with a pair of files, like PS_Voltage.h and PS_Voltage.cpp, and name them something like PS_HX711.h and PS_HX711.cpp. Modify those files to use the HX711 library to collect the data from the load cell, and send it back to Hubitat. Since there is no Hubitat Standard Capability for “weight”, you may want to simply send the data as a Voltage device. This will allow for integration with standard Hubitat Apps/automations.

Thanks I'll give that a try.

1 Like

Someone else did something for their salt tank using an ultrasonic sensor. You may want to do some reading before you start.

Thanks for that reminder. I used that project as a guide to hooking up two ultrasonics to an 8266 for my car sensors. Maybe I'll start with that library for the weight cells. Presence might be a slick way to report on salt.

Further in the thread someone posted a video of using a simple contact sensor to determine low/empty like a float switch. Just something to think about.

There are "through wall" level sensors that you could use and since they are essentially on/off switches the feedback fits within hubitat's standard capability's.

Several of these at full, 3/4, 1/2, 1/4 would give you remaining level and tie into the existing sample sketches without trying to adapt a load cell. IMO


Awesome idea. I think I'll try that route instead. Thanks!

Just to catch up - the shield has a mac address on a sticker, but before i blew the board it worked without me putting this in (it is the official arduino shield, 5100 i believe?). I figured i might as well change it to the one on the sticker as a last shot before i swap it out, but am not clear on the mac address. The address is 6 pairs of alpha-numerics, in the sketch it is 6 pairs of 4 digits and the notes say dont change the first octet? The read me has the example so do i omit my first 2 characters in favour of 06 then put the remaining 5 pairs in? I think i am thrown by the sketch having octets tbh.

I have a feeling this might computer science 101 but i guess we all have to begin somewhere!

If your Ethernet shield has a MAC address sticker, then you would use all six values when setting the MAC address in the sketch.

//NOTE - If your shield came with a MAC address sticker - please use that MAC address!
byte mac[] = {0x06,0x02,0x03,0x04,0x05,0x06};

So, if your sticker says 0A:4B:F5:32:CD:1F, then use those hexadecimal numbers in place of the ones above. So, it would be

byte mac[] = {0x0A,0x4B,0xF5,0x32,0xCD,0x1F};

1 Like

Got it. I will give that a go, thanks as always for the support.

usb powered water sensor with D1mini for a few bucks
Love Hubduino!!!


Reaching out for some help. I am implementing an Arduino Mega board with contact sensors, temp sensors, and 2 relay switches. I have based all of this on the MEGAWifiesp example sketch. I have the contact sensors and the temp sensors working in Hubitat, but I cannot get the relays to switch (the child devices were created in habitat fine). I have swapped out the hardware relays for 2 different hardware types. To test the relay boards I created an example sketch and test device in Hubitat on a Wemos D1 Mini to test the relay board, and it functions great, so I know I have a functional relay board. Just to make sure I covered my bases, I have also updated all of my Hubduino libraries and Arduino Libraries (pretty sure, I covered everything!).

I dove into the serial output of both the example board that works and the Mega board that I am struggling with. Here is what I am getting out of both of them

Mega Board
Pressed Off in Hubitat
Handling request from ST. tempString = 1.0 Hubitat
Everything: Received: 1.0 Hubitat
rssi 0
Pressed On in Hubitat
Handling request from ST. tempString = 1.0 Hubitat
Everything: Received: 1.0 Hubitat

Wemos Test Board (working example)
Pressed off in Hubitat
Everything: Received: switch1 off
EX_Switch::beSmart s = off
Everything: Sending: switch1 off
Pressed on in hubitat
Everything: Received: switch1 on
EX_Switch::beSmart s = on
Everything: Sending: switch1 on

If anyone has any ideas, I'm not sure where to look next :thinking: Thanks!

Are you trying to use an ESP01 as a WiFi adapter for the Arduino MEGA? I ask because I never really found that architecture to be very reliable. Have you tried using an Ethernet 5x00 Shield on the Arduino MEGA? Another option would be to use an ESP32 microcontroller as it has quite a bit more GPIO versus an ESP8266.

Yeah I am using the ESP01 with the latest version of the AT firmware. Is the output you are seeing make you think it is WIFI-related? Just seems weird that I am getting consistent results for the Contact sensors and the DHT22 temp/humid sensors in Hubitat.

This debug does not make sense.

HAHA I know, it has me perplexed! I tried doing some digging in the libraries but I just don't know enough about how all the libraries are connected. Plus the fact that the working sketch uses many of the same libraries leads me to think that those are working fine.

The only difference in each microcontroller’s sketch, is the “SmartThings…” communications library. The SmartThingsESP01WiFi library hasn’t been updated in a very long time. I spent a lot of effort years ago trying to get it working reliably to no avail. Hopefully someone else will have more luck improving it one day. Until then, the ESP32 is a decent alternative if a WiFi microcontroller is desired.

1 Like

Sounds good! The bottom line goal was that I just needed more pins without wanting to add additional Wemos boards. I'll take a look at the ESP32 here. Thanks for taking a look at my issue here and a continued thank you for this incredible project!

1 Like