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

Since my project is to monitor Refrigerator and Freezer only with this application using the DS18B20 to be inside the Freezers and controller outside. All separate locations would require wiring back to now an ESP not a nano (thanks for that too). Why the many ESPs for wireless.

I really like your thought about using Zigbee devices but could not find them that allowed a temp prob like the DS18B20 that could be remoted up to 3' from the Zigbee device. That is cost effective, most I looked would be about $60 to $75 each.

Do any of your Zigbee Devices allow up to 3' wire to the prob? Two benefits 1) Battery inside freezer life and 2) Wireless coverage outside of a metal can.

HubDuino is a great addition to Hubitat which I likely will use, if not for this project and if I can find a reasonable cost Zigbee device - Again thank you!

Note: Have Konnected and could remote the temp probs from that if it were not for the wiring needs.

FYI adding 10 seconds offset in the polling interval seems to solve the problem (at least during 12 days of testing).

No need to comment out the section in the Adafruit library.

1 Like

Do they permit you to change the deadbolt?

Yes, if they have an access to the apartment 24/7.
This means I can use only keyed deadbolt versions (plus whatever else in addition).

That's good. It's probably a good angle for adding your reader. Perhaps a plate around the deadbolt. I've seen deadbolt door repair plates that fit under the deadbolt. Perhaps the same approach can be used to make a plate that hides your reader and the leads can run through the door at the deadbolt location.

Since I've been wanting prox support and looking around I just discovered the Alfred DB2S lock that has both prox and the z-wave option. Looks nice also. I know you want to support phones emulating NFC. I've tucked a card between my phone and the case. Not trying to take you off your project. Just sharing what I found. It's really hard to find a good outdoor prox/card reader.

This is not a primary option because phones are not always present with us (me and my wife).
But this is "nice to have" option.
As a RFID Reader I am planning to use this little board which will be easily hidden behind
apartment number plate :

The building access system is using 125KHz HID fobs/cards but for the apartment access I want
MIFARE 13.5MHz Tags. So, as a RFID Tag this dual frequency (13.5MHz + 125KHz) key fobs will
do the job:

Everything already tested and works very well. Now I need to put all electronic components
together and install my new toy.

There are zigbee temp sensors with probes on aliexpress but they are in the $25-$30 range each and may not be compatible with Hubitat There are battery operated ones the use AA or AAA batteries that you could install lithium batteries that last longer then alkaline at low temps. Again driver may be an issue but less money upfront to test.

Not exactly the same scenario but I use sonoff zigbee ZBMINI's AC mains voltage switches installed outside my home in solid aluminum weather resistant electrical work boxes so the signal will get through. If necessary you could install zigbee plugs nearby to act as repeaters

I have two DS18B20 connected to an ESP32 controller, monitoring water temp in two adjacent aquariums. The benefit of this approach (vs. other sensors, like zigbee) is that you can have a small OLED screen showing temperatures on site. The controller is powered, of course. All logic (alerts, turn fan on) is handled by Hubitat. The setup is very reliable.

How do I setup a relay to remember the last state after a reboot/powerloss?

Unfortunately, HubDuino does not currently support any sort of persistent 'memory' to restore a device to its last state after power restoration. You can choose whether you want it to default to ON or OFF, though.

That's a bummer. Is any update planned?

Nothing planned. I have no current work in progress on HubDuino.

HubDuino is Open Source code. I am always willing to entertain Pull Requests. :wink:

and how much would it cost this pull? :face_with_peeking_eye:

Questions regarding the ultrasonic support using the hc-sr04 module.

Can it support more then 1 sensor? 2 in my scenario.

If it can, can one pin be used to trigger both sensors with unique pins for each echo?

It can support two ultrasonics as I have that working. Never tried to share a trigger pin though, so can’t help you with your second question.

1 Like

Thanks I figured it could

This is amazing, I just made a smart button with a $10 ESP32 board. Thanks to all who contributed to this project!


I'm not familiar with how to do a "Pull Request" but I do have an item that I need to get working so I can move forward with a project I'm developing.
The problem I've come to is in the ST_Anything_Multiples_EthernetW5x00_MEGA arduino code example sketch. That code contains almost everything I can envision needing with one exception, it limits "temperature" sensor(s) to a DHT device and I cannot use that in my application. The physical properties of my project require the use of ds18b20 temperature sensors.

My specific application is successfully running (without hubduino) 10 discretely connected ds18b20 sensors and up to 16 relays. A small oled currently displays the temp data.

I want to expose the temp data and relay control to hubitat via hubduino using Ethernet connection.

Including ds18b20 functionality to ST_Anything_Multiples_EthernetW5x00_MEGA should serve my purposes well. I can experiment removing unnecessary components down the line.

The only other option I have is to develop a thorough understanding how the arduino code communicates to hubduino groovy code in order to include it into my current sketch(s) I do understand that specific naming of the device is required.

Sure. That's an easy one as ST_Anything already supports the DS18B20 Temperature sensor, thus no source code changes are necessary (i.e. no Pull Request is needed.)

You'll need to add an #include file to your Arduino Mega based sketch as shown below

#include <PS_DS18B20_Temperature.h>  //Implements a Polling Sesnor (PS) to measure Temperature via DS18B20 libraries 

and then add a device that uses the DS18B20 as shown below

  static st::PS_DS18B20_Temperature sensor2(F("temperature1"), 15, 0, PIN_TEMPERATURE_1, false, 10, 1); 

You can look at an example sketch that already uses this sensor for the ESP8266 by looking at the ST_Anything_Multiples_ESP8266WiFi.ino example.

Also, read the documentation for the proper use and options for this sensor, which are included at the top of every device's .h and .cpp source code files.

//  File: PS_DS18B20_Temperature.h
//  Author: Dan G Ogorchock
//  Summary:  PS_DS18B20_Temperature is a class which implements both the SmartThings "Temperature Measurement" capability.
//			  It inherits from the st::PollingSensor class.  The current version uses a digital pin to measure the 
//			  temperature from a Dallas Semiconductor One Wire DS18B20 series sensor. 
//			  Create an instance of this class in your sketch's global variable section
//			  For Example:  st::PS_DS18B20_Temperature sensor1(F("temperature1"), 120, 0, PIN_TEMPERATURE, false); (for a single sensor)
//                          st::PS_DS18B20_Temperature sensor1(F("temperature"), 120, 0, PIN_TEMPERATURE, false, 10, 3); (for 3 sensors)
//			  st::PS_DS18B20_Temperature() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - either "temperature1" for a single sensor, or "temperature" for multiple sensors
//				- 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 for the One-Wire DS18B20 sensor conenction
//				- bool In_C - OPTIONAL - true = Report Celsius, false = Report Farenheit (Farentheit is the default)
//				- byte resolution - OPTIONAL - DS18B20 sensor resolution in bits.  9, 10, 11, or 12.  Defaults to 10 for decent accuracy and performance
//				- byte num_sensors - OPTIONAL - number of OneWire DS18B20 sensors attached to OneWire bus - Defaults to 1
//				- byte sensorStartingNum - OPTIONAL - Starting number for sending temperature sensor data when using multiple sensors on one pin - Defaults to 1

Hope that helps! Let me know if you have any questions.

Thank you!
One more question, are the libraries posted on GitHub customized for HubDuino/Smartthings and are these specific libraries required for proper operation?
For example, are the DallasTemperature, OneWire, or any of the Adafruit different than the latest public versions?